Find a tool · Solidity

Proving that your Solidity code has no undefined behavior

Memory safety and absence of runtime errors: no out-of-bounds access, use-after-free, overflow traps, panics or undefined behavior on any input allowed by the precondition.

Change the question

I have code and want to prove

Effort
My code uses

Ranked by: support for this property, stage, coverage of the features you pick, and trust. Tools that work on compiled code rank lower. Ranking as JSON.

  1. Write properties as Foundry tests in Solidity; Kontrol checks them for all inputs by symbolically running the compiled EVM bytecode on KEVM.

    Supported.The EVM has no undefined behavior. A test can require that a call never reverts or hits a failing assertion (such as a checked-arithmetic panic) for every symbolic input.
    Source
    Supported — The EVM has no undefined behavior. A test can require that a call never reverts or hits a failing assertion (such as a checked-arithmetic panic) for every symbolic input.

    Effort
    Auto-active
    Covers
    2 of 11 Solidity features
    Relies on
    K's symbolic execution engine and Z3 decide; no checked proof certificates. Hand-written K lemmas, vm.assume and loop bounds can hide bugs; all sit in project files.
    Stage 2 · Production Trust: Checker partial, Semantics strong, Frontend strong, Binary gap strong, Escape hatches partial 3/5 strong
  2. Write rules and invariants in Certora's spec language (CVL); an SMT-based prover checks them against your contract's compiled EVM bytecode.

    Supported.The EVM has no undefined behavior. Rules can check whether a call reverts (@withrevert and lastReverted), which covers checked-arithmetic panics and failed assertions.
    Source
    Supported — The EVM has no undefined behavior. Rules can check whether a call reverts (@withrevert and lastReverted), which covers checked-arithmetic panics and failed assertions.

    Effort
    Auto-active
    Covers
    2 of 11 Solidity features
    Relies on
    SMT solvers (Z3, cvc5 and others) decide; no checked proof certificates. EVM model built into the Prover; no published validation found.
    Stage 2 · Production Trust: Checker partial, Semantics partial, Frontend strong, Binary gap strong, Escape hatches partial 2/5 strong
  3. Turn on a Solidity compiler option and it tries to prove your assert statements and the absence of overflow, division by zero and out-of-bounds access.

    Supported.Checks assertions, overflow and underflow, division by zero, out-of-bounds index access, popping an empty array and insufficient balance for transfer. Overflow and underflow are off by default for Solidity 0.8.7 and later, because checked arithmetic already reverts.
    Source
    Supported — Checks assertions, overflow and underflow, division by zero, out-of-bounds index access, popping an empty array and insufficient balance for transfer. Overflow and underflow are off by default for Solidity 0.8.7 and later, because checked arithmetic already reverts.

    Effort
    Push-button
    Covers
    5 of 11 Solidity features
    Relies on
    Z3's Horn solver (or Eldarica) decides; no proof certificates. Solidity model built into the compiler; tested by its own test suite.
    Stage 1 · Usable Trust: Checker partial, Semantics partial, Frontend strong, Binary gap weak, Escape hatches partial 1/5 strong

Ask something else about Solidity

New to this? Start with the glossary: auto-activeAuto-active verification. You write specifications and hints in the code; an automatic solver does the proving., interactiveInteractive theorem prover. A proof assistant where you write proofs step by step and the system checks each step., trusted computing baseTrusted computing base (TCB). Everything that must be correct for a proof to mean what it says..

esc