{
  "id": "kontrol",
  "name": "Kontrol",
  "aka": [],
  "summary": "Write properties as Foundry tests in Solidity; Kontrol checks them for all inputs by symbolically running the compiled EVM bytecode on KEVM.",
  "use_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."
  ],
  "avoid_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."
  ],
  "effort": "auto-active",
  "open": "open-source",
  "license": "BSD-3-Clause",
  "maintainers": [
    "Runtime Verification"
  ],
  "links": {
    "repo": "https://github.com/runtimeverification/kontrol",
    "docs": "https://docs.runtimeverification.com/kontrol",
    "tutorial": "https://docs.runtimeverification.com/kontrol/guides/kontrol-example"
  },
  "components": [
    {
      "role": "frontend",
      "name": "Foundry (forge build) with solc",
      "assurance": "trusted",
      "note": "Compiles the contracts and the Solidity test functions. Kontrol reads the bytecode and metadata from Foundry's build output."
    },
    {
      "role": "semantics",
      "name": "KEVM",
      "ref": "kevm",
      "ref_kind": "semantics",
      "assurance": "validated",
      "note": "Tested against the Ethereum conformance suites; see the KEVM page for known gaps."
    },
    {
      "role": "translation",
      "name": "Kontrol (turns each test into a K proof obligation; implements Foundry and Kontrol cheatcodes)",
      "assurance": "trusted"
    },
    {
      "role": "checker",
      "name": "K symbolic execution engine (Haskell backend)",
      "assurance": "trusted",
      "note": "Explores every path through the bytecode. No independently checked proof certificate is documented."
    },
    {
      "role": "checker",
      "name": "Z3",
      "ref": "z3",
      "ref_kind": "prover",
      "assurance": "trusted",
      "note": "Answers the SMT queries the K engine sends."
    },
    {
      "role": "compiler",
      "name": "solc (through Foundry)",
      "assurance": "checked",
      "note": "The proof is about the bytecode solc produced, so the compiler is outside the trusted base if you deploy that same build."
    }
  ],
  "verifies": [
    {
      "target": "solidity",
      "note": "Through Foundry: properties are Solidity test functions, and the proof is about the bytecode solc produced from your contracts."
    },
    {
      "target": "evm",
      "note": "Works on EVM bytecode, including deployed bytecode without source (loaded with the vm.etch cheatcode)."
    }
  ],
  "properties": {
    "no-ub": {
      "status": "full",
      "note": "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": {
      "status": "full",
      "note": "Specifications are Foundry tests with symbolic inputs, assumptions (vm.assume) and assertions.",
      "source": "https://docs.runtimeverification.com/kontrol"
    },
    "equivalence": {
      "status": "partial",
      "note": "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"
    },
    "info-flow": {
      "status": "na",
      "note": "Contract code, storage and inputs are public on chain, so secrecy properties do not apply."
    },
    "concurrency": {
      "status": "na",
      "note": "EVM execution is sequential. Reentrancy is covered under external calls."
    },
    "termination": {
      "status": "partial",
      "note": "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."
    }
  },
  "features": {
    "core.integers": {
      "status": "full",
      "note": "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"
    },
    "core.floats": {
      "status": "na",
      "note": "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"
    },
    "core.heap": {
      "status": "partial",
      "note": "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"
    },
    "core.arrays": {
      "status": "partial",
      "note": "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"
    },
    "core.loops": {
      "status": "partial",
      "note": "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"
    },
    "core.recursion": {
      "status": "unknown",
      "note": "Not documented."
    },
    "core.higher-order": {
      "status": "unknown",
      "note": "Calls through Solidity function-type values are not documented."
    },
    "core.concurrency": {
      "status": "na",
      "note": "The EVM has no threads."
    },
    "core.io": {
      "status": "na",
      "note": "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"
    },
    "core.stdlib": {
      "status": "partial",
      "note": "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.gas": {
      "status": "partial",
      "note": "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"
    },
    "evm.storage": {
      "status": "full",
      "note": "Storage can be made fully symbolic with the symbolicStorage cheatcode.",
      "source": "https://docs.runtimeverification.com/kontrol/cheatsheets/cheatcodes"
    },
    "evm.calls": {
      "status": "partial",
      "note": "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"
    },
    "evm.precompiles": {
      "status": "partial",
      "note": "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"
    }
  },
  "trust": {
    "checker": {
      "level": "amber",
      "summary": "K's symbolic execution engine and Z3 decide; no checked proof certificates.",
      "source": "https://docs.runtimeverification.com/kontrol/glossary/kontrol-prove-flags"
    },
    "semantics": {
      "level": "green",
      "summary": "KEVM, tested against the Ethereum conformance test suites in CI.",
      "note": "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": {
      "level": "green",
      "summary": "Uses the bytecode that the real solc compiler produced through Foundry."
    },
    "binary_gap": {
      "level": "green",
      "summary": "The proof is about EVM bytecode, which is what runs on chain.",
      "note": "This holds if you deploy the same build (compiler version and settings) that Kontrol checked."
    },
    "escape_hatches": {
      "level": "amber",
      "summary": "Hand-written K lemmas, vm.assume and loop bounds can hide bugs; all sit in project files.",
      "note": "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"
    }
  },
  "stage_evidence": {
    "public_artifact": {
      "met": true,
      "evidence": "https://github.com/runtimeverification/kontrol"
    },
    "published_use": {
      "met": true,
      "evidence": "https://runtimeverification.com/public-report/optimism-pausability",
      "note": "Runtime Verification's verification of Optimism's pausability mechanism (May 2024)."
    },
    "installs_on_current": {
      "met": true,
      "evidence": "https://docs.runtimeverification.com/kontrol/overview/readme/installations",
      "note": "Installed with Runtime Verification's kup package manager, or built from source."
    },
    "user_docs": {
      "met": true,
      "evidence": "https://docs.runtimeverification.com/kontrol"
    },
    "external_users": {
      "met": true,
      "evidence": "https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts-bedrock/test/kontrol",
      "note": "Optimism keeps Kontrol proofs in its own repository and runs them in CI (commits as recent as November 2026)."
    },
    "soundness_channel": {
      "met": true,
      "evidence": "https://github.com/runtimeverification/kontrol/issues",
      "note": "Public GitHub issue tracker."
    }
  },
  "production_users": [
    {
      "org": "Optimism",
      "what": "Pausability mechanism of the L1 contracts, verified as deployed (initial state taken from the deployment sequence).",
      "source": "https://runtimeverification.com/public-report/optimism-pausability"
    },
    {
      "org": "Lido",
      "what": "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"
    }
  ],
  "last_release": {
    "version": "v1.0.255",
    "date": "2026-06-24",
    "source": "https://github.com/runtimeverification/kontrol/releases/tag/v1.0.255"
  },
  "last_commit": {
    "date": "2026-10-15",
    "source": "https://github.com/runtimeverification/kontrol/commits/master"
  },
  "used_for": [
    {
      "name": "Optimism pausability mechanism",
      "url": "https://runtimeverification.com/public-report/optimism-pausability"
    },
    {
      "name": "Lido Dual Governance",
      "url": "https://runtimeverification.com/public-report/audit-1"
    },
    {
      "name": "Solady fixed-point math functions",
      "url": "https://github.com/runtimeverification/kontrol-solady"
    }
  ],
  "last_checked": "2026-11-26",
  "attestation": "maintainer",
  "claimed_by_authors": false,
  "sources": [
    {
      "url": "https://github.com/runtimeverification/kontrol",
      "title": "Kontrol repository and README",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://docs.runtimeverification.com/kontrol",
      "title": "Kontrol documentation",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://docs.runtimeverification.com/kontrol/guides/bytecode-verification",
      "title": "Bytecode verification guide",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://docs.runtimeverification.com/kontrol/glossary/kontrol-prove-flags",
      "title": "Kontrol prove flags",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://docs.runtimeverification.com/kontrol/cheatsheets/cheatcodes",
      "title": "Kontrol cheatcodes",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://docs.runtimeverification.com/kontrol/guides/kontrol-example/dynamic-types",
      "title": "Handling dynamically sized inputs",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://runtimeverification.com/blog/formally-verifying-loops-part-2",
      "title": "Formally Verifying Loops: Part 2 (2024-10-07)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://docs.runtimeverification.com/kontrol/learn-more/example-projects",
      "title": "Kontrol example and production projects",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://blog.lido.fi/dual-governance-overview",
      "title": "Lido, Dual Governance overview (live on mainnet since 4 July 2025)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://github.com/runtimeverification/kontrol/releases",
      "title": "Kontrol releases",
      "accessed": "2026-11-26"
    }
  ],
  "computed": {
    "kind": "toolchains",
    "methodology_version": "0.1",
    "built": "2026-11-26",
    "links": {
      "html": "/toolchains/kontrol/",
      "json": "/toolchains/kontrol.json",
      "markdown": "/toolchains/kontrol.md"
    },
    "stage": {
      "stage": 2,
      "name": "Production",
      "criteria": [
        {
          "key": "public_artifact",
          "stage": 0,
          "label": "Publicly available",
          "met": true,
          "evidence": "https://github.com/runtimeverification/kontrol",
          "computed": false
        },
        {
          "key": "published_use",
          "stage": 0,
          "label": "At least one published verification uses it",
          "met": true,
          "evidence": "https://runtimeverification.com/public-report/optimism-pausability",
          "note": "Runtime Verification's verification of Optimism's pausability mechanism (May 2024).",
          "computed": false
        },
        {
          "key": "recent_release",
          "stage": 1,
          "label": "Released or updated in the last 12 months",
          "met": true,
          "evidence": "https://github.com/runtimeverification/kontrol/commits/master",
          "note": "Latest release: v1.0.255, 2026-06-24. Latest commit: 2026-10-15.",
          "computed": true
        },
        {
          "key": "installs_on_current",
          "stage": 1,
          "label": "Installs and runs on current platforms",
          "met": true,
          "evidence": "https://docs.runtimeverification.com/kontrol/overview/readme/installations",
          "note": "Installed with Runtime Verification's kup package manager, or built from source.",
          "computed": false
        },
        {
          "key": "user_docs",
          "stage": 1,
          "label": "User documentation or tutorial",
          "met": true,
          "evidence": "https://docs.runtimeverification.com/kontrol",
          "computed": false
        },
        {
          "key": "external_users",
          "stage": 1,
          "label": "Used by a group other than its authors",
          "met": true,
          "evidence": "https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts-bedrock/test/kontrol",
          "note": "Optimism keeps Kontrol proofs in its own repository and runs them in CI (commits as recent as November 2026).",
          "computed": false
        },
        {
          "key": "production_users",
          "stage": 2,
          "label": "Verified code in production at two or more independent organizations",
          "met": true,
          "note": "2 recorded: Optimism, Lido.",
          "computed": true
        },
        {
          "key": "checker_not_red",
          "stage": 2,
          "label": "Checker axis is not red",
          "met": true,
          "computed": true
        },
        {
          "key": "semantics_not_red",
          "stage": 2,
          "label": "Semantics axis is not red",
          "met": true,
          "computed": true
        },
        {
          "key": "soundness_channel",
          "stage": 2,
          "label": "Public channel for soundness bugs",
          "met": true,
          "evidence": "https://github.com/runtimeverification/kontrol/issues",
          "note": "Public GitHub issue tracker.",
          "computed": false
        }
      ],
      "missing_for_next": []
    }
  }
}