# Kontrol

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

- Kind: toolchain
- Verifies: Solidity (Through Foundry: properties are Solidity test functions, and the proof is about the bytecode solc produced from your contracts.); EVM bytecode (Works on EVM bytecode, including deployed bytecode without source (loaded with the vm.etch cheatcode).)
- Effort: Auto-active — You write specifications and hints; a solver does the proving.
- Stage: 2 (Production)
- Trust: Checker partial, Semantics strong, Frontend strong, Binary gap strong, Escape hatches partial
- Licence: open-source, BSD-3-Clause
- Latest release: v1.0.255 (2026-06-24) https://github.com/runtimeverification/kontrol/releases/tag/v1.0.255
- Latest commit: 2026-10-15 https://github.com/runtimeverification/kontrol/commits/master
- Links: [repo](https://github.com/runtimeverification/kontrol), [docs](https://docs.runtimeverification.com/kontrol), [tutorial](https://docs.runtimeverification.com/kontrol/guides/kontrol-example)

## Use it if
- You already test your contracts with Foundry and want those tests to hold for every input, not just random ones.
- You want the result to be about the compiled EVM bytecode, not just the Solidity source.

## Look elsewhere if
- Your code has loops or inputs whose size is not fixed and you cannot write K invariants and lemmas; you will be limited to bounded checks.
- You need to reason about calls into unknown, possibly malicious contracts; they have to be mocked.
- You want fast feedback; the first build alone takes 30 minutes to an hour, and proofs can be slow.

## How it works (pipeline)

| Step | Component | Assurance | Note |
|---|---|---|---|
| frontend | Foundry (forge build) with solc | trusted | Compiles the contracts and the Solidity test functions. Kontrol reads the bytecode and metadata from Foundry's build output. |
| semantics | KEVM (`kevm`) | validated | Tested against the Ethereum conformance suites; see the KEVM page for known gaps. |
| translation | Kontrol (turns each test into a K proof obligation; implements Foundry and Kontrol cheatcodes) | trusted |  |
| checker | K symbolic execution engine (Haskell backend) | trusted | Explores every path through the bytecode. No independently checked proof certificate is documented. |
| checker | Z3 (`z3`) | trusted | Answers the SMT queries the K engine sends. |
| compiler | solc (through Foundry) | checked | The proof is about the bytecode solc produced, so the compiler is outside the trusted base if you deploy that same build. |

## Trust

| Axis | Level | Summary | Note |
|---|---|---|---|
| Checker | Partial (amber) | K's symbolic execution engine and Z3 decide; no checked proof certificates. |  [source](https://docs.runtimeverification.com/kontrol/glossary/kontrol-prove-flags) |
| Semantics | Strong (green) | KEVM, tested against the Ethereum conformance test suites in CI. | KEVM does not fully cover Osaka yet (for example the P256VERIFY precompile); see the KEVM page. [source](https://github.com/runtimeverification/evm-semantics/blob/master/.github/workflows/test-pr.yml) |
| Frontend | Strong (green) | Uses the bytecode that the real solc compiler produced through Foundry. |  |
| Binary gap | Strong (green) | The proof is about EVM bytecode, which is what runs on chain. | This holds if you deploy the same build (compiler version and settings) that Kontrol checked. |
| Escape hatches | Partial (amber) | Hand-written K lemmas, vm.assume and loop bounds can hide bugs; all sit in project files. | Lemmas are K rules passed to kontrol build with --require; the docs leave their soundness to the author. Loop invariants are proved as K claims and then added back by hand as rules. --bmc-depth makes a proof bounded. [source](https://docs.runtimeverification.com/kontrol/guides/advancing-proofs/simplifications-guide) |

## What it can prove

| Property | Support |
|---|---|
| No undefined behavior | 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](https://docs.runtimeverification.com/kontrol)) |
| Functional correctness | Supported — Specifications are Foundry tests with symbolic inputs, assumptions (vm.assume) and assertions. ([source](https://docs.runtimeverification.com/kontrol)) |
| Equivalence | Partial — No dedicated mode. You write a test that calls two implementations with the same symbolic inputs and compares the results; the kontrol-solady repository calls this "function equivalence". ([source](https://github.com/runtimeverification/kontrol-solady)) |
| Information flow | Not applicable — Contract code, storage and inputs are public on chain, so secrecy properties do not apply. |
| Concurrency | Not applicable — EVM execution is sequential. Reentrancy is covered under external calls. |
| Termination and liveness | Partial — No termination or general liveness proofs (on chain every run ends when gas runs out). A test can show that a specific call does not revert under stated conditions. |

## Common features

| Feature | Support |
|---|---|
| Machine integers | Supported — 256-bit EVM words and their arithmetic are modeled exactly by KEVM. ([source](https://github.com/runtimeverification/evm-semantics/blob/master/kevm-pyk/src/kevm_pyk/kproj/evm-semantics/evm-types.md)) |
| Floating point | Not applicable — Solidity has no floating point; fixed-point types can be declared but not assigned. ([source](https://docs.soliditylang.org/en/latest/types.html#fixed-point-numbers)) |
| Heap and pointers | Partial — EVM memory is modeled byte by byte, but data whose size is symbolic is not supported; tests must choose concrete sizes. ([source](https://docs.runtimeverification.com/kontrol/guides/kontrol-example/dynamic-types)) |
| Arrays and buffers | Partial — Dynamic arrays and bytes need concrete lengths chosen in the test; the docs say symbolic lengths are not supported. ([source](https://docs.runtimeverification.com/kontrol/guides/kontrol-example/dynamic-types)) |
| Loops | Partial — Loops are unrolled up to a bound (--bmc-depth), or need an invariant written by hand as a K claim over the bytecode, proved, and then added as a rule. ([source](https://runtimeverification.com/blog/formally-verifying-loops-part-2)) |
| Recursion | Unknown — Not documented. |
| Higher-order code | Unknown — Calls through Solidity function-type values are not documented. |
| Threads and shared memory | Not applicable — The EVM has no threads. |
| I/O and system calls | Not applicable — Contracts have no file or network I/O. Foundry's file, environment and FFI cheatcodes are listed as not yet implemented in Kontrol. ([source](https://docs.runtimeverification.com/kontrol/cheatsheets/cheatcodes)) |
| Standard library | Partial — keccak256 results stay symbolic; Kontrol ships a set of keccak lemmas to reason about them. Library code such as OpenZeppelin is checked as ordinary bytecode. ([source](https://github.com/runtimeverification/kontrol/blob/master/README.md)) |

## EVM-specific features

| Feature | Support |
|---|---|
| Gas | Partial — Gas is not computed by default; the --use-gas flag turns on KEVM's gas model. ([source](https://docs.runtimeverification.com/kontrol/glossary/kontrol-prove-flags)) |
| Storage | Supported — Storage can be made fully symbolic with the symbolicStorage cheatcode. ([source](https://docs.runtimeverification.com/kontrol/cheatsheets/cheatcodes)) |
| External calls | Partial — Calls into contracts deployed in the test run on KEVM, so reentrancy through known code is covered. We found no documented way to model arbitrary unknown callee code; the docs suggest mocking external calls (mockCall). ([source](https://docs.runtimeverification.com/kontrol/cheatsheets/cheatcodes)) |
| Precompiles | Partial — KEVM computes precompiles only on concrete inputs, and Osaka's P256VERIFY precompile is missing. ([source](https://github.com/runtimeverification/evm-semantics/blob/master/kevm-pyk/src/kevm_pyk/kproj/evm-semantics/evm.md)) |

## Stage

**Stage 2: Production.**

| Stage | Criterion | Met | Evidence / note |
|---|---|---|---|
| 0 | Publicly available | yes | [evidence](https://github.com/runtimeverification/kontrol) |
| 0 | At least one published verification uses it | yes | [evidence](https://runtimeverification.com/public-report/optimism-pausability) Runtime Verification's verification of Optimism's pausability mechanism (May 2024). |
| 1 | Released or updated in the last 12 months | yes | [evidence](https://github.com/runtimeverification/kontrol/commits/master) Latest release: v1.0.255, 2026-06-24. Latest commit: 2026-10-15. |
| 1 | Installs and runs on current platforms | yes | [evidence](https://docs.runtimeverification.com/kontrol/overview/readme/installations) Installed with Runtime Verification's kup package manager, or built from source. |
| 1 | User documentation or tutorial | yes | [evidence](https://docs.runtimeverification.com/kontrol) |
| 1 | Used by a group other than its authors | yes | [evidence](https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts-bedrock/test/kontrol) Optimism keeps Kontrol proofs in its own repository and runs them in CI (commits as recent as November 2026). |
| 2 | Verified code in production at two or more independent organizations | yes | 2 recorded: Optimism, Lido. |
| 2 | Checker axis is not red | yes |  |
| 2 | Semantics axis is not red | yes |  |
| 2 | Public channel for soundness bugs | yes | [evidence](https://github.com/runtimeverification/kontrol/issues) Public GitHub issue tracker. |

## In production
- Optimism: Pausability mechanism of the L1 contracts, verified as deployed (initial state taken from the deployment sequence). ([source](https://runtimeverification.com/public-report/optimism-pausability))
- Lido: Dual Governance contracts, verified by Runtime Verification with Kontrol (report of February 2025); live on mainnet since July 2025. ([source](https://runtimeverification.com/public-report/audit-1))

## Projects
- [Optimism pausability mechanism](https://runtimeverification.com/public-report/optimism-pausability)
- [Lido Dual Governance](https://runtimeverification.com/public-report/audit-1)
- [Solady fixed-point math functions](https://github.com/runtimeverification/kontrol-solady)

## Sources
- [Kontrol repository and README](https://github.com/runtimeverification/kontrol)
- [Kontrol documentation](https://docs.runtimeverification.com/kontrol)
- [Bytecode verification guide](https://docs.runtimeverification.com/kontrol/guides/bytecode-verification)
- [Kontrol prove flags](https://docs.runtimeverification.com/kontrol/glossary/kontrol-prove-flags)
- [Kontrol cheatcodes](https://docs.runtimeverification.com/kontrol/cheatsheets/cheatcodes)
- [Handling dynamically sized inputs](https://docs.runtimeverification.com/kontrol/guides/kontrol-example/dynamic-types)
- [Formally Verifying Loops: Part 2 (2024-10-07)](https://runtimeverification.com/blog/formally-verifying-loops-part-2)
- [Kontrol example and production projects](https://docs.runtimeverification.com/kontrol/learn-more/example-projects)
- [Lido, Dual Governance overview (live on mainnet since 4 July 2025)](https://blog.lido.fi/dual-governance-overview)
- [Kontrol releases](https://github.com/runtimeverification/kontrol/releases)

---
Last checked 2026-11-26. Data: [JSON](/toolchains/kontrol.json) · Page: [HTML](/toolchains/kontrol/) · Methodology v0.1: [/methodology/](/methodology/) · Corrections: [/contribute/](/contribute/)
