Exercise the settlement example on a local chain - #108
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mdrecords 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 pathfunded → 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_setTimemakes 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 suiteVerification
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