ScopedSep L is decidable: scopedSep_iff_check proves it equivalent to
sepCheckBy keccakWord L, so the kernel settles the premise for any
concrete footprint (scopedSep_of_check). Add the nested footprints of
approve and transferFrom (the inner key hashed by the same hash),
their slot lemmas (approve_slots, transferFrom_slots), real keccak
witnesses for transfer, self-transfer, approve and transferFrom, an
abstract model for any nested footprint, and refusals of colliding
and truncated hashes. The all-pairs claim for balances is shown equal
to keccak separation on every balance preimage, and is not assumed.
scripts/verify/keccak/footprint_check.sh proves the premise of one
concrete call by kernel evaluation and audits its axioms, exiting 2
on malformed input.
Prove E7 of the first slice over SolidCore's runs: solar-verify's
transfer-slice.spec, exported and discharged for UniswapV2ERC20's
checked transfer (meets_bundle, transfer_holds), and the target's
post (meets_target): sequential debit then credit, with caller = to
succeeding iff the balance covers the value and leaving it unchanged,
a Transfer log and true on success, a revert with the source's data
otherwise, and every physical slot outside the two balance slots kept.
The only hash premise is ScopedSep on the call's two balance
preimages, part of the valid calls; the required runs (self-transfer
at 2^256-1, self-transfer short of the value) need none. NonVacuous
holds for each post, and three source mutants (no debit, swapped log,
false return) are refused by execution.
meets_bytes and certified_of carry the post to the bytes given Equiv
(E4 to E6) and Resources (E8) as hypotheses; they are not yet
discharged here. uniswap_v2_transfer_slice.sh generates the export,
the erased trees and the mutants (from the GPL-3.0 port, not
committed).
Check E4 of the first slice: solar's stages of UniswapV2ERC20 from the
source MIR to the final EVM IR (stage0 through evm11) refine each
other, both ways, on every call whose selector is not one of the
other twelve functions' (uv2_erc20_transfer_mir_to_evmir and
_certified, _certified_back). The proofs are cut block by block so
each module is checked within 6 GB. Ctx.lean has the checker with
contexts accept the exact bytes against evm11 and states that the
bytes are not call-free; CtxNeg refuses three one-byte mutants.
uniswap_v2_stages.sh generates the stages, the gas certificate and
these proofs into Certified/uv2_erc20 with tools/certify at the solar
commit pinned in uniswap_v2_stages-solar-rev, before a build of the
uv2_erc20 and source-stage libraries. Nothing generated is committed.
boolLit and boolAndLit folded b || true and b && false as dsimp
steps, which are not definitional while b is unknown, so the kernel
refused the proof term. Fold only left literals there and leave right
literals to seg_cut_test's Bool.or_true, or_false, and_true and
and_false; also fold a test or'd with its negation before case
splits.
Prove E3 of the first slice for UniswapV2ERC20.transfer: the generic
source checker accepts solar's fresh stage0 (private _transfer, the
checked SafeMath sub and add, the two balanceOf writes and the Transfer
log), so on every valid call the first lowered MIR shows what the
checked source shows (SourceMir.transfer_stage, transfer_source_mir).
The only premise, SourceEnvOk, asks the oracle's caller and two-word
Keccak-256 to be SolidCore's and is met by EthLib's oracle. Eight
stage0 mutants are refused by the same kernel-evaluated check.
uniswap_v2_erc20_stages.sh exports the stages from the port into
Certified/uv2_erc20/gen; uniswap_v2_gas.sh now reuses that export, and
one uv2_erc20 library holds the stages, the mutants and the gas bound.
The caller is fixed at 0x2000, as in SolidCore's semantics.
Prove that the published specification accepts a sync that leaves the
reserves unchanged (syncNoop_accepted): sync's exported ensures are
only that the supply and the lock are kept, and the reserve update is
the private _update's postcondition. So a sync mutant without _update
cannot be refused by this specification. The real bytes and the
checked source both move the reserves to the balances (evaluated).
Name the pair statement's premise PairAllowanceApart: the words
allowance[address(0)][s] that the ERC20 invariant reads avoid the
pair's 13 fixed slots. Drop the balanceOf[address(0)] half, which the
kernel computes (TrustedBase.image3), and show the premise holds for a
hash model, so it is not False in disguise. Add an axiom audit of
every pair headline, checked by #guard_msgs.
Run skim(0x3000) with token balances 11000/10500 over reserves
10000/10000 on the exact bytes and the checked source (reserves kept),
and on a mutant that forces the reserves to the balances first, as
solar's compile and SolidCore's translation of the mutant source
(reserves 11000/10500). The published spec refuses every successful
skim observable with reserve0 moved (skimUpdate_refused, kernel).
Proves a gas bound G = 8199112 for UniswapV2ERC20.transfer on its
exact runtime bytes, from every caller below 2^160 but the contract.
The checker with contexts and gas (checkXL) accepts the bytes against
the final EVM IR evm11 with every block outside transfer's slice left
unchecked; a symbolic guard stage shows no transfer call enters those
blocks. The forward theorem is generalized to any CALLER
(runWithFrom, forward_of_checkXLFrom) and composed into
Shapes.ResourcesFrom, which gives Shapes.Resources at callerAddress.
Generated inputs (stages, certificate) come from
scripts/verify/uniswap_v2_gas.sh and are not committed.
Replace the pair statement's NestedSlotsSeparated premise, which no
256-bit hash satisfies, with HashScope: the keccak words the
specification reads (balanceOf[0] and allowance[0][s]) avoid the
pair's 13 fixed slots. It is an avoidance premise, not injectivity,
and stays a named premise of the statement.
Add negative controls run on the exact bytes in EthLib and on the
checked source in SolidCore: a swap without its reserve update and a
spec with a stronger K clause are refused (kernel-checked over every
observable with the executed features), an altered jump fails the
binding, and closed or mismatched worlds are shown not to agree.
uniswap_v2_pair_spec.sh now also generates the mutant (not committed).
The stage theorems published_of_stages composes are still hypotheses.