This document states what Verity proves and what it still trusts.
EDSL (Lean)
↓ [Layer 1: PROVEN FOR CURRENT CONTRACTS, generic core, contract bridges]
CompilationModel
↓ [Layer 2: SUPPORTED-FRAGMENT GENERIC THEOREM -- CompilationModel → IR]
IR
↓ [Layer 3: GENERIC SURFACE, explicit bridge hypothesis, IR → Yul]
Yul
↓ [trusted: solc]
EVM Bytecode
The repository currently has 0 sorry placeholders across the Compiler/**/*.lean and Verity/**/*.lean proof modules that participate in the verified compiler stack. Layer 2 (Source → IR) and Layer 3 (IR → Yul) proof scripts are fully discharged, and it now has 0 documented Lean axioms. See AXIOMS.md for details.
- Layer 1: A generic typed-IR compilation-correctness core exists, but the active contract-level bridges are still instantiated per contract and internal-helper proof reuse is not yet a first-class generic interface.
This names the frontend EDSL-to-
CompilationModelbridge only; the contract-specific specification theorems inContracts/<Name>/Proofs/are a separate proof layer about human-readable contract behavior. - Layer 2: A generic whole-contract theorem is proved for the current supported
CompilationModelfragment.supported_function_correctis now a real theorem, the initial-state normalization step is proved, the former generic body-simulation axiom has been eliminated, and the theorem surface makes explicit that the observed transaction-context fields must already be normalized to the bounded source-sideAddress/Uint256domains. Remaining Layer 2 work is now about widening the supported fragment and helper-aware completeness, not repairingsorryplaceholders. - Layer 3: IR → Yul preservation is generic at the proof surface, and the remaining dispatch bridge now lives as an explicit theorem hypothesis rather than a Lean axiom. The checked contract-level theorem surface makes the dispatch-guard safety preconditions explicit: non-payable cases must see word-level zero
msg.value, and each selected function case must have a non-wrapping calldata-width guard.
Current theorem totals, property-test coverage, and proof status live in docs/VERIFICATION_STATUS.md.
- Role: Compiles Yul → EVM bytecode.
- Version: 0.8.33+commit.64118f21 (pinned).
- Mitigation: CI enforces pin and Yul compileability checks.
- Role: Bridge remaining proof obligations not yet fully discharged.
- Status: 0 documented axioms in AXIOMS.md. The mapping-slot range axiom has been eliminated via the kernel-computable Keccak engine. Selector computation is kernel-computable, the Layer 2 generic body-simulation axiom has been eliminated, and the Layer 3 dispatch bridge remains an explicit theorem hypothesis rather than a Lean axiom.
- Mitigation: CI axiom reporting and location checks enforce explicit tracking.
- Role: Function selector derivation (
bytes4(keccak256(signature))). - Status: kernel-computable in
Compiler/Selectors.leanvia the vendored unrolled Keccak engine inCompiler/Keccak/. - Mitigation: CI cross-checks against
solc --hashes, selector fixtures, and fixed selector examples.
- Role: External functions injected at compile time (e.g., Poseidon hash).
- Trust: Semantic correctness of linked code. Compiler validates names, arities, collisions.
- Role:
keccak256(abi.encode(key, baseSlot))for Solidity-compatible storage (activeMappingSlotBackend = .keccak). - Trust: external keccak implementation (
ffi.KECvia EVMYul FFI) + standard collision-resistance assumptions (same trust class as Solidity/EVM). - Mitigation: Abstraction-boundary CI, selector/hash cross-checks.
- Audit surface: machine-readable trust reports now emit the explicit primitive assumption
keccak256_memory_slice_matches_evmwhenever a contract usesExpr.keccak256.
- Role: Runtime execution model.
- Status: 15 pure builtins bridged to EVMYulLean
UInt256operations; 15 universal pure bridge theorems are now proven inCompiler/Proofs/YulGeneration/Backends/EvmYulLeanBridgeLemmas.lean. All pure bridge cases are now covered by universal symbolic lemmas. Gas is not modeled. - Implication: Semantic correctness does not imply gas-safety.
- Proxy note:
delegatecall-based proxy / upgradeability flows still sit outside the current proof-interpreter model. Archive--trust-reportand use--deny-proxy-upgradeabilitywhen proxy semantics must remain outside the selected verified subset (issue#1420).
- Role: Reusable typed external call patterns (ERC-20 writes/reads including
totalSupply, ERC-4626 preview/conversion helpers plustotalAssets,asset,max*limit reads, anddeposit, oracle reads, precompiles, callbacks). - Trust: Each module's
compileproduces correct Yul. Bug in one module doesn't affect others. - Mitigation: Axiom aggregation at compile time (
--verbose), machine-readable trust-surface emission via--trust-report <path>, and a fail-closed verification gate via--deny-unchecked-dependencieswhen unchecked foreign surfaces must be excluded. See docs/EXTERNAL_CALL_MODULES.md.
- Role: Proof checker soundness. Foundational assumption for all Lean-based verification.
- Role: Generates both EDSL
Contractmonad value andCompilationModelfrom one syntax tree. - Status: Trusted unverified metaprogram (Verity/Macro/Translate.lean).
- Risk: A translation bug would silently cause EDSL and CompilationModel to diverge.
- Mitigation: The generic Layer 2 whole-contract theorem, macro-generated
_semantic_preservationbody-alignment checks, and differential tests catch divergence on the current contract set.
- Role: Let a function or constructor declare a localized proof obligation for an unsafe/assembly-shaped boundary without marking the whole contract as opaque.
- Status: Surfaced explicitly in
--trust-report,--verbose, andproofStatus.*.localObligations. - Mitigation:
verity-compiler --deny-local-obligationsfails closed on any obligation that remainsassumedorunchecked.
Uint256 arithmetic is wrapping modulo 2^256, matching the EVM. This is proven, not assumed (see Compiler/Proofs/ArithmeticProfile.lean). Checked operations (safeAdd, safeSub, safeMul) are available for overflow protection. See docs/ARITHMETIC_PROFILE.md.
High-level semantics can expose intermediate state in reverted computations. EVM reverts discard state. Contracts should use checks-before-effects. See docs/REVERT_STATE_MODEL.md.
- Confirm deployment uses the supported EDSL CLI path.
- Review AXIOMS.md; ensure the axiom list is unchanged and justified.
- If linked libraries are used, audit each linked Yul file as trusted code.
- Validate selector, Yul compile, and storage-layout CI checks.
- Confirm arithmetic and revert assumptions are acceptable for the target contract.
- Review the low-level mechanics / external assumption report (
--verbose) and archive--trust-report <path>for audit evidence when external calls or linked externals are used. For verification-oriented builds, also pass--deny-unchecked-dependenciesso any remaining unchecked foreign surface fails closed.
- Issue #967: Proof-carrying Yul rewrite rules, versioned parity packs, AST identity gates.
- Issue #998: Per-function machine-checked
EDSL execution ≡ EVMYulLean(compile(CompilationModel))theorems.
- AXIOMS.md | docs/ARITHMETIC_PROFILE.md | docs/REVERT_STATE_MODEL.md
- docs/EXTERNAL_CALL_MODULES.md | docs/ROADMAP.md | docs/VERIFICATION_STATUS.md
Last Updated: 2026-04-09 Maintainer Rule: Update on every trust-boundary-relevant code change.