Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Formal verification using Certora Prover with CVL specification language. Supports invariant rules, parametric verification, ghost variables, and counterexample analysis for mathematical proof of contract correctness.
.claude/skills/a5c-ai-certora-prover/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 88% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 158% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 80% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 74% | 0% |
| case-14 | ✓→✓ | = Same ✓ | 185% | 0% |
Formal verification of smart contracts using Certora Prover, providing mathematical proofs of contract correctness.
bash# Install Java (required) sudo apt install openjdk-17-jdk # Install Certora CLI pip install certora-cli # Set API key export CERTORAKEY=<your-api-key> # Verify installation certoraRun --version
project/
├── contracts/
│ └── Token.sol
├── certora/
│ ├── conf/
│ │ └── token.conf
│ └── specs/
│ └── token.spec
└── foundry.tomlyaml# certora/conf/token.conf { "files": ["contracts/Token.sol"], "verify": "Token:certora/specs/token.spec", "solc": "solc-0.8.20", "msg": "Token verification", "rule_sanity": "basic", "optimistic_loop": true, "loop_iter": 3 }
cvl// certora/specs/token.spec methods { function balanceOf(address) external returns (uint256) envfree; function totalSupply() external returns (uint256) envfree; function transfer(address, uint256) external returns (bool); } // Invariant: balance never exceeds total supply invariant balanceUnderSupply(address user) balanceOf(user) <= totalSupply() // Rule: transfer preserves total supply rule transferPreservesTotalSupply(address to, uint256 amount) { env e; uint256 supplyBefore = totalSupply(); transfer(e, to, amount); uint256 supplyAfter = totalSupply(); assert supplyBefore == supplyAfter, "Total supply changed after transfer"; }
cvl// Parametric rule: any function preserves an invariant rule anyFunctionPreservesInvariant(method f) { env e; calldataarg args; uint256 supplyBefore = totalSupply(); f(e, args); uint256 supplyAfter = totalSupply(); assert supplyBefore == supplyAfter, "Total supply changed"; }
cvl// Ghost variable to track sum of all balances ghost mathint sumBalances { init_state axiom sumBalances == 0; } // Hook to update ghost on balance changes hook Sstore balances[KEY address user] uint256 newBalance (uint256 oldBalance) STORAGE { sumBalances = sumBalances + newBalance - oldBalance; } // Invariant using ghost invariant totalSupplyIsSumOfBalances() to_mathint(totalSupply()) == sumBalances
cvl// Summary for external calls methods { function _.transfer(address, uint256) external => DISPATCHER(true); function _.balanceOf(address) external returns (uint256) => DISPATCHER(true); } // Havoc summary (non-deterministic) methods { function externalCall() external => HAVOC_ECF; } // Constant summary methods { function getConstant() external returns (uint256) => ALWAYS(100); }
cvl// Loop invariant rule loopInvariant() { env e; // Configure loop unrolling require e.msg.sender != 0; // Loop iterations are bounded by config processArray(e); assert true; // Verify loop terminates }
bash# Run verification certoraRun certora/conf/token.conf # Run specific rule certoraRun certora/conf/token.conf --rule transferPreservesTotalSupply # Run with message certoraRun certora/conf/token.conf --msg "PR #123 verification"
bash# Sanity checks certoraRun certora/conf/token.conf --rule_sanity basic # Optimistic loop handling certoraRun certora/conf/token.conf --optimistic_loop --loop_iter 5 # Multi-contract verification certoraRun contracts/Token.sol contracts/Staking.sol \ --verify Token:specs/token.spec # Debug mode certoraRun certora/conf/token.conf --debug
Rule: transferPreservesTotalSupply
Status: VERIFIED ✓
Time: 45s
Rule: balanceUnderSupply
Status: VIOLATED ✗
Counterexample:
- user: 0x1234...
- Initial balance: 100
- Final balance: 200
- Total supply: 150cvlmethods { function balanceOf(address) external returns (uint256) envfree; function totalSupply() external returns (uint256) envfree; function allowance(address, address) external returns (uint256) envfree; } // Transfer integrity rule transferIntegrity(address to, uint256 amount) { env e; address from = e.msg.sender; uint256 fromBalanceBefore = balanceOf(from); uint256 toBalanceBefore = balanceOf(to); require from != to; transfer(e, to, amount); uint256 fromBalanceAfter = balanceOf(from); uint256 toBalanceAfter = balanceOf(to); assert fromBalanceAfter == fromBalanceBefore - amount; assert toBalanceAfter == toBalanceBefore + amount; } // Allowance monotonicity rule approveIntegrity(address spender, uint256 amount) { env e; approve(e, spender, amount); assert allowance(e.msg.sender, spender) == amount; }
cvlmethods { function owner() external returns (address) envfree; function setOwner(address) external; } // Only owner can change owner rule onlyOwnerCanChangeOwner(address newOwner) { env e; address ownerBefore = owner(); setOwner(e, newOwner); assert e.msg.sender == ownerBefore, "Non-owner changed owner"; }
yamlname: Certora Verification on: [push, pull_request] jobs: certora: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install Certora run: pip install certora-cli - name: Run Verification env: CERTORAKEY: ${{ secrets.CERTORAKEY }} run: certoraRun certora/conf/token.conf
| Process | Purpose | |---------|---------| | formal-verification.js | Primary verification | | smart-contract-security-audit.js | Deep security analysis | | lending-protocol.js | Protocol correctness | | amm-pool-development.js | DeFi invariants | | governance-system.js | Governance properties |
skills/slither-analysis/SKILL.md - Static analysisskills/echidna-fuzzer/SKILL.md - Property fuzzingagents/formal-methods/AGENT.md - Verification expert| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 12,818 | 11,489 | -10% | 1 | 1 | 0% | 2,072 | 3,603 | +74% | 0 | 0 | — |
case-02 | fail→fail | 5,188 | 4,210 | -19% | 1 | 1 | 0% | 1,138 | 2,934 | +158% | 0 | 0 | — |
case-03 | fail→fail | 14,904 | 6,332 | -58% | 1 | 1 | 0% | 2,109 | 3,219 | +53% | 0 | 0 | — |
case-04 | fail→pass | 10,784 | 4,744 | -56% | 1 | 1 | 0% | 1,506 | 2,829 | +88% | 0 | 0 | — |
case-05 | fail→fail | 5,420 | 2,798 | -48% | 1 | 1 | 0% | 954 | 2,455 | +157% | 0 | 0 | — |
case-06 | fail→fail | 7,377 | 6,085 | -18% | 1 | 1 | 0% | 1,414 | 2,895 | +105% | 0 | 0 | — |
case-07 | fail→fail | 10,258 | 6,972 | -32% | 1 | 1 | 0% | 1,825 | 3,395 | +86% | 0 | 0 | — |
case-08 | fail→fail | 2,579 | 2,006 | -22% | 1 | 1 | 0% | 375 | 2,318 | +518% | 0 | 0 | — |
case-09 | fail→fail | 3,012 | 2,313 | -23% | 1 | 1 | 0% | 539 | 2,380 | +342% | 0 | 0 | — |
case-10 | fail→fail | 3,786 | 1,896 | -50% | 1 | 1 | 0% | 656 | 2,265 | +245% | 0 | 0 | — |
case-11 | fail→pass | 6,846 | 7,446 | +9% | 1 | 1 | 0% | 1,302 | 3,364 | +158% | 0 | 0 | — |
case-12 | fail→fail | 12,352 | 7,972 | -35% | 1 | 1 | 0% | 2,342 | 3,431 | +46% | 0 | 0 | — |
case-13 | fail→fail | 5,905 | 5,022 | -15% | 1 | 1 | 0% | 1,172 | 2,959 | +152% | 0 | 0 | — |
case-14 | pass→pass | 4,442 | 2,446 | -45% | 1 | 1 | 0% | 796 | 2,269 | +185% | 0 | 0 | — |
case-15 | fail→fail | 5,787 | 1,933 | -67% | 1 | 1 | 0% | 988 | 2,284 | +131% | 0 | 0 | — |
case-16 | fail→fail | 4,673 | 3,168 | -32% | 1 | 1 | 0% | 744 | 2,404 | +223% | 0 | 0 | — |
case-17 | fail→fail | 4,874 | 3,301 | -32% | 1 | 1 | 0% | 783 | 2,622 | +235% | 0 | 0 | — |
case-18 | fail→pass | 10,397 | 5,989 | -42% | 1 | 1 | 0% | 1,718 | 3,086 | +80% | 0 | 0 | — |
case-19 | fail→fail | 8,329 | 4,013 | -52% | 1 | 1 | 0% | 1,203 | 2,638 | +119% | 0 | 0 | — |
case-20 | fail→fail | 7,308 | 6,472 | -11% | 1 | 1 | 0% | 1,347 | 3,135 | +133% | 0 | 0 | — |
case-21 | fail→fail | 13,778 | 9,906 | -28% | 1 | 1 | 0% | 2,669 | 3,949 | +48% | 0 | 0 | — |
case-22 | fail→fail | 11,362 | 8,133 | -28% | 1 | 1 | 0% | 2,313 | 3,621 | +57% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +14 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.