Analysis Techniques
Formal verification uses mathematical methods to prove that a smart contract satisfies a formal specification for all possible inputs and states — not just the cases covered by tests. Where testing and fuzzing sample behavior, formal verification aims to prove properties exhaustively.
You express the contract's intended behavior as a formal specification (properties, pre/post-conditions, invariants), then a verification tool uses solvers and mathematical reasoning to prove the code always meets it — or produces a counterexample. Tools in this space include Certora, the Solidity SMTChecker, and Halmos.
Formal verification complements invariant testing and symbolic execution, and is typically reserved for the highest-value contracts.
Q: Is formal verification the same as testing?
A: No. Testing checks specific cases; formal verification mathematically proves a property holds for all inputs, given a correct specification.
Q: Does formal verification guarantee a contract is bug-free?
A: It guarantees the proven properties hold, but only those. Bugs outside the specification, or errors in the spec itself, can still exist — which is why it complements, not replaces, audits.
Related terms
Firepan
Run a free surface scan — results in minutes, no credit card required.
Run Free Scan →