Compare commits

...

67 commits

Author SHA1 Message Date
alpharush
0e88f235a4
feat(verify): generic source loop bridge and bump's body binding 2026-11-15 12:21:36 -06:00
alpharush
44572c1501
feat(verify): generic Expected theorem, certificate interface and envelope gate (Counter, ERC20.transfer instances at default caller) 2026-11-14 23:50:08 -06:00
alpharush
23ca05f798
feat(uniswap-v2): ERC20 transfer certified from every caller under ScopedSep (per-caller inhabitation and E6 binding pending) 2026-11-14 23:42:38 -06:00
alpharush
33e0b2d714
docs: add scoped AGENTS.md guidance and pinned Lean skills 2026-11-14 22:17:14 -06:00
alpharush
729ef4640f fix(ci): run the CTI corpus check under Python 3.12 2026-11-14 22:12:40 -06:00
alpharush
248e532d0d feat(verify): loop-invariant CTI corpus with ICE labels and bounded replay 2026-11-14 22:09:13 -06:00
alpharush
01efea8b76
feat(infer): loop obligations from solar-verify's loop-cut interface 2026-11-14 22:08:38 -06:00
alpharush
bc6da61b96
docs(certification): state the transfer status and missing edges 2026-11-14 21:54:04 -06:00
alpharush
49ef3c4ba1
feat(uniswap-v2): function specifications and Pair stages 2026-11-14 21:23:24 -06:00
alpharush
6dd035dc25
ci(refinement): drop the transfer statement build 2026-11-14 18:13:03 -06:00
alpharush
5691327c55 feat(uniswap-v2): certify transfer from any caller 2026-11-14 17:50:34 -06:00
alpharush
f8a4a74437
feat(uniswap-v2): certified transfer at 0x2000 2026-11-14 14:26:54 -06:00
alpharush
1d7b0d6729
ci(refinement): build VerifyCounter.Source at 4500 MB 2026-11-14 14:23:40 -06:00
alpharush
acbe748c85 feat(frontend): translate inline assembly create2 2026-11-14 13:52:14 -06:00
alpharush
d0ab5d63a4 feat(uniswap-v2): approve and transferFrom stage 2026-11-14 12:00:17 -06:00
alpharush
91232b2f37
feat(verify): bind small contracts to spec exports 2026-11-14 11:52:24 -06:00
alpharush
9bfda1c986
feat(generic): heap and keccak memory patterns 2026-11-14 11:46:16 -06:00
alpharush
8e02b22d8b
ci(verify): check the ERC20 transfer slice 2026-11-14 10:54:00 -06:00
alpharush
bcc708272e feat(uniswap-v2): ERC20 runtime is not call-free 2026-11-14 10:53:40 -06:00
alpharush
cb8cd829ea feat(spec): kernel check of the scoped keccak premise
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.
2026-11-14 16:46:49 +00:00
alpharush
a090ad8a0d feat(uniswap-v2): transfer spec over source runs
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).
2026-11-14 16:44:19 +00:00
alpharush
78c7107f54 feat(uniswap-v2): ERC20 transfer backend stages
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.
2026-11-14 16:39:58 +00:00
alpharush
a1de70d5e8 fix(tv): fold right literals of || and && by rewriting
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.
2026-11-14 16:39:36 +00:00
alpharush
1b4ab78b70 feat(uniswap-v2): ERC20 transfer source stage
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.
2026-11-14 15:43:13 +00:00
alpharush
25213abfda test(uniswap-v2): sync spec accepts a no-op
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).
2026-11-14 15:10:38 +00:00
alpharush
6cb2c0141e fix(uniswap-v2): pair premise apart, skim control
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).
2026-11-14 14:44:57 +00:00
alpharush
423bf6d984 feat(refinement): transfer gas bound, any caller
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.
2026-11-14 14:40:22 +00:00
alpharush
aa0b3eb2a3 feat(uniswap-v2): scoped pair premise, run negatives
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.
2026-11-14 14:08:49 +00:00
alpharush
9fb89ee6c4
feat(refinement): runner premises for call-free bytecode 2026-11-13 23:21:35 -06:00
alpharush
27a02d47de
feat(spec): footprint-scoped keccak premise 2026-11-13 23:21:13 -06:00
alpharush
a1c3143284
docs: sequential transfer post, scoped frame 2026-11-13 22:47:21 -06:00
alpharush
d5daff526d
docs: certification target and edge statuses 2026-11-13 22:38:12 -06:00
alpharush
e93cd46a6a fix(verify): absolute solar paths in ERC20 spec step 2026-11-13 22:21:28 -06:00
alpharush
32ca8131aa feat(uniswap-v2): open-world Pair statement 2026-11-13 22:09:25 -06:00
alpharush
adb6d54a3f
feat(assembly): return data after CALL and CREATE2 2026-11-13 21:44:11 -06:00
alpharush
7ef8fa72c0
ci(verify): pin the ERC20 spec solar to 91fc248 2026-11-13 21:21:07 -06:00
alpharush
7aedd63306 feat(verify): ERC20 specs and staged Pair checks 2026-11-13 21:14:27 -06:00
alpharush
1a248d1576
chore(certified): record the statuses of the published statements 2026-11-13 13:22:05 -06:00
alpharush
c0a8a58a86
feat(verify): staticcall cuts and kernel-checked uv2 math conditions 2026-11-13 13:12:47 -06:00
alpharush
95ebfd5f17
feat(refinement): generic shapes, ranking certificates and call cuts 2026-11-13 13:05:00 -06:00
alpharush
534f2d9d7d
feat(refinement): fixed shapes for counter and arraymax backend stages 2026-11-13 11:15:56 -06:00
alpharush
bd81477c6a
fix(refinement): drop the compiler pin from the milestone certificates 2026-11-13 11:08:54 -06:00
alpharush
c46e8f558d feat(refinement): dynamic memory in assembly runs and generic spec trees 2026-11-13 11:01:41 -06:00
alpharush
633eeb7374 chore(certified): regenerate with the current driver and record each status 2026-11-13 10:43:51 -06:00
alpharush
813949dc35 feat(refinement): assembly with environment reads, run oracles and call families 2026-11-13 10:06:01 -06:00
alpharush
313a0472d2 feat(refinement): generic assembly execution, kernel discharge and callsqrt 2026-11-13 08:42:01 -06:00
alpharush
0afc04ec46
test(refinement): add cut-point leaf equations and d1-d4, w5 facts 2026-11-13 06:06:53 -06:00
alpharush
46d4b28f23 fix(refinement): regenerate only the kept corpus proofs 2026-11-13 05:41:13 -06:00
alpharush
bf17c1f916
chore(tv): drop the old token milestone 2026-11-13 04:57:06 -06:00
alpharush
6c256e2b18 test(refinement): audit Token and VerifyCounter headlines separately 2026-11-13 04:51:02 -06:00
alpharush
499a5fc7d4
feat(contracts): state Token's headline and total refinement 2026-11-13 04:12:42 -06:00
alpharush
936025191f
feat(contracts): prove verify_counter's spec of its bytecode at every gas 2026-11-13 04:02:31 -06:00
alpharush
f9d81d8dfd
fix(contracts): import what Token's burn VCs use 2026-11-13 03:39:35 -06:00
alpharush
89e812b12d
ci(refinement): build verify_token, not the older token stages 2026-11-13 03:12:12 -06:00
alpharush
3813b7f269
fix(lake): resolve every Contracts.Counter root as a target 2026-11-13 02:38:25 -06:00
alpharush
9178aea5d6 feat(counter): certify verify_counter with its bump loop 2026-11-13 02:09:12 -06:00
alpharush
9ba6045f19 feat(token): certify Token through solar-verify's backend 2026-11-13 01:57:46 -06:00
alpharush
f523357d21
ci(refinement): build in cached stages; prove ArrayMax.max VCs 2026-11-13 01:43:45 -06:00
alpharush
037666c6c7
feat: prove fuel monotonicity and build certified libraries in CI 2026-11-13 01:04:46 -06:00
alpharush
69ffa68732 fix: restore SolidCore, Loom and Verify on the translation branch 2026-11-13 00:59:22 -06:00
alpharush
addeaa6fca
fix: restore the certified stages and solar-tv semantics 2026-11-13 00:58:07 -06:00
alpharush
8c885e335d fix(refinement): prove certified corpus contracts in the kernel alone 2026-11-13 00:44:25 -06:00
alpharush
52a0742f66
feat: certified translation of solar output 2026-11-13 00:43:35 -06:00
alpharush
f78b7f5b66
fix(evmyul): track the vendored FFI source 2026-11-12 21:25:34 -06:00
alpharush
73d820a30d
feat(token): certify token's source stage 2026-11-12 17:36:38 -06:00
alpharush
fe8c2c0571
feat(corpus): add generated refinement proofs 2026-11-12 17:36:07 -06:00
alpharush
7cdf554864 feat(refinement): certify solar output to bytecode 2026-11-12 17:35:31 -06:00
1639 changed files with 208299 additions and 257 deletions

19
.gitignore vendored

Some files were not shown because too many files have changed in this diff Show more