\documentclass[conference]{IEEEtran} \usepackage[T1]{fontenc} \usepackage[narrow]{inconsolata} \usepackage{amsmath,amssymb,amsthm} \usepackage{booktabs,tabularx,array} \usepackage{xurl} \usepackage[hidelinks]{hyperref} \hypersetup{pdftitle={Solidity Semantics for Compiler Verification},pdfauthor={OKcontract}} \Urlmuskip=0mu\relax \newcommand{\W}{\mathbb W} \newcommand{\N}{\mathbb N} \newcommand{\eval}[1]{\mathopen{[\![}#1\mathclose{]\!]}} \DeclareUrlCommand\src{% \urlstyle{tt}% \useOriginalUrlSetting \Urlmuskip=0mu\relax } \newcommand{\code}[1]{\texttt{#1}} \newtheorem{proposition}{Proposition} \title{Solidity Semantics for Compiler Verification:\\Effect Orders, Physical Aliases, and Observations} \author{\IEEEauthorblockN{OKcontract Labs} \IEEEauthorblockA{Lean formalization for Solidity 0.8.36 and Cancun\\12 November 2026}} \begin{document} \maketitle \begin{abstract} Compiler verification requires source semantics that retain observable effect-order choices, aliasing, and rollback while keeping proof and resource boundaries explicit. We present Solidity Spec, an executable Lean development targeting Solidity 0.8.36, its IR compiler pipeline, and Cancun. Its resolved continuation machine selects eager child expressions independently, operates over a shared physical aggregate heap, and distinguishes source failure from unsupported behavior and host exhaustion. The architecture separates checked entry points, fixed implementation policies, and compatibility imports. The release combines explicit theorem contracts, admission counterexamples, independent compiler and EVM checks, and quantified source/target pilots, including an order-sensitive success-versus-rollback result. External execution checks assess agreement with Solidity implementations, while configuration invariants establish admitted-state safety for a restricted profile. This paper documents the implemented semantic domains and their proof obligations; complete Solidity admission and compiler preservation remain open. \end{abstract} \section{Research question and contributions} We ask: \emph{How can executable Solidity semantics support mechanized compiler-preservation proofs while retaining permitted effect orders, physical aliasing, and an explicit distinction between source and model observations?} The central difficulty is compositional. A call conversion may copy an aggregate after argument side effects; a captured alias may observe a sibling write; a subsequent revert must erase that write. Proving safe execution requires an invariant that connects these operator rules to the heap, call frames, and failure behavior. For example, let two initialized memory references \code{a} and \code{b} alias the same word array, initially containing $y$ at index zero. In \code{(a[0] = x) + b[0]}, evaluating the read before the assignment gives $x+y$, while evaluating it afterward gives $2x$, provided the respective addition fits in a word. Checked overflow instead produces a source panic. A model used to justify transformations must preserve the permitted choices, the shared physical cell and the failure behavior together. The release provides three concrete interfaces. First, a single continuation machine combines per-group child selection with captured physical places and an invocation checkpoint. Second, a resolved admission boundary retains the admission check equations; independent type, heap, and continuation invariants support progress, preservation and resource-adequate prefix safety for a stated profile. Third, quantified source/target pilots demonstrate calls with aliases and rollback, and two permitted orders that can disagree on success versus overflow. The second pilot derives machine execution and two concrete target traces for every input word, failure flag and related entry state. An enforced theorem manifest binds statements, axiom allowances and definition sources. Independent compiler and EVM checks provide empirical evidence about fourteen selected interactions. Compatibility bridges connect the certificate interfaces to the shared execution model. Our work builds on executable Solidity semantics, memory models, and proof-assistant verification~\cite{ksolidity,lolisa,isabelle,isabelle-shallow,memory-smt,solidcore}. We combine independent child scheduling, physical aliasing, and rollback in interfaces for compiler-preservation proofs. The quantified pilots test how these interfaces compose; comparison with prior developments and external execution checks place those results in context. \section{Which specification is being used?} The operational meaning of a proof in this development is fixed by the Lean definitions in its dependency closure. The relevant specification is therefore the executable code described here, together with the theorem's explicit premises. Solidity documentation and Ethereum fork rules guide the source and target definitions, whose agreement with those references remains a model-adequacy obligation, assessed through review and differential execution. There are three principal layers. First, \src{Contract/Language} and \src{Contract/Semantics} define an intrinsically typed contract language. Second, \src{Solidity/} defines the source models used by the Solidity artifact certificates. Third, \src{Contract/Evm} gives partial bytecode interpreters and call/creation frames. Yul word expressions and a richer interaction model support these layers, with correspondence theorems connecting their supported domains. Two source boundaries must be distinguished throughout. The \emph{resolved machine} consumes typed syntax, declaration identities and a resolved function table; it supports a broader language, including loops and internal recursion. The \emph{artifact certificate interfaces} relate models of a restricted source language to particular target artifacts. Clients establish source admission and exact artifact binding through external parsing and artifact capture. These trusted steps connect the source files and compiler output to the models in the theorems. The safety profile further restricts the resolved machine to the configurations covered by its invariants. Section~\ref{sec:trust} collects the trust assumptions for using these interfaces. Solidity Spec is a standalone project at \src{okcontract/solidity-spec}~\cite{artifact}. It follows our work on the oksolc compiler. All paths in this paper are relative to this package unless explicitly qualified. Primary declarations use the \code{Solidity} namespace; certificate interfaces also use \code{Compiler.Validation} through compatibility imports. The release is pinned to Solidity 0.8.36, reference compiler identity \code{0.8.36+commit.8a079791}, Cancun, and Lean 4.29.0. Compiler compatibility is scoped to \code{viaIR: true}, with optimization disabled or enabled at 200 runs; legacy code generation is outside this profile. \src{target.json} and \src{Target.lean} record those targets. Versioned documentation provides explanatory references~\cite{control,abi,layout,types}. Although the documentation site may label its 0.8.36 pages ``develop,'' the exact native compiler identity pins differential tests. Accepted pragmas retain this fixed semantic target. \subsection{Compiler-pipeline boundary} The choice of compiler pipeline affects the timing of implicit copies. With an initially empty storage array \code{values}, consider: \begin{verbatim} values.push(1); Holder memory h = Holder(values, append()); return h.a.length; \end{verbatim} Here \code{Holder} has a memory-array member, and \code{append()} pushes 2 onto \code{values} before returning zero for its other member. Legacy code generation copies the first argument before evaluating the second, producing length one. IR evaluates the raw arguments before copying, producing length two. The corresponding internal call with a memory-array parameter behaves the same way. Both results were reproduced by the external driver with the pinned compiler, Cancun, and both optimizer settings. The indexed fixture returning \code{h.a.length*256+h.a[1]} panics with code \code{0x32} under legacy and returns 514 under IR. The construction and invocation rules select the IR conversion phase. Reproducing the legacy copy timing would require changing conversion placement as well as selecting an argument order. Explicit conversion nodes could support such an elaboration in future work. Solidity documents further differences between the pipelines~\cite{ir-changes}, motivating the explicit compatibility profile used here. \begin{table*}[t] \centering \caption{Coverage by kind of evidence within the stated restricted representation/admission profiles. External checks cover selected manually paired IR cases.} \label{tab:coverage} \small \begin{tabularx}{\textwidth}{@{}Xccccc@{}} \toprule Construct & Represented & Admitted & Generic safety & Target refinement & External check\\ \midrule Scalar operations and word storage & Yes & Yes & Profile & Selected pilots & Selected cases\\ One-level \code{uint256[]} memory & Yes & Yes & Profile & Prepared entries & Selected cases\\ Struct construction and aggregate copying & Yes & Yes & No & No & Selected cases\\ Internal calls and reference parameters & Yes & Yes & Profile & Alias/call pilot & Selected cases\\ Events and their rollback & Yes & Yes & No & No & One rollback case\\ General source-to-resolved elaboration & No & No & No & No & No\\ \bottomrule \end{tabularx} \end{table*} \section{The continuation machine and its safety contract} \label{sec:execution} Let $\tau$ range over resolved scalar, aggregate-reference and function types, and let $P$ be a finite table of typed function bodies. Local cells contain typed values or explicit uninitialized references; heap references identify physical locations rather than copied mathematical arrays. The execution layer defines closed resolved syntax, heterogeneous value packets and one continuation machine. Stable local IDs and captured physical places retain the location selected by effectful access paths. A memory-member assignment rebinds its captured pointer cell; readback reloads that cell. Nested tuples and holes remain groupings, without fabricating a storable tuple value. A configuration is $c=(t,K,s,s_0)$: a current task $t$, continuation stack $K$, current machine state $s$, and invocation checkpoint $s_0$. The state contains typed local cells, arithmetic mode, the physical heap and world, external backend state, and remaining materialization work. A task may evaluate an expression, capture a place, collect operands, invoke a function or resume control. One transition selects a permitted child when needed and updates these components; an invocation failure restores $s_0$. Each eager expression group selects children independently. Independent list-split selection rules prove that every occurrence in a completed group is evaluated once and that every permitted permutation has a schedule; indexed results return to syntactic order afterward. Boolean operators and conditionals are lazy. Assignment captures its destination once. Conditional arms carry their resolved common type; an implicit tuple-group transfer runs after the whole selected arm has evaluated, so later argument effects precede aggregate copies. Compound assignment permits the old read before or after the RHS. Tuple stores use reverse component order, whereas explicit return conversions follow declaration order. These parent operations are distinct from unspecified child-expression order. Inline arrays allocate backing memory before evaluating their elements. Struct constructors evaluate all raw arguments before root allocation, then convert and store fields in declaration order. Constructor packets permit shared reference children, allowing aliases within a constructor packet. Exiting a lexical scope removes introduced local cells while retaining writes to outer variables. All loop forms, break/continue and return share the same transition vocabulary. Internal calls use a finite signature/body table and support recursion, reference parameters, named returns and multiple results. Raw argument effects precede parameter conversion, which precedes indirect dispatch and its null-handle panic. Callees start checked, share allocation and the invocation heap, and restore caller locals and arithmetic mode. Primitive store codecs retain the certificate logical-store domains, including dirty-Boolean cleanup, without assuming a universal physical-slot injection. Source failures roll back the complete invocation checkpoint. Unsupported or invalid contexts and undefined behavior are explicit inconclusive observations; host exhaustion retains its configuration. Continuation bounds limit host evaluation; EVM operand-stack and gas bounds are properties of a bound target artifact. Finite soundness/completeness covers terminating runs, and an infinite loop witness demonstrates divergence within the same semantics. Whole-tree resolved admission checks scopes and source permissions, including unused branches. Declaration and mutability resolution, and callee summaries of control flow where required, are inputs to these checks. General source-byte admission, aggregate event/error ABI encoding, arbitrary raw-memory correspondence and compiler lowering preservation remain separate obligations. The interfaces are defined under \src{Solidity/Core/Execution}. \subsection{From admission to represented configurations} Soundness and completeness of fuel-bounded iteration relate the runner to the step semantics, whose terminal observations include inconclusive results. Admitted-state safety additionally requires an invariant connecting syntax, local values, captured targets, saved continuations, function handles, and physical heap packets. The safety proof shows that transitions preserve this invariant under explicit domain and primitive-resource assumptions. The proved structural profile includes executable scalar types, closed recursive function handles, canonical memory word arrays with physical aliases, scalar persistent and transient places, eager effects, structured control and singleton declaration prefixes. The independent \code{ConfigurationRep} predicate connects checking equations to initialized cells, heap packets, operand partitions, captured targets and saved continuations. These structural premises allow the proof to derive progress. With adequate primitive resources, \code{Machine.step} either produces a represented source observation or preserves the invariant and checkpoint, excluding inconclusive results and primitive suspension. Entry requires successful admission, the structural profile, a closed admitted function table, and an initial state with represented physical packets and closed function handles. The profile excludes other aggregate families, storage/calldata reference locals, tuple-pattern assignments, inline-array and struct construction, array-length mutation, event/error encoding, assembly and linked calls. User-defined value wrapping/unwrapping, external-function projections and \code{delete} are also excluded; a for-loop post is an expression or skip. \src{SAFETY.md} indexes the declarations defining this profile within the broader executable machine. Resource adequacy is separate from termination. Aggregate fuel is at least two and host continuations are uncapped. Let $C=66(2^{256}-1)+96$. The generic progress theorem assumes at least $C$ remaining host work; an initial allowance of $(n+1)C$ suffices for an $n$-transition prefix. These conservative bounds suffice for the generic proof; particular executions can use less work. The extra allowance covers the runner's real terminal inspection even at zero transition fuel. The \code{execute\_prefix} theorem covers every child-choice sequence. A completed prefix has represented values or exact source-failure rollback; an exhausted prefix retains the invariant, original checkpoint and a further $C$ allowance. The bound measures modeled materialization work; EVM gas and physical host capacity require separate analyses. Final packet typing is existential in the terminal predicate, so the generic theorem establishes representation preservation and absence of model failure. Relating those packet types to the root expression's result type remains open. The pilot theorems establish the exact returned words for their particular programs. Two regression families illustrate the distinction. Invocation performs the permitted implicit internal-function conversion, including pure-to-view widening, while retaining the handle. Separately, eager siblings receive the same incoming reference-readiness facts. Assignments guaranteed by a complete group become available afterward; a read requiring another sibling to run first is unsupported by this defined admission domain. Lazy operands and sequential statements retain their required order. The raw machine still represents the original order-dependent inconclusive schedules. The lightweight import \src{Solidity.Execution} exposes checked entries, the machine and its execution facade. Its \src{Proofs} submodule provides additional execution laws, and \src{Safety} exports admitted-state safety. Compatibility clients use \src{Solidity.Compatibility.Execution}; the comprehensive \src{Solidity} umbrella includes all four interfaces. Indexed checked entries retain the admission equations. Their projection proofs preserve the facade, including failed preparation. \src{Policy.lean} defines fixed compiler choices, with source provenance recorded in \src{references/policies.json}. These interfaces share the same normalizer and interpreter. \section{Observation contract and provenance} We distinguish three observation profiles. A \emph{functional} observation compares completed return/revert data and the selected public state and effects. A \emph{metered} observation additionally compares the specified resource outcome. A \emph{representation-sensitive} observation also binds the exact code or packet representation required by its relation. These profiles are recorded in \src{SEMANTIC_CONTRACT.md}, with explicit premises for each relation. \src{Observation.lean} defines completed records and named relations over invocation outcomes, public state, transient storage, account lifecycle and ordered interactions. Stronger profiles also compare resource observations and the bound code representation. Correspondence requires completed, supported execution and proof of any capability restrictions stated in the summary. Invocation rollback restores the entry snapshot, including logs and transaction-local storage. Gas consumption and transaction admission/fee settlement have separate boundaries. The current profile starts after admission and intrinsic gas accounting, with fee settlement handled externally. Account existence and Cancun creation/deletion facts are tracked explicitly alongside balances and code. Sixty-two reference snapshots are pinned by immutable upstream revision and content digest in \src{references/lock.json}. They include selected Solidity documentation and type rules and the Cancun execution-specs fork directory. The lock distinguishes complete snapshots from documentation indexes with unbundled chapters, making the reference corpus inspectable at a fixed revision. \section{Quantified source/target experiments} \subsection{Internal calls, aliases and rollback} The composed pilot quantifies over input words $x$, failure flags $b$ and related initial states. Two initialized memory references alias one represented length-one word array. An ordinary entry call invokes an internal helper, which writes the array payload and persistent slot zero. The caller reads through the other alias and either returns $x$ or reverts. The source theorem derives parameter binding, named-result initialization, both calls, result transfer and caller restoration through the continuation machine. It establishes a checked completion within 160 transitions with choices \code{[]} for every materialization allowance. The target is a manually paired, hand-authored 23-byte Cancun fragment. Its prepared-entry relation gives six active memory words and zero bytes beyond that extent. A metered target trace determines adequate-gas observations; failure and insufficient gas restore the complete target world and transaction snapshot. Frame theorems preserve other owners, other storage slots and memory packets disjoint from the written payload. The proof derives both the source run and its correspondence with this trace from the entry-representation premises. \code{refines\_represented} composes this same budgeted source execution with generic safety at $B\geq161C$, then derives matching adequate-gas target observations and separate insufficient-gas rollback. Both exported refinements retain $g_{\rm remaining}=g-\mathit{used}$ for every $g\geq\mathit{needed}$, with $\mathit{used}\leq\mathit{needed}$. Their source/target relation is functional; the equation additionally specifies target gas consumption, without assigning EVM gas to the source. A nonemptiness theorem constructs its represented, related domain for arbitrary persistent worlds, owners, words and flags. A negative fixture shows that the default 4096 work allowance suffices for this nonallocating trace but falls below the generic uniform bound. A companion applies all-choice prefix safety to the effectful aliased group \code{(a[0] = x) + b[0]}, permitting order-dependent values and source overflow panic. Both experiments start from prepared entry states and hand-authored artifacts. Their scope is execution from those entries; source-byte correspondence, compiler emission, and deployment/allocation prefixes remain external to the composition. \src{PILOT.md} indexes the proof modules and reproduction commands. \subsection{Order-sensitive success and rollback} The second experiment uses two initialized references to the same initially zero memory word and the following prepared function body: \begin{verbatim} stored = x; uint256 z = (a[0] = x) + b[0]; if (fail) revert(); return z; \end{verbatim} The source has two concrete permitted schedules. Reading the alias first gives $x$; writing first gives $2x$ if it fits, and panic \code{0x11} otherwise. For $x=2^{255}$ and a false failure flag, one schedule returns $2^{255}$ and the other restores the complete entry state. The initial storage write therefore participates in the rollback argument. For each schedule, the \code{source\_execution} theorem derives machine execution with a transition allowance of 80 for every input word, failure flag and host-work allowance, including zero. The \code{source\_permitted} theorem embeds that trace in the permitted-execution relation. Admission is checked for the prepared body and its expected word return binder. Independent premises require represented aliases, an initially zero payload and writable storage. A domain witness establishes these premises and related target states for arbitrary persistent worlds. Two fixed, hand-authored Cancun fragments implement these schedules: 25 bytes for the read-first case and 111 bytes for the write-first case. Both receive the original word and flag and perform the storage write. The latter checks the high-half bound before doubling. Their guarded traces determine a gas threshold and consumption, including the storage sentry. The exported \code{refines} theorem proves functional correspondence for every adequate gas budget, the exact remaining-gas equation, and complete target world/transaction rollback for overflow, explicit revert and insufficient gas. Negative controls reject a wrapping zero return at $2^{255}$ for both contracted schedules and reject a target that matches the empty revert bytes while retaining its write. These results compose order, aliasing and failure in one source/target argument. The body operates on existing aliases; internal calls are covered by the first pilot and aggregate deep copies by the external tests. Its allocation-free trace also gives a zero-work bound for this program, illustrating how a program-specific argument can sharpen the generic profile's uniform bound. \section{Released proofs and executable checks} \label{sec:evaluation} The release separates proof checking, model examples and external conformance. The package build elaborates both libraries and their regression modules. Build checks use four Lean workers. Fresh kernel replay checks the comprehensive library, the call/resource, child-order and order-sensitive pilot roots and the scalar machine regression closure, including their imports. These checks concern the released Lean definitions and proofs. External compiler execution is reported separately below. \subsection{Theorem contracts and composition} \src{theorems.json} records 85 selected roots with fully qualified names, expected elaborated statements, complete kernel-statement hashes and permitted axioms. A statement hash binds references to named predicates. The manifest additionally records SHA-256 identities for the imported project definition closure, build inputs and auditor. The release command compares compiled statements, complete kernel-statement hashes, per-root transitive axiom allowances and this source closure before fresh replay. Changed definitions therefore fail the gate even if a theorem's displayed statement is unchanged. Recording new expectations is an explicit review operation and is never an acceptance run. Fresh replay then checks proof terms independently of elaboration. The two pilots compose checked admission and independent representation premises with source execution, target execution, gas conditions, and rollback for all quantified inputs. Explicit bounds on source transitions, aggregate recursion, and materialization work ensure that these executions complete. \subsection{Model fixtures} The package includes manually paired and generated model fixtures under \src{Solidity/Conformance}. The scalar corpus contains 45 scalar, loop and constant cases and ten constant rejection examples. The inference corpus contains 38 expression cases and 16 rejection examples; the static matrix contains 17,690 generated conversion, operator and update cases. These modules provide executable model expectations and source representations. The aggregate corpus contains 46 runtime examples, five static rejection examples and nine model-boundary checks. The effectful corpus contains 48 machine programs, three source-rejection examples and two host-boundary checks. The interaction corpus contains 42 generated combinations of aliasing, evaluation order, conversions, calls and rollback. Expected outcomes are computed by executing the model, with manually paired source representations. These full-corpus counts describe model fixtures; the following external evaluation independently executes a selected subset. Kernel regression modules exercise ABI canonicality, payability, storage layout, stateful execution, constructors, admission rejection, rollback and host exhaustion. Import and declaration-dependency guards check that primary execution interfaces use the shared machine. These concrete regressions complement the universal theorem contracts and help localize changes in behavior. \subsection{Independent compiler/EVM evaluation} The standalone driver executes fourteen selected effect cases through the Lean machine and checks resolved admission, then compiles the paired Solidity with the exact reference compiler and runs the artifacts on a local Cancun Anvil instance. Both IR optimizer settings are checked. The 28 observations matched exported permitted outcomes: 20 returned and eight reverted. There were no unexpected compiler rejections, model admission failures, unsupported executions, host exhaustions or observation discrepancies in this runtime set. The comparison tests membership in a finite set of executed, permitted schedule witnesses. Because this set may cover only some schedules, a nonmember requires examining the pairing and coverage before diagnosing a semantic mismatch. The cases include aliased operand ordering, argument effects and copies, compound destination capture, overlapping tuple stores, internal reference calls, checked overflow, and rollback. Each call observes unchanged initial contract storage. Reverting cases additionally execute as transactions with failed receipts, empty logs and unchanged selected storage slots. The rollback check observes precisely these components of the transaction result. Three separate static-rejection controls matched compiler diagnostic identities. Two model resource controls preserve exhaustion as a host limitation. The three copy-timing probes also run under legacy compilation with both optimizer settings: all six observations exhibited the documented boundary discrepancy and are recorded separately as negative compatibility controls. The runner retains exact source and Standard JSON inputs, compiler outputs, tool identities/hashes, RPC observations, process statuses and package input identities, allowing the corpus observations and compiler configuration to be reproduced. The manual source/model pairing remains a review obligation. \section{Domains and semantic layers} Let $M=2^{256}$, $\W=\{0,\ldots,M-1\}$, $\mathbb A=\{0,\ldots,2^{160}-1\}$, and $\mathbb B=\{0,\ldots,255\}$. Lean represents words and addresses using \code{BitVec 256} and \code{BitVec 160}. Bytes are \code{UInt8}; byte strings are finite lists. We write $\rho$ for a local environment, $\sigma$ for storage, and $\kappa$ for context. \subsection{Word operations} \src{Word.lean} defines wrapping word operations and explicit checked operations. Wrapping addition, subtraction and multiplication operate modulo $M$. Logical shifts give zero for a shift count at least 256. The shared low-level unsigned division and remainder follow the EVM convention of yielding zero at a zero divisor; the checked variants below produce panic bytes. Define $P(c)$ as the four selector bytes \code{4e 48 7b 71}, followed by 31 zero bytes and the one-byte code $c$. The checked arithmetic evaluator returns \code{Except (List UInt8) (BitVec 256)}. For natural representatives $a,b$, \begin{align*} \operatorname{add}_{c}(a,b)&= \begin{cases}\operatorname{ok}(a+b)&a+b{\raggedright\arraybackslash}p{.27\columnwidth}X@{}} \toprule Development & Relevant semantic or proof interface \\ \midrule K Solidity~\cite{ksolidity} & Executable structural operational source semantics in K; contract analysis clients. \\ Lolisa~\cite{lolisa} & Solidity subset in Coq with stronger typed syntax and a reusable formal memory framework. \\ Isabelle/\allowbreak Solidity~\cite{isabelle,isabelle-safety,isabelle-shallow} & Deep executable semantics, grammar fuzzing, program proofs and type safety; a separate shallow embedding with a storage model and verification-condition generation. \\ Solc-verify~\cite{memory-smt} & SMT-oriented encoding of storage pointers, memory references, allocation and copying. \\ SolidiKeY~\cite{memory-key,solidikey-lean} & Logical data-area formalization; Lean fragment compilation into a word-addressed machine under explicit input relations. Physical EVM layout and fork/gas correspondence are separate. \\ SolidCore~\cite{solidcore} & Lean source execution with captured storage references and documented intrinsic compiler-specific child orders; reference-toolchain replay. \\ FORYU~\cite{foryu} & Rocq Yul semantics with a proved liveness-analysis checker and reported evaluation on more than 1,500 contracts. \\ Solidity Spec & Per-group child choices, physical packet/alias conditions, checked resolved entries and separate source/model/resource observations; explicitly scoped safety and target-proof obligations. \\ \bottomrule \end{tabularx} \end{table} Hajdu and Jovanovi\'c encode local storage pointers and memory allocation/copying for solver automation~\cite{memory-smt}; da Silva et al. study object identity and proof-oriented data-area representations~\cite{memory-key}. The inspected SolidiKeY Lean compiler theorem relates a source fragment to a word-addressed machine under explicit certificate and input-relation premises~\cite{solidikey-lean}. Our representation relations track byte-addressed heap packets and ordered physical writes, connecting them to guarded Cancun traces in the pilots. Thornton and Marmsoler prove type safety for Isabelle/Solidity, including consistency of pointer structures~\cite{isabelle-safety}. In our continuation machine, the safety invariant connects physical heap representation to captured targets, saved continuations, and the invocation checkpoint across child choices. SolidCore is especially close in language and tooling. Its inspected order design fixes construct-specific choices for a compiler configuration. Our machine exposes independent choices for each eager group; its safety theorem must therefore preserve the invariant under every permitted choice in the profile. Isabelle's conformance methodology and FORYU's semantics-plus-checked-consumer evaluation inform our evaluation design~\cite{isabelle,foryu}. The remaining research question is whether our combined interfaces reduce the assumptions and proof effort of compiler-preservation compositions. Evaluating complete compiler passes would extend the evidence beyond the two bounded pilots presented here. \section{Package and reproducibility} The package contains \src{Contract/} and \src{Solidity/}, a Lake configuration, and pinned toolchain and dependency files. The default libraries are \code{Contract} and \code{SoliditySemantics}; the only library dependency is Lean's bundled \code{Std}. The release checks also require Python 3's standard library. The pinned compiler and Anvil are additional dependencies for external conformance checks. From a Solidity Spec checkout with Lean 4.29.0 installed: \begin{verbatim} make replay JOBS=4 make paper \end{verbatim} The first command builds the package, runs the audit's negative controls, enforces the theorem manifest and definition-source binding, then freshly rechecks the library and three pilot roots plus scalar regressions sequentially with \code{leanchecker --fresh}. The second command uses Tectonic to rebuild this paper. CI runs the build and fresh replay and retains diagnostic logs. \src{RELEASE.md} documents these commands, and \src{THEOREMS.md} explains the theorem manifest. For external checks, set \code{SOLC} to the pinned compiler executable and \code{LEAN\_BIN} to the Lean binary directory: \begin{verbatim} python3 scripts/check_conformance.py \ --solc "$SOLC" --lean-bin "$LEAN_BIN" \ --output /tmp/new-conformance-run \end{verbatim} \src{CONFORMANCE.md} documents observation scope and the required tools. The public runtime interface is \src{Solidity.Execution}. Its \src{Proofs} and \src{Safety} submodules expose laws and admitted-configuration safety. \src{Solidity.Compatibility.Execution} exports certificate correspondences. These interfaces separate runtime operations, representation assumptions and proof consumers. \section{Limitations and future research} This release is an incomplete formalization. Resolved declarations, source translation and exact artifact binding are explicit assumptions. The safety profile is narrower than the executable aggregate domain, and the target interpreter covers a Cancun subset. The pilots relate prepared source entries to manually paired bytecode fragments; verified compiler emission and general lowering remain open. Compatibility testing covers selected IR cases, with legacy elaboration left for future work. Generic terminal typing remains existential, and the uniform host bound is far larger than practical executions usually require. Future research includes verified source and declaration elaboration, safety for additional aggregate representations, linked external execution, and broader ABI and assembly semantics. Compiler-preservation compositions require an explicit observation and gas model and a justified connection to emitted bytes. Further work includes a root-result-indexed terminal invariant, state-dependent resource bounds, verified conversion placement, broader independent execution coverage and proofs for emitted compiler artifacts. \appendices \section{Artifact map} Short filenames in the text identify declarations in their semantic layer. Table~\ref{tab:layers} locates those layers. The theorem manifest records fully qualified names and defining modules. \src{SAFETY.md}, \src{PILOT.md}, \src{THEOREMS.md} and \src{CONFORMANCE.md} index the precise proof profiles, artifact bindings, audit commands and external checks. \begin{table}[t] \caption{Representability and current certificate coverage are distinct.} \label{tab:layers} \small \begin{tabularx}{\columnwidth}{@{}p{.25\columnwidth}X@{}} \toprule Layer & Executable meaning and boundary \\ \midrule Typed contract & Indexed variables and slots; finite helper bodies and logs. Parsing, ABI and gas are handled externally. \\ Certificate source & Resolved word expressions; restricted methods, ABI guards, word/Boolean storage, branches and initialization. Closed parser admission is trusted. \\ Resolved machine & Physical aggregates, effects, loops and internal recursion. Resolved typed input; safety covers the stated structural profile. \\ Yul expressions & Word operators and environments used by optimizer proofs; restricted to the expression fragment. \\ Interaction & Memory/world operations, call oracle, creation executor and fuel, with conditional reasoning about callees. \\ Bytecode & Partial raw-byte Cancun semantics. Unsupported instructions and exhausted interpreter fuel are explicit non-success results. \\ \bottomrule \end{tabularx} \end{table} \begin{thebibliography}{99} \bibitem{artifact} OKcontract, ``Solidity Spec,'' standalone project. \url{https://github.com/okcontract/solidity-spec}. \bibitem{ksolidity} J. Jiao et al., ``Executable Operational Semantics of Solidity,'' 2018. \url{https://arxiv.org/abs/1804.01295v1}. \bibitem{lolisa} Z. Yang and H. Lei, ``Lolisa: Formal syntax and semantics for a subset of the Solidity programming language in Mathematical Tool Coq,'' version 3, 2021. \url{https://arxiv.org/abs/1803.09885v3}. \bibitem{isabelle} D. Marmsoler and A. D. Brucker, ``Isabelle/Solidity: A deep embedding of Solidity in Isabelle/HOL,'' \emph{Formal Aspects of Computing}, 37(2), 2025. \url{https://doi.org/10.1145/3700601}. \bibitem{isabelle-safety} B. Thornton and D. Marmsoler, ``Type Safety for Isabelle/Solidity,'' author manuscript. \url{https://marmsoler.com/assets/pdf/thornton_24_typesafety.pdf}. \bibitem{isabelle-shallow} D. Marmsoler, A. Ahmed and A. D. Brucker, ``Isabelle/Solidity---A shallow Embedding of Solidity in Isabelle/HOL,'' \emph{Archive of Formal Proofs}, 2026. \url{https://isa-afp.org/entries/Isabelle-Solidity.html}. \bibitem{memory-smt} \'A. Hajdu and D. Jovanovi\'c, ``SMT-Friendly Formalization of the Solidity Memory Model,'' ESOP 2020, pp. 224--250. \url{https://arxiv.org/abs/2001.03256v2}. \bibitem{memory-key} G. H. A. da Silva, W. Ahrendt and R. Bubel, ``Axiomatisation of Solidity Memory and Storage,'' SEFM 2025, LNCS 16192, pp. 73--90, 2026. \url{https://doi.org/10.1007/978-3-032-10444-1_5}. \bibitem{solidikey-lean} SolidiKeY authors, ``Solidity Lean,'' revision \src{23ba92a3efbc73dce04ad0483294d42757375a0d}, inspected 11 November 2026. \url{https://github.com/SolidiKeY/solidity-lean/tree/23ba92a3efbc73dce04ad0483294d42757375a0d}. \bibitem{solidcore} Paradigm authors, ``SolidCore,'' revision \src{1f6fe8636d023926792faf4bd024bba943492a63}, inspected 11 November 2026. \url{https://github.com/paradigmxyz/solidity-lean/tree/1f6fe8636d023926792faf4bd024bba943492a63}. \bibitem{foryu} E. Albert, S. Genaim and E. Martin-Martin, ``Towards Formally Verified Smart Contracts Compilation,'' FM 2026, LNCS 16557, pp. 255--274. \url{https://doi.org/10.1007/978-3-032-26220-2_13}. \bibitem{control} Solidity authors, ``Expressions and Control Structures,'' Solidity 0.8.36 documentation. \url{https://docs.soliditylang.org/en/v0.8.36/control-structures.html}. \bibitem{ir-changes} Solidity authors, ``Solidity IR-based Codegen Changes,'' Solidity 0.8.36 documentation. \url{https://docs.soliditylang.org/en/v0.8.36/ir-breaking-changes.html}. \bibitem{abi} Solidity authors, ``Contract ABI Specification,'' Solidity 0.8.36. \url{https://docs.soliditylang.org/en/v0.8.36/abi-spec.html}. \bibitem{layout} Solidity authors, ``Layout of State Variables in Storage and Transient Storage,'' Solidity 0.8.36. \url{https://docs.soliditylang.org/en/v0.8.36/internals/layout_in_storage.html}. \bibitem{types} Solidity authors, ``Types,'' Solidity 0.8.36. \url{https://docs.soliditylang.org/en/v0.8.36/types.html}. \bibitem{eip2200} W. Tang, ``EIP-2200: Structured Definitions for Net Gas Metering.'' \url{https://eips.ethereum.org/EIPS/eip-2200}. \bibitem{eip2929} V. Buterin and M. Swende, ``EIP-2929: Gas cost increases for state access opcodes.'' \url{https://eips.ethereum.org/EIPS/eip-2929}. \bibitem{eip3529} V. Buterin and M. Swende, ``EIP-3529: Reduction in refunds.'' \url{https://eips.ethereum.org/EIPS/eip-3529}. \bibitem{eip170} V. Buterin, ``EIP-170: Contract code size limit.'' \url{https://eips.ethereum.org/EIPS/eip-170}. \bibitem{eip3541} A. Beregszaszi et al., ``EIP-3541: Reject new contract code starting with the 0xEF byte.'' \url{https://eips.ethereum.org/EIPS/eip-3541}. \bibitem{eip3860} M. H. Swende et al., ``EIP-3860: Limit and meter initcode.'' \url{https://eips.ethereum.org/EIPS/eip-3860}. \end{thebibliography} \end{document}