Formal semanticsmodels EVM bytecode

EVMYulLean

Also known as EvmYul, EVM-Yul-Lean

An executable model of the EVM (Cancun fork) and of Yul, the Solidity compiler's intermediate language, in Lean 4 by Nethermind. The EVM part passes almost all Cancun conformance tests.

Stage 1 · Validated Written in Lean 4 Open source · Apache-2.0 Last commit · 14 months ago

The authors describe the project as work in progress and subject to change. The Yul model reuses the EVM's primitive operations but leaves out gas and several opcodes (see fragment).

What it covers

Models
EVM bytecode, EVM Cancun fork; Yul (no version stated)
Fragment
EVM: the state transition for the Cancun fork, including gas and exceptional halting. Precompiles are not written in Lean; they call external C or Python code through Lean's FFI. Yul: syntax and an interpreter that reuses the EVM primitive operations, without gas, CREATE and CREATE2, code-inspecting opcodes (EXTCODESIZE, EXTCODEHASH, EXTCODECOPY, CODECOPY, CODESIZE), fallback functions on receiving ether, or halting on SELFDESTRUCT.
Written in
Lean 4
Usable in
Lean 4
Validation
The repository runs the Ethereum conformance tests (ethereum/tests) with its own test runner. Nethermind's February 2026 post reports 22,330 of 22,332 Cancun execution tests passing; the two others have unclear and possibly non-deterministic expected results. The Yul interpreter has its own small test suite. Results are reported by the authors; we did not re-run them.
Maintained by
Nethermind (Formal Verification team)

Stage

Computed from the evidence below; see the criteria. MechanizedMechanized. Written in a form a computer can check, rather than on paper. means a computer can check the definition.

Stage 0 Mechanized Met
  • Met: Machine-checked or machine-readable definition evidence
  • Met: Fragment and version are stated The README lists what the Yul model leaves out; the code fixes the target fork as Cancun (EvmYul/Wheels.lean). evidence
Stage 1 Validated Met
  • Met: Can be executed or tested Conformance tests run with lake test; the Yul tests with lake exe yulSemanticsTests. evidence
  • Met: Published results against conformance tests or real implementations 22,330 of 22,332 Cancun execution tests pass (author-reported, February 2026). evidence
Stage 2 Authoritative Next
  • Not met: Adopted by the language or ISA owner, or covers the full current version and tracks new ones Adopted by the owner: no; full coverage: no; tracks new versions: no. Funded by an Ethereum Foundation grant, but not adopted as a reference. The authors list becoming an official executable reference as a possible future use. Only the Cancun fork is modeled (TargetSchedule is "Cancun"); later forks such as Prague and Osaka are not. The Yul model has the gaps listed above. No stated policy for new forks; the last commit on the default branch is from September 2025. evidence

Coverage

Which parts of EVM bytecode the model defines.

EVM-specific features

EVM-specific features
FeatureSupportNotes
Gas Gas accounting and out-of-gas behavior. SupportedSupported.Gas is modeled for EVM bytecode. The Yul model has no gas.
Source
Gas is modeled for EVM bytecode. The Yul model has no gas. source
Storage Persistent contract storage. SupportedSupported.
Source
source
External calls Calls to other contracts, including reentrancy. SupportedSupported.For EVM bytecode. The Yul model does not support CREATE, CREATE2 or calls that depend on inspecting other contracts' code.
Source
For EVM bytecode. The Yul model does not support CREATE, CREATE2 or calls that depend on inspecting other contracts' code. source
Precompiles Built-in contracts such as hashing and elliptic-curve operations. PartialPartial.Precompiles are not defined in Lean; the model calls external C or Python implementations through Lean's FFI, so their behavior is not defined in the logic.
Source
Precompiles are not defined in Lean; the model calls external C or Python implementations through Lean's FFI, so their behavior is not defined in the logic. source

Used by

Toolchains in this index whose proofs are about this model.

No toolchain in the index refers to it yet.

Sources

esc