Skip to free scan

Analysis Techniques

Formal Verification

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.

How It Works

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.

Strengths and Limits

  • Strength: the strongest assurance available — a proof covers every input.
  • Limit: expensive, requires specialized expertise, and only proves what the specification states. A wrong or incomplete spec limits the guarantee.

Formal verification complements invariant testing and symbolic execution, and is typically reserved for the highest-value contracts.

Frequently Asked Questions

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.

Firepan

Scan Your Contracts

Run a free surface scan — results in minutes, no credit card required.

Run Free Scan →