Skip to content

Exercise the settlement example on a local chain - #108

Merged
ClaudiuSchuster merged 2 commits into
mainfrom
oss-oo/local-chain-settlement
Sep 18, 2026
Merged

ClaudiuSchuster merged 2 commits into
mainfrom
oss-oo/local-chain-settlement

Conversation

@ClaudiuSchuster

@ClaudiuSchuster ClaudiuSchuster commented Sep 18, 2026

Copy link
Copy Markdown
Member

What

New follow-through slice after the closed stage 06 first slice: the local-chain settlement exercise — the step between the synthetic model and any separately authorized testnet.

The idea: one suite, two backends

The walkthrough suite so far proved the state machine against a Python mirror. This slice runs the same paths against real EVM execution of the exact bytecode the pinned solc 0.8.37 produces from the committed generator output, on a local Anvil simulation chain — a compiler-like local tool: no external network, no faucets, no wallets, world-famous dev keys that can never hold value. The design-note boundary (no testnet, no real funds) stays intact; docs/settlement-local-chain.md records the design plus the later testnet gate (configuration-only swap, behind the published threat-model checklist).

Changes

  • docs/settlement-local-chain.md: design note + the two-backend table (local chain now / testnet behind its own gate)
  • design/solidity-lab/settlement-anvil-agreement.json: synthetic agreement with Anvil's deterministic dev accounts (EIP-55 checksummed)
  • scripts/test-settlement-anvil.py: per-scenario fresh deployment (the same isolation a real testnet would need), then real transactions for the happy path funded → delivered → accepted → released, role reverts asserting the contract's named failures on-chain (NotHolder, WrongState, NotContributor, NotCoordinator), the review deadline (DeadlinePassed, dispute path stays open), the dispute window (DisputeWindowStillOpen → refund after), outer-deadline refund, and cancellation. evm_setTime makes every timeout deterministic. Skips cleanly when Foundry or the pinned compiler is unavailable.
  • scripts/solidity-lab.py: address validation accepts mixed-case hex so checksummed agreements compile (committed pairs unchanged, verified byte-identical by CI)
  • .github/workflows/repository-checks.yml: installs the exact Foundry v1.8.3 release tarball (version matching the locally verified run) and runs the suite

Verification

  • python3 scripts/test-settlement-anvil.py — 7/7 locally with Foundry 1.8.3 (real chain)
  • python3 scripts/test-solidity-lab.py — 19/19, python3 scripts/test-qa-model.py — 18/18
  • baseline + boundary — pass

New follow-through slice after the stage 06 first slice: run the
committed, pinned FairSettlement example against a local Anvil
simulation chain — the step between the synthetic model and any
separately authorized testnet. docs/settlement-local-chain.md records
the design note and the one-suite-two-backends idea: the later testnet
exercise should reuse this suite by changing configuration only, behind
the published threat-model gate. scripts/test-settlement-anvil.py
deploys a fresh instance per scenario, drives the happy path, role
reverts, the review deadline (never a silent release), the dispute
window fallback and the outer-deadline refund with real transactions,
asserting the contract's named failures on-chain; evm_setTime keeps the
timeouts deterministic. Generator address validation now accepts mixed-
case hex so EIP-55 checksummed agreements compile (the committed pairs
are unchanged). CI installs Foundry via the pinned toolchain action.
The toolchain action startup-failed in CI; a plain download of the
exact v1.8.3 release tarball (matching the locally verified version)
keeps the pin explicit and stays within the repository's existing
action allowlist.
@ClaudiuSchuster
ClaudiuSchuster merged commit 3b885d0 into main Sep 18, 2026
5 checks passed
@ClaudiuSchuster
ClaudiuSchuster deleted the oss-oo/local-chain-settlement branch September 18, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant