certora

Write and run Certora CVL formal verification specs proving smart contract correctness.

1|1|Updated May 21, 2026
One-click install
npx skills add https://github.com/naruto11eth/cryptoskills --skill certora-naruto11eth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: certora
Source: https://github.com/naruto11eth/cryptoskills/tree/main/skills/certora
Command: npx skills add https://github.com/naruto11eth/cryptoskills --skill certora-naruto11eth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires certora-cli, solc-select, and includes references (resource) components.

What problem does it solve? Smart contract bugs can drain millions in funds, and fuzz testing only samples random inputs. This Skill guides you through Certora formal verification, which mathematically proves properties hold for all possible inputs, call sequences, and storage states — eliminating hallucinated CVL syntax and common workflow mistakes LLMs make. ## Core Features & Use Cases - CVL Spec Authoring: Write rules, invariants, ghost variables, hooks, and parametric rules with correct Certora Verification Language syntax, including env, calldataarg, mathint, and @withrevert patterns. - Counter-Example Debugging: Interpret verification reports showing concrete call traces, storage states, and variable assignments that violate your properties, plus fixes for vacuous rules and timeouts. - Ready-Made Rule Patterns: Reusable specs for ERC-20 tokens, ERC-4626 vaults, lending protocols, access control, governance, and staking — including sum-of-balances invariants and share-price monotonicity. - Use Case: You are auditing an ERC-4626 vault before deployment. Use this Skill to write a spec proving share price never decreases (inflation attack resistance), run certoraRun with a proper config, and debug any counter-examples in CI. ## Quick Start Ask the agent to write a Certora CVL spec and config verifying that your ERC-20 token's transfer function preserves total supply, then run it with certoraRun.

Frequently Asked Questions about certora

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Certora CVL rule for a smart contract?

Declare contract functions in a methods block, capture state before a call, execute the function with an env argument, then assert the postcondition. Use mathint for spec arithmetic and @withrevert with lastReverted to test revert conditions.

Certora vs Foundry fuzz testing vs Slither — which should I use?

Certora proves properties exhaustively for all inputs using SMT solving, while Foundry fuzzing samples random inputs and Slither does fast static pattern checks. Use Slither first for quick scans, fuzz tests for edge cases, and Certora for critical invariants needing mathematical certainty.

Why is my Certora rule passing vacuously with SANITY_FAIL?

A vacuous pass means contradictory or over-constrained require statements exclude all valid executions, so the assert is never reached. Enable rule_sanity basic or advanced, then relax require statements one at a time and add a satisfy true reachability check.

Does Certora verification require an API key?

Yes, the Prover runs on Certora's cloud infrastructure and requires a CERTORAKEY environment variable. Academic and open-source projects get free access, while commercial usage is priced per verification minute.

How do I fix Certora timeout errors on complex rules?

Increase smt_timeout in the config, split complex rules into smaller ones, bound large values with require, and enable optimistic_loop with a loop_iter of 3-5. Running a single rule with --rule also reduces memory pressure.

What are ghost variables and hooks in CVL?

Ghosts are spec-side variables tracking derived state the contract does not expose, like the sum of all balances. Hooks update ghosts when storage changes — an Sstore hook on the balances mapping keeps sumOfBalances synchronized for the total supply invariant.