Skip to content

Demo 03 · Stake to Audit

Who pays when reviewed code is exploited?

Auditors bond on the exact functions and code version they reviewed. Seven scenarios were run end to end against the protocol's contracts. Every transaction below is a recorded one, with the token balances before and after it.

Recorded on a local Anvil chain. Valueless test tokens. Fictional auditors. Contracts unaudited.

There is no live chain, no wallet connection and no deployment behind this page. The deploy script refuses any chain except a local one.

  • Recorded data
  • 7scenarios recorded
  • 240transactions recorded
  • 258forge tests passed
  • 10invariants held
  • 0Slither High findings

01Design

Five ideas that shipped.

Each idea is enforced by a contract, not by a promise in a document. Source: ARCHITECTURE.md §2 of the protocol.

  1. 01

    Coverage bound to the code hash

    Each covered function is tied to the code hash of the code that actually runs. If live code stops matching, anyone can call attestChange, and claims for incidents after that block fail at filing. No auditor answers for code they never saw.

    AuditCommitmentRegistry.attestChange · Recorded in Scenario 2 · Changed code is not covered

  2. 02

    Function scope as a Merkle tree

    The scope is a Merkle root of functions, each in a named unit that auditors sign for. A claim must carry a proof that its function is in scope. A proof against a second tree of exclusions rejects the claim with no vote.

    AuditCommitmentRegistry.verifyLeaf, ClaimRegistry.rejectExcluded · Recorded in Scenario 4 · Out-of-scope claim rejected, reservation released

  3. 03

    Paid disclosure before any loss

    An enrolled auditor can commit a hidden, timestamped disclosure, reveal it after the fix, and earn a fixed reward from a budget the protocol funded in advance. The protocol can refuse the reward, but only in public and within a set window.

    RewardsVault.commitDisclosure, revealDisclosure · Recorded in Scenario 3 · No exploit: withdrawal plus reward

  4. 04

    Adjudication that cannot be stalled

    Both sides agree to a roster of five in the signed terms. Members can recuse, each side has a small challenge budget, reserves fill empty seats in a fixed order, and a pre-agreed fallback ends any case the panel cannot decide. One appeal can uphold, reverse or reduce a ruling, never raise it.

    ArbitrationPanel, AppealPanel · Recorded in Scenario 5 · Appeal, Scenario 6 · Conflicted adjudicator replaced

  5. 05

    No platform cut

    No contract has a fee recipient. Bonds stay with auditors unless a final ruling pays a named beneficiary. Rewards and adjudicator fees come from a vault the protocol funds before anyone bonds, and forfeited claim deposits go to the auditors whose capital was held.

    RewardsVault, BondEscrow.withdrawPrincipal · Recorded in Scenario 3 · No exploit: withdrawal plus reward, Scenario 4 · Out-of-scope claim rejected, reservation released

02Recorded run

Seven scenarios, every transaction.

One command deploys the contracts on a local Anvil chain and runs all seven. Each scenario is its own campaign from the same deployment. Amounts are valueless DemoToken units.

Recorded on a local Anvil chain. Valueless test tokens. Fictional auditors. Contracts unaudited.

Scenario 1 · All checks passed

Covered exploit

A real local exploit of the fictional DemoVault flashLoan bug; the claim on the flashLoan leaf is approved and paid from the auditors who signed unit U1.

transactions
30 transactions
time steps
7 time steps
checks passed
28 of 28 checks passed
Evidence file
scenarios/s1-covered-exploit.json sha256 82ff0efe0293…

Balances at the start and end

AccountBefore the first transactionAfter the last transactionChange
BondEscrow024,000+24,000
ClaimRegistry000
RewardsVault09,000+9,000
Protocol000
Claimant/beneficiary011,100+11,100
Auditor A000
Auditor B000
Auditor C000
DemoVault000
Attacker012,000+12,000
Every step (37)
#StepCallTransaction hashBlockBalance before → after
1Protocol creates the campaign (terms hash computed off-chain)createCampaignProtocol → CampaignFactory0xa03cc801…9c3a2015No token balance changed
2Protocol mints valueless DemoToken for the reward, disclosure and adjudication budgetsmintProtocol → DemoToken0x0bf704bf…60250816
  • Protocol 0 → 9,000
3approve 9,000 to 0xaa1b…DA10approveProtocol → DemoToken0xb75ad83e…f09bd717No token balance changed
4Protocol prefunds the RewardsVaultfundProtocol → RewardsVault0x48e7e50a…89ece618
  • RewardsVault 0 → 9,000
  • Protocol 9,000 → 0
5Time stepEnrolment opens19
6Auditor A mints a valueless bondmintAuditor A → DemoToken0x5f466b09…ec441120
  • Auditor A 0 → 5,000
7approve 5,000 to 0x3F37…28B4approveAuditor A → DemoToken0x68b3d04a…bbe3d721No token balance changed
8Auditor A enrols 5,000 on units {U0} with shared liabilityenrolAuditor A → BondEscrow0x0bff76e2…39e58022
  • BondEscrow 0 → 5,000
  • Auditor A 5,000 → 0
9Auditor B mints a valueless bondmintAuditor B → DemoToken0xd8df70b1…1fa41c23
  • Auditor B 0 → 10,000
10approve 10,000 to 0x3F37…28B4approveAuditor B → DemoToken0xdddcad81…96c5a124No token balance changed
11Auditor B enrols 10,000 on units {U0, U1}enrolAuditor B → BondEscrow0xef5ed41e…dc0b4a25
  • BondEscrow 5,000 → 15,000
  • Auditor B 10,000 → 0
12Auditor C mints a valueless bondmintAuditor C → DemoToken0x4089ad2d…9aa87226
  • Auditor C 0 → 20,000
13approve 20,000 to 0x3F37…28B4approveAuditor C → DemoToken0xf61b9834…efc99227No token balance changed
14Auditor C enrols 20,000 on units {U1, U2}enrolAuditor C → BondEscrow0x8f11e9b0…ae509228
  • BondEscrow 15,000 → 35,000
  • Auditor C 20,000 → 0
15Time stepEnrolment ends; coverage starts29
16Anyone activates the campaign (identity re-checked)activateProtocol → AuditCommitmentRegistry0xa1ff751b…a0fa6b30No token balance changed
17Depositor mints valueless DemoTokenmint0x09DB…d55f → DemoToken0x1b7a9edc…81a33731No token balance changed
18approve 12,000 to 0x1309…cBBbapprove0x09DB…d55f → DemoToken0xc7366084…a1179132No token balance changed
19Depositor deposits 12,000 into the fictional DemoVaultdeposit0x09DB…d55f → DemoVault0x8ed48391…dc77f833
  • DemoVault 0 → 12,000
20Time stepOne day of normal operation34
21Attacker deploys DemoExploit (flash-loan repayment bug)constructorAttacker → 0x7e74c3fb…90299735No token balance changed
22Attacker runs DemoExploit.run(): flash loan "repaid" with a deposit (flash-loan repayment bug)runAttacker → 0x538d…e2410x131ec290…c2293336
  • DemoVault 12,000 → 0
  • Attacker 0 → 12,000
23Time stepOne hour later the claimant files37
24Claimant mints the claim depositmintClaimant/beneficiary → DemoToken0x519b94c1…bae01938
  • Claimant/beneficiary 0 → 100
25approve 100 to 0x7B06…F8EaapproveClaimant/beneficiary → DemoToken0x218c9a61…d6734939No token balance changed
26Claimant files a claim on the flashLoan leaf (unit U1) for 12,000fileClaimant/beneficiary → ClaimRegistry0x61a2e4be…f4587340
  • ClaimRegistry 0 → 100
  • Claimant/beneficiary 100 → 0
27Time stepClaim 1: response window ends, voting opens41
28Claim 1 panel: seat 1 votes Approve 12,000castVote0x9965…A4dc → ArbitrationPanel0xf73ba8fb…83ba4742No token balance changed
29Claim 1 panel: seat 2 votes Approve 12,000castVote0x976E…0aa9 → ArbitrationPanel0x549ab56e…cd633943No token balance changed
30Claim 1 panel: seat 3 votes Approve 11,000castVote0x14dC…9955 → ArbitrationPanel0x72f06111…23177f44No token balance changed
31Time stepClaim 1 panel: vote deadline45
32Claim 1 panel: anyone closes votingcloseVotingProtocol → ArbitrationPanel0x37fb447b…b7314846No token balance changed
33Time stepClaim 1: appeal window ends47
34Claim 1: anyone finalises the rulingfinalizeProtocol → ClaimRegistry0x00981421…d6694248No token balance changed
35Claim 1: anyone settles (pays 11,000)settleProtocol → ClaimRegistry0x84720e55…31363249No token balance changed
36Beneficiary withdraws the payout creditwithdrawCreditClaimant/beneficiary → BondEscrow0x27764e22…4ff33a50
  • BondEscrow 35,000 → 24,000
  • Claimant/beneficiary 0 → 11,000
37Claimant withdraws the refunded claim depositwithdrawCreditClaimant/beneficiary → ClaimRegistry0xd2772c3e…8bc89a51
  • ClaimRegistry 100 → 0
  • Claimant/beneficiary 11,000 → 11,100
Checks the run asserted (28 of 28)
  • passterms hash (TypeScript port) equals registry.termsHash()
  • passEIP-712 enrolment digest for A matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for B matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for C matches escrow.enrolmentDigest
  • passphase is Active
  • passexploit flash-loan repayment bug: attacker gained the vault balance
  • passexploit flash-loan repayment bug: DemoVault drained
  • passclaim 1: reservation of A recomputed from headroom (F-21, F-22)
  • passclaim 1: reservation of B recomputed from headroom (F-21, F-22)
  • passclaim 1: reservation of C recomputed from headroom (F-21, F-22)
  • passruling amount is the third-largest approval (C-28)
  • passoutcome Approved
  • passclaim 1: status Settled
  • passclaim 1: paidAmount equals min of all bounds (F-26)
  • passclaim 1: A paid recomputed by waterfall (F-27)
  • passclaim 1: A reservation released
  • passA ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: B paid recomputed by waterfall (F-27)
  • passclaim 1: B reservation released
  • passB ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: C paid recomputed by waterfall (F-27)
  • passclaim 1: C reservation released
  • passC ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: beneficiary credit increase
  • passclaim 1: claim deposit refunded to claimant (CA §8)
  • passBeneficiary withdraws the payout credit: token balance increased by the credit
  • passClaimant withdraws the refunded claim deposit: token balance increased by the credit
  • passescrow holds the remaining principal

Scenario 2 · All checks passed

Changed code is not covered

The protocol upgrades the DemoVault beacon; anyone stamps the drift with attestChange; a claim for an incident after the stamp fails at filing with CodeChanged.

transactions
24 transactions
time steps
4 time steps
expected reverts
2 expected reverts
checks passed
14 of 14 checks passed
Evidence file
scenarios/s2-code-changed.json sha256 183eac833c78…

Balances at the start and end

AccountBefore the first transactionAfter the last transactionChange
BondEscrow035,000+35,000
ClaimRegistry000
RewardsVault09,000+9,000
Protocol000
Claimant/beneficiary11,10011,200+100
Auditor A000
Auditor B000
Auditor C000
DemoVault06,000+6,000
Attacker12,00012,0000
Every step (30)
#StepCallTransaction hashBlockBalance before → after
1Protocol deploys a fresh UpgradeableBeacon for the fictional DemoVaultconstructorProtocol → 0x002d521d…2a1e5a52No token balance changed
2Protocol deploys the fictional DemoVault BeaconProxyconstructorProtocol → 0xdf11b305…1180d953No token balance changed
3Protocol creates the campaign (terms hash computed off-chain)createCampaignProtocol → CampaignFactory0x003dc443…764bd754No token balance changed
4Protocol mints valueless DemoToken for the reward, disclosure and adjudication budgetsmintProtocol → DemoToken0x5600bf43…b63c5e55
  • Protocol 0 → 9,000
5approve 9,000 to 0xF610…eFECapproveProtocol → DemoToken0xac645b28…84d7bf56No token balance changed
6Protocol prefunds the RewardsVaultfundProtocol → RewardsVault0xb6a54c17…8360ea57
  • RewardsVault 0 → 9,000
  • Protocol 9,000 → 0
7Time stepEnrolment opens58
8Auditor A mints a valueless bondmintAuditor A → DemoToken0x64f95c05…0da87259
  • Auditor A 0 → 5,000
9approve 5,000 to 0x4BE7…1963approveAuditor A → DemoToken0x64bafe23…0688ec60No token balance changed
10Auditor A enrols 5,000 on units {U0} with shared liabilityenrolAuditor A → BondEscrow0x6a3c89d7…ecefae61
  • BondEscrow 0 → 5,000
  • Auditor A 5,000 → 0
11Auditor B mints a valueless bondmintAuditor B → DemoToken0x427def09…4d547b62
  • Auditor B 0 → 10,000
12approve 10,000 to 0x4BE7…1963approveAuditor B → DemoToken0x6bbfb453…cddac963No token balance changed
13Auditor B enrols 10,000 on units {U0, U1}enrolAuditor B → BondEscrow0xffcd754c…f83bd864
  • BondEscrow 5,000 → 15,000
  • Auditor B 10,000 → 0
14Auditor C mints a valueless bondmintAuditor C → DemoToken0xab1f6380…16ffaf65
  • Auditor C 0 → 20,000
15approve 20,000 to 0x4BE7…1963approveAuditor C → DemoToken0x3cd2e400…0d729e66No token balance changed
16Auditor C enrols 20,000 on units {U1, U2}enrolAuditor C → BondEscrow0x73553c45…64382c67
  • BondEscrow 15,000 → 35,000
  • Auditor C 20,000 → 0
17Time stepEnrolment ends; coverage starts68
18Anyone activates the campaign (identity re-checked)activateProtocol → AuditCommitmentRegistry0xc1c90ea6…f4a2ab69No token balance changed
19Time stepOne day of coverage70
20Protocol upgrades the beacon to DemoVaultV2 (no fresh auditor consent)upgradeToProtocol → 0x2279…ebe60x520787c3…fa098371No token balance changed
21Anyone calls attestChange(2): the drift block is stampedattestChangeAuditor A → AuditCommitmentRegistry0x7c1c4dfb…e86f4a72No token balance changed
22Depositor mints valueless DemoTokenmint0x09DB…d55f → DemoToken0xc4607933…ae9c1d73No token balance changed
23approve 6,000 to 0x8a79…c318approve0x09DB…d55f → DemoToken0x965faaeb…348e2474No token balance changed
24Depositor deposits 6,000 into the upgraded DemoVaultdeposit0x09DB…d55f → DemoVault0x277dd5a7…c5983c75
  • DemoVault 0 → 6,000
25Attacker deploys DemoExploit against the upgraded vaultconstructorAttacker → 0x58b72132…63c3dd76No token balance changed
26Attacker tries the same exploit on DemoVaultV2Reverted as expected: NotRepaid. The upgraded code tracks deposits made during a loan, so the old exploit no longer works.runAttacker → 0x198c…9f39
27Time stepOne hour later77
28Claimant mints the claim depositmintClaimant/beneficiary → DemoToken0xb517c8fc…c6f46278
  • Claimant/beneficiary 11,100 → 11,200
29approve 100 to 0x61C0…7833approveClaimant/beneficiary → DemoToken0x8a0491ac…cbb2e779No token balance changed
30Claimant files for an incident after the drift stampReverted as expected: CodeChanged. C-07: liability does not follow an upgrade the auditors never reviewed.fileClaimant/beneficiary → ClaimRegistry
Checks the run asserted (14 of 14)
  • passterms hash (TypeScript port) equals registry.termsHash()
  • passEIP-712 enrolment digest for A matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for B matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for C matches escrow.enrolmentDigest
  • passphase is Active
  • passentry 2 (beacon.implementation) no longer matches the signed value
  • passdrift block equals the attestChange receipt block
  • passcoverageEndBlock(0) equals the drift block
  • passexposureOf(flashLoan) reports coverage ending at the drift block
  • passa second attestChange(2) would return false (stamped once)
  • passAttacker tries the same exploit on DemoVaultV2 reverts with NotRepaid
  • passClaimant files for an incident after the drift stamp reverts with CodeChanged
  • passCodeChanged carries the drift block
  • passno reservation was made

Scenario 3 · All checks passed

No exploit: withdrawal plus reward

Auditor C discloses a finding before any loss and earns the fixed disclosure reward; at maturity all three auditors withdraw their full principal and the prefunded reward.

transactions
32 transactions
time steps
7 time steps
checks passed
19 of 19 checks passed
Evidence file
scenarios/s3-withdraw-reward.json sha256 b7a6999e573c…

Balances at the start and end

AccountBefore the first transactionAfter the last transactionChange
BondEscrow000
ClaimRegistry000
RewardsVault000
Protocol05,200+5,200
Claimant/beneficiary11,20011,2000
Auditor A05,400+5,400
Auditor B010,800+10,800
Auditor C022,600+22,600
DemoVault000
Attacker12,00012,0000
Every step (39)
#StepCallTransaction hashBlockBalance before → after
1Protocol deploys a fresh UpgradeableBeacon for the fictional DemoVaultconstructorProtocol → 0x4b04e109…13c37b80No token balance changed
2Protocol deploys the fictional DemoVault BeaconProxyconstructorProtocol → 0x01dded28…b61e9181No token balance changed
3Protocol creates the campaign (terms hash computed off-chain)createCampaignProtocol → CampaignFactory0x61972016…b78f3e82No token balance changed
4Protocol mints valueless DemoToken for the reward, disclosure and adjudication budgetsmintProtocol → DemoToken0x92cc4716…900f8983
  • Protocol 0 → 9,000
5approve 9,000 to 0x7DB4…9514approveProtocol → DemoToken0xfc192683…7255a584No token balance changed
6Protocol prefunds the RewardsVaultfundProtocol → RewardsVault0x29121ff0…7cdbba85
  • RewardsVault 0 → 9,000
  • Protocol 9,000 → 0
7Time stepEnrolment opens86
8Auditor A mints a valueless bondmintAuditor A → DemoToken0xf9a63c94…6242a187
  • Auditor A 0 → 5,000
9approve 5,000 to 0x5a3C…F29BapproveAuditor A → DemoToken0xbe8d9f49…08b0ee88No token balance changed
10Auditor A enrols 5,000 on units {U0} with shared liabilityenrolAuditor A → BondEscrow0x72bb369b…5acbb989
  • BondEscrow 0 → 5,000
  • Auditor A 5,000 → 0
11Auditor B mints a valueless bondmintAuditor B → DemoToken0x822979bd…1427cb90
  • Auditor B 0 → 10,000
12approve 10,000 to 0x5a3C…F29BapproveAuditor B → DemoToken0x152a3279…c745b191No token balance changed
13Auditor B enrols 10,000 on units {U0, U1}enrolAuditor B → BondEscrow0x31e48120…b971f592
  • BondEscrow 5,000 → 15,000
  • Auditor B 10,000 → 0
14Auditor C mints a valueless bondmintAuditor C → DemoToken0xf1f65331…7c893a93
  • Auditor C 0 → 20,000
15approve 20,000 to 0x5a3C…F29BapproveAuditor C → DemoToken0x68cde119…364f4494No token balance changed
16Auditor C enrols 20,000 on units {U1, U2}enrolAuditor C → BondEscrow0x7cf3ccf6…22410195
  • BondEscrow 15,000 → 35,000
  • Auditor C 20,000 → 0
17Time stepEnrolment ends; coverage starts96
18Anyone activates the campaign (identity re-checked)activateProtocol → AuditCommitmentRegistry0x78d78bc0…c3c9ad97No token balance changed
19Time stepTwo days into coverage98
20Auditor C commits a hidden disclosure (the function is not revealed)commitDisclosureAuditor C → RewardsVault0x9552e79b…e5b42499No token balance changed
21Time stepThe protocol ships a fix off-chain100
22Protocol marks the disclosure fixedmarkFixedProtocol → RewardsVault0x912d9495…764179101No token balance changed
23Auditor C reveals the disclosure with a scope proofrevealDisclosureAuditor C → RewardsVault0x659624db…2615ab102No token balance changed
24Time stepAcknowledgement window passes without a rejection103
25Auditor C claims the disclosure rewardclaimDisclosureRewardAuditor C → RewardsVault0x2a8d3895…44df1b104No token balance changed
26Time stepClaim deadline passes with no claims: escrow matures105
27Auditor A withdraws principalwithdrawPrincipalAuditor A → BondEscrow0xa5eb7d32…4298a6106
  • BondEscrow 35,000 → 30,000
  • Auditor A 0 → 5,000
28Auditor A claims the rewardclaimRewardAuditor A → RewardsVault0x8eb6c6f2…7eccbf107No token balance changed
29Auditor A withdraws vault creditswithdrawCreditAuditor A → RewardsVault0x6cac799a…a50ed1108
  • RewardsVault 9,000 → 8,600
  • Auditor A 5,000 → 5,400
30Auditor B withdraws principalwithdrawPrincipalAuditor B → BondEscrow0x18127154…82722a109
  • BondEscrow 30,000 → 20,000
  • Auditor B 0 → 10,000
31Auditor B claims the rewardclaimRewardAuditor B → RewardsVault0x25a778ae…dfc5cf110No token balance changed
32Auditor B withdraws vault creditswithdrawCreditAuditor B → RewardsVault0xaa7abcde…f72c11111
  • RewardsVault 8,600 → 7,800
  • Auditor B 10,000 → 10,800
33Auditor C withdraws principalwithdrawPrincipalAuditor C → BondEscrow0x0e27b7cf…acb7a0112
  • BondEscrow 20,000 → 0
  • Auditor C 0 → 20,000
34Auditor C claims the rewardclaimRewardAuditor C → RewardsVault0xcbfb4be7…f6d7ad113No token balance changed
35Auditor C withdraws vault creditswithdrawCreditAuditor C → RewardsVault0xe224cfa4…c2d50e114
  • RewardsVault 7,800 → 5,200
  • Auditor C 20,000 → 22,600
36Anyone refunds the unused adjudication budget to the protocolrefundUnusedProtocol → RewardsVault0x42b9b086…49ff42115No token balance changed
37Time stepDisclosure close time116
38Anyone refunds the unused disclosure budget to the protocolrefundUnusedProtocol → RewardsVault0x6372104b…f5d8c9117No token balance changed
39Protocol withdraws its unused budgetswithdrawCreditProtocol → RewardsVault0x2768b13e…b4c51a118
  • RewardsVault 5,200 → 0
  • Protocol 0 → 5,200
Checks the run asserted (19 of 19)
  • passterms hash (TypeScript port) equals registry.termsHash()
  • passEIP-712 enrolment digest for A matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for B matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for C matches escrow.enrolmentDigest
  • passphase is Active
  • passdisclosure reward credited to C
  • passescrow matured
  • passA principal returned in full
  • passA reward = original × rewardRateBps / 10,000 (F-32)
  • passA received reward
  • passB principal returned in full
  • passB reward = original × rewardRateBps / 10,000 (F-32)
  • passB received reward
  • passC principal returned in full
  • passC reward = original × rewardRateBps / 10,000 (F-32)
  • passC received reward + disclosure reward
  • passescrow empty after withdrawals
  • passprotocol credit = all budgets − rewards − one disclosure reward
  • passrewards vault empty

Scenario 4 · All checks passed

Out-of-scope claim rejected, reservation released

A function outside the scope tree fails at filing; a claim on the excluded sweep() leaf is rejected by an exclusion proof with no vote; a claim blaming an excluded dependency is rejected by the panel. Reservations are released and the claim deposits go to the reserved auditors.

transactions
36 transactions
time steps
8 time steps
expected reverts
1 expected reverts
checks passed
52 of 52 checks passed
Evidence file
scenarios/s4-out-of-scope.json sha256 d3ef89e2e774…

Balances at the start and end

AccountBefore the first transactionAfter the last transactionChange
BondEscrow035,000+35,000
ClaimRegistry000
RewardsVault09,000+9,000
Protocol5,2005,2000
Claimant/beneficiary11,20011,300+100
Auditor A5,4005,433.333333333333333333+33.333333333333333333
Auditor B10,80010,900+100
Auditor C22,60022,666.666666666666666667+66.666666666666666667
DemoVault000
Attacker12,00012,0000
Every step (45)
#StepCallTransaction hashBlockBalance before → after
1Protocol deploys a fresh UpgradeableBeacon for the fictional DemoVaultconstructorProtocol → 0x97dd7201…e4c96e119No token balance changed
2Protocol deploys the fictional DemoVault BeaconProxyconstructorProtocol → 0x2f77b7cf…d15c97120No token balance changed
3Protocol creates the campaign (terms hash computed off-chain)createCampaignProtocol → CampaignFactory0xfa6ad557…586ae4121No token balance changed
4Protocol mints valueless DemoToken for the reward, disclosure and adjudication budgetsmintProtocol → DemoToken0xea791b36…f9da22122
  • Protocol 5,200 → 14,200
5approve 9,000 to 0xD0f1…46bFapproveProtocol → DemoToken0xabedb218…198a03123No token balance changed
6Protocol prefunds the RewardsVaultfundProtocol → RewardsVault0x3a53ad66…320e21124
  • RewardsVault 0 → 9,000
  • Protocol 14,200 → 5,200
7Time stepEnrolment opens125
8Auditor A mints a valueless bondmintAuditor A → DemoToken0xe0bf12cf…9e0a07126
  • Auditor A 5,400 → 10,400
9approve 5,000 to 0xf7Ec…5D46approveAuditor A → DemoToken0x6f1985e5…7361b1127No token balance changed
10Auditor A enrols 5,000 on units {U0} with shared liabilityenrolAuditor A → BondEscrow0xc3dae101…b62b78128
  • BondEscrow 0 → 5,000
  • Auditor A 10,400 → 5,400
11Auditor B mints a valueless bondmintAuditor B → DemoToken0x075aa92d…2a95f7129
  • Auditor B 10,800 → 20,800
12approve 10,000 to 0xf7Ec…5D46approveAuditor B → DemoToken0xcf3dcae2…417da6130No token balance changed
13Auditor B enrols 10,000 on units {U0, U1}enrolAuditor B → BondEscrow0x16991666…9c4218131
  • BondEscrow 5,000 → 15,000
  • Auditor B 20,800 → 10,800
14Auditor C mints a valueless bondmintAuditor C → DemoToken0x1f2c5d31…d43e2b132
  • Auditor C 22,600 → 42,600
15approve 20,000 to 0xf7Ec…5D46approveAuditor C → DemoToken0xdd9a6a8a…d9cafd133No token balance changed
16Auditor C enrols 20,000 on units {U1, U2}enrolAuditor C → BondEscrow0xbb7e9fc7…d8c225134
  • BondEscrow 15,000 → 35,000
  • Auditor C 42,600 → 22,600
17Time stepEnrolment ends; coverage starts135
18Anyone activates the campaign (identity re-checked)activateProtocol → AuditCommitmentRegistry0x31f48b62…26110a136No token balance changed
19Time stepOne day of coverage137
20Claimant mints a claim depositmintClaimant/beneficiary → DemoToken0x51b02c2c…13a73c138
  • Claimant/beneficiary 11,200 → 11,300
21approve 100 to 0xa1e9…6A15approveClaimant/beneficiary → DemoToken0x74df9a99…93bbd4139No token balance changed
22Claimant files on fee(), a function not in the scope treeReverted as expected: InvalidProof. C-05: no Merkle proof exists for a function outside the signed scope, so the claim never reaches a vote.fileClaimant/beneficiary → ClaimRegistry
23Time stepOne hour later140
24Claimant mints the claim depositmintClaimant/beneficiary → DemoToken0x7d0506df…347791141
  • Claimant/beneficiary 11,300 → 11,400
25approve 100 to 0xa1e9…6A15approveClaimant/beneficiary → DemoToken0xb0e7967f…c233b5142No token balance changed
26Claimant files a claim on the sweep leaf (unit U0) for 3,000fileClaimant/beneficiary → ClaimRegistry0x78b0aa89…c16d07143
  • ClaimRegistry 0 → 100
  • Claimant/beneficiary 11,400 → 11,300
27Anyone proves claim 1's leaf is in the exclusions tree (no vote)rejectExcludedAuditor A → ClaimRegistry0xdec4ee4c…44e357144No token balance changed
28Claim 1: anyone settles (releases reservations)settleProtocol → ClaimRegistry0xcb58b77d…98265a145No token balance changed
29Time stepOne hour later146
30Claimant mints the claim depositmintClaimant/beneficiary → DemoToken0x97d4b0c7…ff4e71147
  • Claimant/beneficiary 11,300 → 11,400
31approve 100 to 0xa1e9…6A15approveClaimant/beneficiary → DemoToken0xdc2e5093…d15b27148No token balance changed
32Claimant files a claim on the flashLoan leaf (unit U1) for 4,000fileClaimant/beneficiary → ClaimRegistry0x594687ce…748f77149
  • ClaimRegistry 100 → 200
  • Claimant/beneficiary 11,400 → 11,300
33Time stepClaim 2: response window ends, voting opens150
34Claim 2 panel: seat 1 votes RejectcastVote0x9965…A4dc → ArbitrationPanel0xee32e2a6…48a5bd151No token balance changed
35Claim 2 panel: seat 2 votes RejectcastVote0x976E…0aa9 → ArbitrationPanel0x4ac37519…431388152No token balance changed
36Claim 2 panel: seat 3 votes RejectcastVote0x14dC…9955 → ArbitrationPanel0xee4212a6…835e84153No token balance changed
37Claim 2 panel: seat 4 votes RejectcastVote0x2361…1E8f → ArbitrationPanel0x76aed33c…5cb52c154No token balance changed
38Time stepClaim 2 panel: vote deadline155
39Claim 2 panel: anyone closes votingcloseVotingProtocol → ArbitrationPanel0x7602f3c8…731bda156No token balance changed
40Time stepClaim 2: appeal window ends157
41Claim 2: anyone finalises the rulingfinalizeProtocol → ClaimRegistry0xef9f55a2…bd2356158No token balance changed
42Claim 2: anyone settles (releases reservations)settleProtocol → ClaimRegistry0x1bde1412…111715159No token balance changed
43Auditor A withdraws its share of the forfeited depositswithdrawCreditAuditor A → ClaimRegistry0xe0d03151…d3a035160
  • ClaimRegistry 200 → 166.666666666666666667
  • Auditor A 5,400 → 5,433.333333333333333333
44Auditor B withdraws its share of the forfeited depositswithdrawCreditAuditor B → ClaimRegistry0x63b20b24…c32373161
  • ClaimRegistry 166.666666666666666667 → 66.666666666666666667
  • Auditor B 10,800 → 10,900
45Auditor C withdraws its share of the forfeited depositswithdrawCreditAuditor C → ClaimRegistry0xc8bc5cc0…d65cf9162
  • ClaimRegistry 66.666666666666666667 → 0
  • Auditor C 22,600 → 22,666.666666666666666667
Checks the run asserted (52 of 52)
  • passterms hash (TypeScript port) equals registry.termsHash()
  • passEIP-712 enrolment digest for A matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for B matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for C matches escrow.enrolmentDigest
  • passphase is Active
  • passClaimant files on fee(), a function not in the scope tree reverts with InvalidProof
  • passnothing reserved after the failed filing
  • passclaim 1: reservation of A recomputed from headroom (F-21, F-22)
  • passclaim 1: reservation of B recomputed from headroom (F-21, F-22)
  • passclaim 1: reservation of C recomputed from headroom (F-21, F-22)
  • passclaim 1: registry.isExcluded(sweep leaf) is true
  • passclaim 1: Final, Rejected, source ExclusionProof
  • passclaim 1: status Settled
  • passclaim 1: paidAmount equals min of all bounds (F-26)
  • passclaim 1: A paid recomputed by waterfall (F-27)
  • passclaim 1: A reservation released
  • passA ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: B paid recomputed by waterfall (F-27)
  • passclaim 1: B reservation released
  • passB ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: C paid recomputed by waterfall (F-27)
  • passclaim 1: C reservation released
  • passC ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: beneficiary credit increase
  • passclaim 1: A share of the forfeited claim deposit (allocate by reservation)
  • passclaim 1: B share of the forfeited claim deposit (allocate by reservation)
  • passclaim 1: C share of the forfeited claim deposit (allocate by reservation)
  • passclaim 2: reservation of A recomputed from headroom (F-21, F-22)
  • passclaim 2: reservation of B recomputed from headroom (F-21, F-22)
  • passclaim 2: reservation of C recomputed from headroom (F-21, F-22)
  • passclaim 2: panel rejected
  • passclaim 2: status Settled
  • passclaim 2: paidAmount equals min of all bounds (F-26)
  • passclaim 2: A paid recomputed by waterfall (F-27)
  • passclaim 2: A reservation released
  • passA ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 2: B paid recomputed by waterfall (F-27)
  • passclaim 2: B reservation released
  • passB ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 2: C paid recomputed by waterfall (F-27)
  • passclaim 2: C reservation released
  • passC ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 2: beneficiary credit increase
  • passclaim 2: A share of the forfeited claim deposit (allocate by reservation)
  • passclaim 2: B share of the forfeited claim deposit (allocate by reservation)
  • passclaim 2: C share of the forfeited claim deposit (allocate by reservation)
  • passall reservations released
  • passno principal paid out
  • passAuditor A withdraws its share of the forfeited deposits: token balance increased by the credit
  • passAuditor B withdraws its share of the forfeited deposits: token balance increased by the credit
  • passAuditor C withdraws its share of the forfeited deposits: token balance increased by the credit
  • passClaimRegistry holds no deposits

Scenario 5 · All checks passed

Appeal

The panel approves 11,000; auditor B appeals; the appeal panel reduces the amount; settlement pays the reduced amount and refunds B's appeal deposit.

transactions
38 transactions
time steps
8 time steps
checks passed
31 of 31 checks passed
Evidence file
scenarios/s5-appeal-reduce.json sha256 c3567c16e8ec…

Balances at the start and end

AccountBefore the first transactionAfter the last transactionChange
BondEscrow027,000+27,000
ClaimRegistry000
RewardsVault09,000+9,000
Protocol5,2005,2000
Claimant/beneficiary11,30019,400+8,100
Auditor A5,433.3333333333333333335,433.3333333333333333330
Auditor B10,90011,100+200
Auditor C22,666.66666666666666666722,666.6666666666666666670
DemoVault000
Attacker12,00024,000+12,000
Every step (46)
#StepCallTransaction hashBlockBalance before → after
1Protocol deploys a fresh UpgradeableBeacon for the fictional DemoVaultconstructorProtocol → 0x63e481f3…c0e2d3163No token balance changed
2Protocol deploys the fictional DemoVault BeaconProxyconstructorProtocol → 0xa5753569…8e546c164No token balance changed
3Protocol creates the campaign (terms hash computed off-chain)createCampaignProtocol → CampaignFactory0x43662a4d…eec0f1165No token balance changed
4Protocol mints valueless DemoToken for the reward, disclosure and adjudication budgetsmintProtocol → DemoToken0x81a2962e…49f245166
  • Protocol 5,200 → 14,200
5approve 9,000 to 0xbbe4…4994approveProtocol → DemoToken0x0496026d…430d00167No token balance changed
6Protocol prefunds the RewardsVaultfundProtocol → RewardsVault0x29aa4637…58c46a168
  • RewardsVault 0 → 9,000
  • Protocol 14,200 → 5,200
7Time stepEnrolment opens169
8Auditor A mints a valueless bondmintAuditor A → DemoToken0xc8ea6649…d5073a170
  • Auditor A 5,433.333333333333333333 → 10,433.333333333333333333
9approve 5,000 to 0x4c72…1Df3approveAuditor A → DemoToken0xf4724b84…589152171No token balance changed
10Auditor A enrols 5,000 on units {U0} with shared liabilityenrolAuditor A → BondEscrow0xfa02146c…67b588172
  • BondEscrow 0 → 5,000
  • Auditor A 10,433.333333333333333333 → 5,433.333333333333333333
11Auditor B mints a valueless bondmintAuditor B → DemoToken0x964781e5…12f38a173
  • Auditor B 10,900 → 20,900
12approve 10,000 to 0x4c72…1Df3approveAuditor B → DemoToken0xba888902…d68fd2174No token balance changed
13Auditor B enrols 10,000 on units {U0, U1}enrolAuditor B → BondEscrow0x0f4f7174…d24fc0175
  • BondEscrow 5,000 → 15,000
  • Auditor B 20,900 → 10,900
14Auditor C mints a valueless bondmintAuditor C → DemoToken0x30659d0e…c56563176
  • Auditor C 22,666.666666666666666667 → 42,666.666666666666666667
15approve 20,000 to 0x4c72…1Df3approveAuditor C → DemoToken0x138280f9…770b95177No token balance changed
16Auditor C enrols 20,000 on units {U1, U2}enrolAuditor C → BondEscrow0xea51d8cc…026191178
  • BondEscrow 15,000 → 35,000
  • Auditor C 42,666.666666666666666667 → 22,666.666666666666666667
17Time stepEnrolment ends; coverage starts179
18Anyone activates the campaign (identity re-checked)activateProtocol → AuditCommitmentRegistry0x231cc2c7…94f7e1180No token balance changed
19Depositor mints valueless DemoTokenmint0x09DB…d55f → DemoToken0x05479549…c78f97181No token balance changed
20approve 12,000 to 0x998a…613eapprove0x09DB…d55f → DemoToken0x2645dcf2…d4839c182No token balance changed
21Depositor deposits 12,000 into the fictional DemoVaultdeposit0x09DB…d55f → DemoVault0x46faa25e…141075183
  • DemoVault 0 → 12,000
22Time stepOne day of normal operation184
23Attacker deploys DemoExploit (flash-loan repayment bug)constructorAttacker → 0x909615e6…71f10b185No token balance changed
24Attacker runs DemoExploit.run(): flash loan "repaid" with a deposit (flash-loan repayment bug)runAttacker → 0x7016…b49f0x6df1e6e8…8d64ff186
  • DemoVault 12,000 → 0
  • Attacker 12,000 → 24,000
25Time stepOne hour later the claimant files187
26Claimant mints the claim depositmintClaimant/beneficiary → DemoToken0xefeb9254…cdf3c8188
  • Claimant/beneficiary 11,300 → 11,400
27approve 100 to 0xF6b0…2C0capproveClaimant/beneficiary → DemoToken0x5997ba63…671de6189No token balance changed
28Claimant files a claim on the flashLoan leaf (unit U1) for 12,000fileClaimant/beneficiary → ClaimRegistry0x91886f9f…8a6baa190
  • ClaimRegistry 0 → 100
  • Claimant/beneficiary 11,400 → 11,300
29Time stepClaim 1: response window ends, voting opens191
30Claim 1 panel: seat 1 votes Approve 12,000castVote0x9965…A4dc → ArbitrationPanel0x0b3a2dfc…20b785192No token balance changed
31Claim 1 panel: seat 2 votes Approve 12,000castVote0x976E…0aa9 → ArbitrationPanel0xc6a9462f…60aba7193No token balance changed
32Claim 1 panel: seat 3 votes Approve 11,000castVote0x14dC…9955 → ArbitrationPanel0xc507f318…b2a083194No token balance changed
33Time stepClaim 1 panel: vote deadline195
34Claim 1 panel: anyone closes votingcloseVotingProtocol → ArbitrationPanel0x51c402f6…c0b4de196No token balance changed
35Auditor B mints the appeal depositmintAuditor B → DemoToken0x8cf13714…986c82197
  • Auditor B 10,900 → 11,100
36approve 200 to 0xF6b0…2C0capproveAuditor B → DemoToken0xc71ccc6e…91c604198No token balance changed
37Auditor B appeals the 11,000 approvalappealAuditor B → ClaimRegistry0x9f166123…3a2571199
  • ClaimRegistry 100 → 300
  • Auditor B 11,100 → 10,900
38Time stepAppeal voting opens200
39Claim 1 appeal panel: seat 1 votes Reduce 9,000castVote0xFABB…694a → AppealPanel0xded881e3…201aac201No token balance changed
40Claim 1 appeal panel: seat 2 votes Reduce 8,000castVote0x1CBd…C9Ec → AppealPanel0xfb061c4a…449836202No token balance changed
41Time stepClaim 1 appeal panel: vote deadline203
42Claim 1 appeal panel: anyone closes votingcloseVotingProtocol → AppealPanel0x88e11324…b3ed54204No token balance changed
43Claim 1: anyone settles (pays 8,000)settleProtocol → ClaimRegistry0x579467af…d05080205No token balance changed
44Beneficiary withdraws the payout creditwithdrawCreditClaimant/beneficiary → BondEscrow0x26d64653…dce56c206
  • BondEscrow 35,000 → 27,000
  • Claimant/beneficiary 11,300 → 19,300
45Auditor B withdraws the refunded appeal depositwithdrawCreditAuditor B → ClaimRegistry0xafc0ade8…b05e7b207
  • ClaimRegistry 300 → 100
  • Auditor B 10,900 → 11,100
46Claimant withdraws the refunded claim depositwithdrawCreditClaimant/beneficiary → ClaimRegistry0xdea3098d…79d3a0208
  • ClaimRegistry 100 → 0
  • Claimant/beneficiary 19,300 → 19,400
Checks the run asserted (31 of 31)
  • passterms hash (TypeScript port) equals registry.termsHash()
  • passEIP-712 enrolment digest for A matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for B matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for C matches escrow.enrolmentDigest
  • passphase is Active
  • passexploit flash-loan repayment bug: attacker gained the vault balance
  • passexploit flash-loan repayment bug: DemoVault drained
  • passclaim 1: reservation of A recomputed from headroom (F-21, F-22)
  • passclaim 1: reservation of B recomputed from headroom (F-21, F-22)
  • passclaim 1: reservation of C recomputed from headroom (F-21, F-22)
  • passstatus Appealed
  • passappeal result: second-largest Reduce amount (C-34)
  • passstatus Final after the appeal ruling
  • passclaim 1: status Settled
  • passclaim 1: paidAmount equals min of all bounds (F-26)
  • passclaim 1: A paid recomputed by waterfall (F-27)
  • passclaim 1: A reservation released
  • passA ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: B paid recomputed by waterfall (F-27)
  • passclaim 1: B reservation released
  • passB ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: C paid recomputed by waterfall (F-27)
  • passclaim 1: C reservation released
  • passC ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: beneficiary credit increase
  • passclaim 1: claim deposit refunded to claimant (CA §8)
  • passpayout equals the reduced amount
  • passappeal deposit refunded to B after a Reduce (CA §8)
  • passBeneficiary withdraws the payout credit: token balance increased by the credit
  • passAuditor B withdraws the refunded appeal deposit: token balance increased by the credit
  • passClaimant withdraws the refunded claim deposit: token balance increased by the credit

Scenario 6 · All checks passed

Conflicted adjudicator replaced

One seated adjudicator recuses and the auditor side challenges another; the first two reserves take the seats deterministically and the vote proceeds with five ballots.

transactions
35 transactions
time steps
6 time steps
expected reverts
1 expected reverts
checks passed
36 of 36 checks passed
Evidence file
scenarios/s6-replacement.json sha256 8a3daf2ca2cb…

Balances at the start and end

AccountBefore the first transactionAfter the last transactionChange
BondEscrow026,000+26,000
ClaimRegistry0100+100
RewardsVault09,000+9,000
Protocol5,2005,2000
Claimant/beneficiary19,40028,400+9,000
Auditor A5,433.3333333333333333335,433.3333333333333333330
Auditor B11,10011,1000
Auditor C22,666.66666666666666666722,666.6666666666666666670
DemoVault000
Attacker24,00034,000+10,000
Every step (42)
#StepCallTransaction hashBlockBalance before → after
1Protocol deploys a fresh UpgradeableBeacon for the fictional DemoVaultconstructorProtocol → 0xf610a19b…63b513209No token balance changed
2Protocol deploys the fictional DemoVault BeaconProxyconstructorProtocol → 0x31041a51…c95f59210No token balance changed
3Protocol creates the campaign (terms hash computed off-chain)createCampaignProtocol → CampaignFactory0x31aceb32…47d791211No token balance changed
4Protocol mints valueless DemoToken for the reward, disclosure and adjudication budgetsmintProtocol → DemoToken0x9d3caf22…f96051212
  • Protocol 5,200 → 14,200
5approve 9,000 to 0x46a3…F079approveProtocol → DemoToken0xf4bcf01d…a5cdba213No token balance changed
6Protocol prefunds the RewardsVaultfundProtocol → RewardsVault0x460b3b16…bc5e42214
  • RewardsVault 0 → 9,000
  • Protocol 14,200 → 5,200
7Time stepEnrolment opens215
8Auditor A mints a valueless bondmintAuditor A → DemoToken0x55bdf121…7867a3216
  • Auditor A 5,433.333333333333333333 → 10,433.333333333333333333
9approve 5,000 to 0xeaD3…Bb8fapproveAuditor A → DemoToken0x57a5318f…89e98c217No token balance changed
10Auditor A enrols 5,000 on units {U0} with shared liabilityenrolAuditor A → BondEscrow0xc6bebc79…bf50ed218
  • BondEscrow 0 → 5,000
  • Auditor A 10,433.333333333333333333 → 5,433.333333333333333333
11Auditor B mints a valueless bondmintAuditor B → DemoToken0x4f44faec…60a4d3219
  • Auditor B 11,100 → 21,100
12approve 10,000 to 0xeaD3…Bb8fapproveAuditor B → DemoToken0x499978de…7b10b8220No token balance changed
13Auditor B enrols 10,000 on units {U0, U1}enrolAuditor B → BondEscrow0xfc0e3429…b0964b221
  • BondEscrow 5,000 → 15,000
  • Auditor B 21,100 → 11,100
14Auditor C mints a valueless bondmintAuditor C → DemoToken0x0a8a878c…c8124c222
  • Auditor C 22,666.666666666666666667 → 42,666.666666666666666667
15approve 20,000 to 0xeaD3…Bb8fapproveAuditor C → DemoToken0xdb16df73…edf5f9223No token balance changed
16Auditor C enrols 20,000 on units {U1, U2}enrolAuditor C → BondEscrow0x13eac817…a1ebe5224
  • BondEscrow 15,000 → 35,000
  • Auditor C 42,666.666666666666666667 → 22,666.666666666666666667
17Time stepEnrolment ends; coverage starts225
18Anyone activates the campaign (identity re-checked)activateProtocol → AuditCommitmentRegistry0x6032017e…b7e6bc226No token balance changed
19Depositor mints valueless DemoTokenmint0x09DB…d55f → DemoToken0xd8574520…3a28cb227No token balance changed
20approve 10,000 to 0x4c58…8029approve0x09DB…d55f → DemoToken0xd9d8a1da…1efde0228No token balance changed
21Depositor deposits 10,000 into the fictional DemoVaultdeposit0x09DB…d55f → DemoVault0xb4311bef…7b5dd3229
  • DemoVault 0 → 10,000
22Time stepOne day of normal operation230
23Attacker deploys DemoExploit (flash-loan repayment bug)constructorAttacker → 0xcfba50e3…83c00a231No token balance changed
24Attacker runs DemoExploit.run(): flash loan "repaid" with a deposit (flash-loan repayment bug)runAttacker → 0x71ef…8f6a0xa61a0298…bb5f76232
  • DemoVault 10,000 → 0
  • Attacker 24,000 → 34,000
25Time stepOne hour later the claimant files233
26Claimant mints the claim depositmintClaimant/beneficiary → DemoToken0x311169e8…e26eaf234
  • Claimant/beneficiary 19,400 → 19,500
27approve 100 to 0x9087…769dapproveClaimant/beneficiary → DemoToken0xc6a115a2…478e59235No token balance changed
28Claimant files a claim on the flashLoan leaf (unit U1) for 10,000fileClaimant/beneficiary → ClaimRegistry0x307231fd…55e7c0236
  • ClaimRegistry 0 → 100
  • Claimant/beneficiary 19,500 → 19,400
29Seat 1 recuses (declares a conflict)recuse0x9965…A4dc → ArbitrationPanel0x86de9392…891c28237No token balance changed
30Auditor B challenges seat 2 with conflict evidence (auditor side budget: 1)challengeAuditor B → ArbitrationPanel0x47c1682a…012914238No token balance changed
31Auditor C tries a second auditor-side challengeReverted as expected: ChallengeBudgetExhausted. C-25: the auditor side shares one challenge per case, so auditors cannot empty the panel.challengeAuditor C → ArbitrationPanel
32Time stepClaim 1: response window ends, voting opens239
33Claim 1 panel: seat 1 votes Approve 10,000castVote0x14dC…9955 → ArbitrationPanel0x592f6337…cbd6d3240No token balance changed
34Claim 1 panel: seat 2 votes Approve 9,500castVote0x2361…1E8f → ArbitrationPanel0x234a8197…69a73c241No token balance changed
35Claim 1 panel: seat 3 votes Approve 9,000castVote0xa0Ee…9720 → ArbitrationPanel0x08ce710c…92e2ad242No token balance changed
36Claim 1 panel: seat 4 votes Approve 9,000castVote0xBcd4…4096 → ArbitrationPanel0xca4f3d85…61fabb243No token balance changed
37Claim 1 panel: seat 5 votes Approve 8,500castVote0x71bE…5788 → ArbitrationPanel0xa190d5d5…bd3e06244No token balance changed
38Claim 1 panel (all five voted): anyone closes votingcloseVotingProtocol → ArbitrationPanel0x9323be0f…f8a7a1245No token balance changed
39Time stepClaim 1: appeal window ends246
40Claim 1: anyone finalises the rulingfinalizeProtocol → ClaimRegistry0x0625604d…26e138247No token balance changed
41Claim 1: anyone settles (pays 9,000)settleProtocol → ClaimRegistry0xb1c41cdf…da35db248No token balance changed
42Beneficiary withdraws the payout creditwithdrawCreditClaimant/beneficiary → BondEscrow0x4d2f215c…5b76d1249
  • BondEscrow 35,000 → 26,000
  • Claimant/beneficiary 19,400 → 28,400
Checks the run asserted (36 of 36)
  • passterms hash (TypeScript port) equals registry.termsHash()
  • passEIP-712 enrolment digest for A matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for B matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for C matches escrow.enrolmentDigest
  • passphase is Active
  • passexploit flash-loan repayment bug: attacker gained the vault balance
  • passexploit flash-loan repayment bug: DemoVault drained
  • passclaim 1: reservation of A recomputed from headroom (F-21, F-22)
  • passclaim 1: reservation of B recomputed from headroom (F-21, F-22)
  • passclaim 1: reservation of C recomputed from headroom (F-21, F-22)
  • passinitial seats are roster 1..5
  • passAuditor C tries a second auditor-side challenge reverts with ChallengeBudgetExhausted
  • passfive seats filled
  • passreserve R1 seated
  • passreserve R2 seated
  • passrecused and challenged members no longer seated
  • passruling = third-largest of five approvals
  • passfee credited to 0x14dC…9955 for one ballot (F-38)
  • passfee credited to 0x2361…1E8f for one ballot (F-38)
  • passfee credited to 0xa0Ee…9720 for one ballot (F-38)
  • passfee credited to 0xBcd4…4096 for one ballot (F-38)
  • passfee credited to 0x71bE…5788 for one ballot (F-38)
  • passclaim 1: status Settled
  • passclaim 1: paidAmount equals min of all bounds (F-26)
  • passclaim 1: A paid recomputed by waterfall (F-27)
  • passclaim 1: A reservation released
  • passA ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: B paid recomputed by waterfall (F-27)
  • passclaim 1: B reservation released
  • passB ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: C paid recomputed by waterfall (F-27)
  • passclaim 1: C reservation released
  • passC ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: beneficiary credit increase
  • passclaim 1: claim deposit refunded to claimant (CA §8)
  • passBeneficiary withdraws the payout credit: token balance increased by the credit

Scenario 7 · All checks passed

Two claims compete for limited capital

Two exploits, two claims on unit U1. The first reserves within the claim limit; the second gets the remaining primary headroom and then A's shared layer. Both settle and every ledger reconciles.

transactions
45 transactions
time steps
12 time steps
checks passed
50 of 50 checks passed
Evidence file
scenarios/s7-competing-claims.json sha256 bce2cc827d53…

Balances at the start and end

AccountBefore the first transactionAfter the last transactionChange
BondEscrow017,500+17,500
ClaimRegistry0200+200
RewardsVault09,000+9,000
Protocol5,2005,2000
Claimant/beneficiary28,40045,900+17,500
Auditor A5,433.3333333333333333335,433.3333333333333333330
Auditor B11,10011,1000
Auditor C22,666.66666666666666666722,666.6666666666666666670
DemoVault000
Attacker34,00052,000+18,000
Every step (57)
#StepCallTransaction hashBlockBalance before → after
1Protocol deploys a fresh UpgradeableBeacon for the fictional DemoVaultconstructorProtocol → 0x87fc62f5…b9a75d250No token balance changed
2Protocol deploys the fictional DemoVault BeaconProxyconstructorProtocol → 0x510d3540…6ee264251No token balance changed
3Protocol creates the campaign (terms hash computed off-chain)createCampaignProtocol → CampaignFactory0x1a938952…b01ec5252No token balance changed
4Protocol mints valueless DemoToken for the reward, disclosure and adjudication budgetsmintProtocol → DemoToken0xe5d5f1f5…a42fb8253
  • Protocol 5,200 → 14,200
5approve 9,000 to 0x9138…1700approveProtocol → DemoToken0x852584a2…4e1a6a254No token balance changed
6Protocol prefunds the RewardsVaultfundProtocol → RewardsVault0x1f7cb0d6…91f600255
  • RewardsVault 0 → 9,000
  • Protocol 14,200 → 5,200
7Time stepEnrolment opens256
8Auditor A mints a valueless bondmintAuditor A → DemoToken0xd1e3d260…ae15d7257
  • Auditor A 5,433.333333333333333333 → 10,433.333333333333333333
9approve 5,000 to 0xA946…75c2approveAuditor A → DemoToken0xca054f26…7a71ca258No token balance changed
10Auditor A enrols 5,000 on units {U0} with shared liabilityenrolAuditor A → BondEscrow0x4cddb35c…d1ecf0259
  • BondEscrow 0 → 5,000
  • Auditor A 10,433.333333333333333333 → 5,433.333333333333333333
11Auditor B mints a valueless bondmintAuditor B → DemoToken0xb284b525…1e068f260
  • Auditor B 11,100 → 21,100
12approve 10,000 to 0xA946…75c2approveAuditor B → DemoToken0x177cf69e…7d6f24261No token balance changed
13Auditor B enrols 10,000 on units {U0, U1}enrolAuditor B → BondEscrow0xf61d1f12…0dbeb0262
  • BondEscrow 5,000 → 15,000
  • Auditor B 21,100 → 11,100
14Auditor C mints a valueless bondmintAuditor C → DemoToken0x551c1118…87fe5b263
  • Auditor C 22,666.666666666666666667 → 42,666.666666666666666667
15approve 20,000 to 0xA946…75c2approveAuditor C → DemoToken0x8d1007e1…9bee0a264No token balance changed
16Auditor C enrols 20,000 on units {U1, U2}enrolAuditor C → BondEscrow0x6a1bd2b3…2ecb32265
  • BondEscrow 15,000 → 35,000
  • Auditor C 42,666.666666666666666667 → 22,666.666666666666666667
17Time stepEnrolment ends; coverage starts266
18Anyone activates the campaign (identity re-checked)activateProtocol → AuditCommitmentRegistry0x293f5a32…ab1643267No token balance changed
19Depositor mints valueless DemoTokenmint0x09DB…d55f → DemoToken0xddbc563f…4c9ee0268No token balance changed
20approve 12,000 to 0xfd47…47a3approve0x09DB…d55f → DemoToken0x12e91629…51ac96269No token balance changed
21Depositor deposits 12,000 into the fictional DemoVaultdeposit0x09DB…d55f → DemoVault0xc6e4f318…97ef17270
  • DemoVault 0 → 12,000
22Time stepOne day of normal operation271
23Attacker deploys DemoExploit (exploit 1)constructorAttacker → 0x9f4636fd…3082bc272No token balance changed
24Attacker runs DemoExploit.run(): flash loan "repaid" with a deposit (exploit 1)runAttacker → 0x40cc…876a0x251a3359…3431ed273
  • DemoVault 12,000 → 0
  • Attacker 34,000 → 46,000
25Time stepOne hour later the claimant files274
26Claimant mints the claim depositmintClaimant/beneficiary → DemoToken0x959b8f5c…8cdd46275
  • Claimant/beneficiary 28,400 → 28,500
27approve 100 to 0xa1D6…7aB6approveClaimant/beneficiary → DemoToken0xf7d1d4d6…d778f6276No token balance changed
28Claimant files a claim on the flashLoan leaf (unit U1) for 12,000fileClaimant/beneficiary → ClaimRegistry0x6d252017…751c8c277
  • ClaimRegistry 0 → 100
  • Claimant/beneficiary 28,500 → 28,400
29Depositor mints valueless DemoTokenmint0x09DB…d55f → DemoToken0x674c31be…ef5932278No token balance changed
30approve 6,000 to 0xfd47…47a3approve0x09DB…d55f → DemoToken0x231095a3…c9e32e279No token balance changed
31Depositor deposits 6,000 into the fictional DemoVaultdeposit0x09DB…d55f → DemoVault0xaca27b39…61d592280
  • DemoVault 0 → 6,000
32Time stepOne day of normal operation281
33Attacker deploys DemoExploit (exploit 2)constructorAttacker → 0x7f2f4aaf…208ec3282No token balance changed
34Attacker runs DemoExploit.run(): flash loan "repaid" with a deposit (exploit 2)runAttacker → 0x5b15…5acd0x13c48b92…e8809e283
  • DemoVault 6,000 → 0
  • Attacker 46,000 → 52,000
35Time stepOne hour later the claimant files284
36Claimant mints the claim depositmintClaimant/beneficiary → DemoToken0x32126412…95e835285
  • Claimant/beneficiary 28,400 → 28,500
37approve 100 to 0xa1D6…7aB6approveClaimant/beneficiary → DemoToken0x28740d4d…7e0d11286No token balance changed
38Claimant files a claim on the flashLoan leaf (unit U1) for 6,000fileClaimant/beneficiary → ClaimRegistry0x31fba797…2cbd79287
  • ClaimRegistry 100 → 200
  • Claimant/beneficiary 28,500 → 28,400
39Time stepClaim 1: response window ends, voting opens288
40Claim 1 panel: seat 1 votes Approve 12,000castVote0x9965…A4dc → ArbitrationPanel0x6027689e…f147a2289No token balance changed
41Claim 1 panel: seat 2 votes Approve 12,000castVote0x976E…0aa9 → ArbitrationPanel0x6e050d95…5859a0290No token balance changed
42Claim 1 panel: seat 3 votes Approve 12,000castVote0x14dC…9955 → ArbitrationPanel0x8f0f8c83…aa2bf7291No token balance changed
43Time stepClaim 2: response window ends, voting opens292
44Claim 2 panel: seat 1 votes Approve 5,500castVote0x9965…A4dc → ArbitrationPanel0xf25a92f5…680488293No token balance changed
45Claim 2 panel: seat 2 votes Approve 5,500castVote0x976E…0aa9 → ArbitrationPanel0xda4a591f…2be702294No token balance changed
46Claim 2 panel: seat 3 votes Approve 5,500castVote0x14dC…9955 → ArbitrationPanel0x08657594…b6f6f6295No token balance changed
47Time stepClaim 1 panel: vote deadline296
48Claim 1 panel: anyone closes votingcloseVotingProtocol → ArbitrationPanel0x62332895…8a3266297No token balance changed
49Time stepClaim 2 panel: vote deadline298
50Claim 2 panel: anyone closes votingcloseVotingProtocol → ArbitrationPanel0x313f2798…bec346299No token balance changed
51Time stepClaim 1: appeal window ends300
52Claim 1: anyone finalises the rulingfinalizeProtocol → ClaimRegistry0xef83a430…ce0142301No token balance changed
53Time stepClaim 2: appeal window ends302
54Claim 2: anyone finalises the rulingfinalizeProtocol → ClaimRegistry0xa421624a…32c9a3303No token balance changed
55Claim 1: anyone settles (pays 12,000)settleProtocol → ClaimRegistry0xb9787c4d…9ee527304No token balance changed
56Claim 2: anyone settles (pays 5,500)settleProtocol → ClaimRegistry0x9a676595…ebff2e305No token balance changed
57Beneficiary withdraws both payoutswithdrawCreditClaimant/beneficiary → BondEscrow0xd66ee313…3ff15e306
  • BondEscrow 35,000 → 17,500
  • Claimant/beneficiary 28,400 → 45,900
Checks the run asserted (50 of 50)
  • passterms hash (TypeScript port) equals registry.termsHash()
  • passEIP-712 enrolment digest for A matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for B matches escrow.enrolmentDigest
  • passEIP-712 enrolment digest for C matches escrow.enrolmentDigest
  • passphase is Active
  • passexploit exploit 1: attacker gained the vault balance
  • passexploit exploit 1: DemoVault drained
  • passclaim 1: reservation of A recomputed from headroom (F-21, F-22)
  • passclaim 1: reservation of B recomputed from headroom (F-21, F-22)
  • passclaim 1: reservation of C recomputed from headroom (F-21, F-22)
  • passexploit exploit 2: attacker gained the vault balance
  • passexploit exploit 2: DemoVault drained
  • passclaim 2: reservation of A recomputed from headroom (F-21, F-22)
  • passclaim 2: reservation of B recomputed from headroom (F-21, F-22)
  • passclaim 2: reservation of C recomputed from headroom (F-21, F-22)
  • passclaim 2: A reserved through its opt-in shared layer
  • passclaim 2: maxApprovable = its reservation
  • passclaim 1: status Settled
  • passclaim 1: paidAmount equals min of all bounds (F-26)
  • passclaim 1: A paid recomputed by waterfall (F-27)
  • passclaim 1: A reservation released
  • passA ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: B paid recomputed by waterfall (F-27)
  • passclaim 1: B reservation released
  • passB ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: C paid recomputed by waterfall (F-27)
  • passclaim 1: C reservation released
  • passC ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 1: beneficiary credit increase
  • passclaim 1: claim deposit refunded to claimant (CA §8)
  • passclaim 2: status Settled
  • passclaim 2: paidAmount equals min of all bounds (F-26)
  • passclaim 2: A paid recomputed by waterfall (F-27)
  • passclaim 2: A reservation released
  • passA ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 2: B paid recomputed by waterfall (F-27)
  • passclaim 2: B reservation released
  • passB ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 2: C paid recomputed by waterfall (F-27)
  • passclaim 2: C reservation released
  • passC ledger reconciles (available + reserved + paid + withdrawn = deposited)
  • passclaim 2: beneficiary credit increase
  • passclaim 2: claim deposit refunded to claimant (CA §8)
  • passtotal paid = both payouts
  • passtotal paid ≤ aggregate cap
  • passA paid ≤ limit
  • passB paid ≤ limit
  • passC paid ≤ limit
  • passBeneficiary withdraws both payouts: token balance increased by the credit
  • passescrow balance = deposited − paid

03Contracts

Eight contracts and what each enforces.

Read from DESIGN_RATIONALE.md of the protocol: why each contract exists, and for every function who may call it, what it does, which rule it enforces and which alternative was rejected.

  1. CampaignFactory

    Exists to create isolated, immutable campaigns from versioned implementations, and to be the only place with administrative power, which is limited to the future.

    T-30 · T-03 · T-15 · T-26 · F-02 · T-25 · T-08 · D-01

    12 functions
    FunctionCallerWhat and whyEnforcesRejected alternative
    constructor(owner, guardian)deployerFixes roles; refuses chains other than Anvil and Sepolia.T-30Runtime chain flag (could be flipped).
    registerVersion(set)ownerAppends an implementation set. Existing versions are never edited, so existing campaigns cannot change.T-03, T-15Upgradeable implementations (would change live rules).
    setTokenAllowed(token, allowed)ownerAllowlist for new campaigns only.T-26, F-02Any token (fee-on-transfer and rebasing break accounting); per-campaign allowlist edits (would affect live campaigns).
    setGuardian(guardian)ownerNames who can pause new deposits.T-25No pause at all (no response to a discovered bug in a new version).
    pauseNew(duration)guardianStops creation and new deposits for ≤ 7 days, with cooldown.T-25Pausing withdrawals or claims (a pause would become a lock or a claim denial).
    unpause()guardianEnds a pause early; reverts InvalidParam("notPaused") when nothing is paused. The cooldown runs from the actual end (D-41).T-25
    isPausedNew()anyone (view)Read by escrows before deposits.T-25
    createCampaign(...)anyone; caller becomes the protocolValidates terms, clones six contracts and initialises them atomically, checks the declared terms hash.F-02, T-08, D-01Two-step deploy-then-initialise (front-running initialize); mutable draft terms (auditors could sign one draft and be bound by another).
    getCampaign(id), campaignCount()anyone (view)Discovery.
    getVersion(v), versionCount(), predictClone(v, id, kind)anyone (view)Implementation sets and the deterministic clone address of each campaign contract before creation (salt keccak256(abi.encode(id, kind))).D-01
    tokenAllowed, guardian, pausedUntil, lastPauseEnd, MAX_PAUSE, MAX_SOURCE_URI, PAUSE_COOLDOWNanyone (view)Public state and limits of the admin powers.T-25, F-02
    transferOwnership, acceptOwnership, renounceOwnership, owner, pendingOwnerowner / pending ownerOpenZeppelin Ownable2Step. The owner's powers reach only future campaigns (new versions, allowlist, guardian), so a transfer or renouncement cannot touch any campaign (ADV-13).T-15Single-step transfer (a typo hands the role to an unusable address).
  2. AuditCommitmentRegistry

    Exists to be the single, immutable statement of what was reviewed and under which terms, and to switch coverage off when the reviewed code changes. Holds no funds.

    T-08 · ADV-16 · T-02 · T-05 · ADV-05 · C-07 · ADV-06 · T-01 · ADV-01 · C-19 · A-03 · C-22

    8 functions
    FunctionCallerWhat and whyEnforcesRejected alternative
    initialize(...)factory, onceStores terms, computes the terms hash, observes every identity entry. A campaign cannot be created for code that already differs from its commitment.T-08, ADV-16, T-02Trusting declared codehashes without observing them.
    activate()anyoneEnds enrolment: checks participation, vault funding and identity. Drift before activation, or any stamp made during enrolment, cancels and refunds (D-33). StaticCall probes run with a gas guard (ACTIVATION_PROBE_GAS), so only a probe that fails with full gas counts as drift (D-32).T-02, T-05, ADV-05Automatic activation on first claim (would let the claimant choose the timing); stamping drift found at activation (the time of change is unknown, so coverage never reliably started).
    attestChange(entry)anyoneStamps the first observed mismatch of one identity entry and returns true only in that call (D-36). Coverage for incidents at or after the stamp ends.T-02, C-07, ADV-05, ADV-06Reading EIP-1967 slots (impossible on-chain without proofs, U-01); a keeper or oracle role (a trusted party who could stamp falsely); automatic penalty or cancellation on change (would erase claims for earlier incidents).
    observe(entry)anyone (view)Lets anyone see what the contract would compare.T-05
    coverageEndBlock(addrIndex)anyone (view)First drift block that ends coverage for an address.C-07
    verifyLeaf(leaf, proof)anyone (view)Proves a function is in scope for the reviewed code version.T-01, ADV-01Storing selector lists on-chain (costly, no per-auditor units); free-text scope (the source of disputes).
    isExcluded(leafHash, proof)anyone (view)Proves a leaf is explicitly excluded.T-01, C-19Non-membership proofs for plain Merkle trees (not possible without sorted trees and adjacency proofs; more complex for the same result).
    getters (terms, termsHash, phase, claimDeadline, coverageStart, tClaim, createdBlock, activatedAt, activatedBlock, panel, appealPanel, isRosterMember, coveredCount, coveredAt, identityCount, identityAt, driftBlock, driftTime, TERMS_TYPEHASH, ACTIVATION_PROBE_GAS)anyone (view)Transparency for auditors before signing and for the demo; isRosterMember is the C-22 check used by the escrow.A-03, C-22
  3. BondEscrow

    Exists to hold each campaign's principal with explicit ledgers, so that only signed consent creates liability and only final rulings move capital.

    ARCH §7 · T-07 · T-19 · F-10 · INV-09 · T-03 · F-20..F-23 · T-10 · ADV-09 · INV-10 · F-23 · F-26..F-28 · INV-03 · INV-04 · F-29 · T-18 · ADV-17 · INV-08 · T-17 · ADV-15 · Added idea 6 · INV-02

    12 functions
    FunctionCallerWhat and whyEnforcesRejected alternative
    initialize(id, siblings)factory, onceBinds the clone to its campaign and copies the terms (every clone has the same initialize; D-37).ARCH §7Separate deploy and initialise transactions (front-running).
    enrol(e, sig)anyone (relayer) with the auditor's EIP-712 / ERC-1271 signatureRecords the auditor's own units and shared-liability choice and takes the bond from the signer (the only transferFrom whose from is not msg.sender; the signature covers campaign, terms hash, amount, nonce and deadline).T-07, T-19, F-10, INV-09msg.sender-only enrolment without signatures (no portable proof of consent; no contract wallets); party-declared conflict masks at enrolment (let an auditor block the panel, T-11).
    topUp(t, sig)anyone with signatureAdds principal during enrolment under the same terms.F-10, T-03Top-ups after activation (would change exposure mid-term without the other side's view).
    reserveFor(claimId, unit, target)own ClaimRegistryHolds capital for a claim at filing, primary layer first. Stores the consent-based L1/L2 sets (D-34) and clamps to the aggregate cap left (D-35).F-20..F-23, T-10, ADV-09, INV-10Computing shares only at settlement (two claims could both count the same capital).
    refreshReservation(claimId, target)own ClaimRegistryAdds capital freed by other claims.F-23Re-reserving automatically on every release (unbounded loops over claims).
    settleClaim(claimId, payout, mask, recipient)own ClaimRegistryWaterfall payout, release of the rest, credit to the beneficiary.F-26..F-28, INV-03, INV-04Paying the full claim from whoever has capital (forced shared liability, T-19).
    releaseClaim(claimId)own ClaimRegistryReleases everything for rejected or expired claims.F-29
    withdrawPrincipal(to)auditorReturns free principal after maturity or cancellation.T-18, ADV-17, INV-08Withdrawal at coverage end (claims in the tail would find no capital); admin-released withdrawal (an admin path).
    withdrawCredit(to)credit holderPull payment of payouts to any address the holder chooses.T-17, ADV-15Push transfer at settlement.
    exposureOf(leaf, proof)anyone (view)Shows who stands behind a function now and whether its code drifted.Added idea 6An off-chain index only (not verifiable by a wallet).
    headroomOf, positionOf, isMatured, reservationOf, reservedOfMask, claimReservation, nonces, usedDigest, auditorCount, auditorAt, credits, totals (totalDeposited, totalAvailable, totalReserved, totalPaid, totalWithdrawn, totalCredits, totalCreditWithdrawn)anyone (view)Transparency, the invariant checks and the demo. positionOf shows live original/limit until the lazy activation freeze (D-27).INV-02, INV-04, INV-09
    enrolmentDigest, topUpDigest, domainSeparator, eip712Domain, ENROLMENT_TYPEHASH, TOPUP_TYPEHASHanyone (view)Lets wallets and relayers build exactly the digest the escrow checks.T-07
  4. ClaimRegistry

    Exists to run each claim through bounded, permissionless steps so that no claim can be paid without a quorum ruling and none can be held open forever.

    ARCH §7 · C-01..C-11 · T-01 · T-02 · T-09 · C-12 · ADV-20 · C-13 · C-16 · C-17 · F-23 · C-19 · C-26 · T-14 · ADV-12 · INV-06 · C-30 · ADV-10 · C-31 · T-12 · C-33 · C-34 · C-35 · ADV-11 · C-36 · C-37 · INV-03 · INV-07 · T-17 · INV-08 · F-16 · C-27 · ADV-04

    19 functions
    FunctionCallerWhat and whyEnforcesRejected alternative
    initialize(id, siblings)factory, onceAs for the escrow.ARCH §7
    file(args)claimantMechanical checks first (scope, version, window, drift, duplicates), then reservation, case opening, and the deposit pull last.C-01..C-11, T-01, T-02, T-09Open filing by anyone (spam and griefing of reservations); filing with exploit details on-chain (helps copycats).
    provideEvidence(claimId, hash)claimantLets a claimant meet the filing deadline before the evidence bundle is final.C-12, ADV-20Requiring evidence at filing (pushes claimants to file incomplete bundles).
    expireEvidence(claimId)anyoneEnds claims that never got evidence.C-13
    addEvidence(claimId, hash)claimant or affected auditorPublic record of supplementary evidence.C-16
    respond(claimId, hash)affected auditorGuarantees the auditor's right to answer before any vote.C-17
    refreshReservation(claimId)anyoneLets a later claim use freed capital.F-23
    rejectExcluded(claimId, proof)anyoneRejects explicitly excluded claims without a vote.C-19, T-01Leaving exclusions to the panel (wastes a case on a mechanical question).
    onVotingStarted(claimId)own ArbitrationPanelStatus bookkeeping.C-26
    recordRuling(...)own ArbitrationPanelThe only first-instance path to Approved/Rejected.T-14, ADV-12, INV-06
    onStalled(claimId)own ArbitrationPanelApplies the pre-agreed fallback.C-30, ADV-10Indefinite waiting.
    appeal(claimId, hash)affected auditor (against approval) or claimant (against rejection)One bounded appeal with a deposit.C-31, T-12Appeals by the protocol or a platform (unilateral power).
    recordAppealRuling(...)own AppealPanelThe only path from Appealed to Final.C-33, C-34, T-14
    onAppealStalled(claimId)own AppealPanelApplies the pre-agreed appeal timeout.C-35, ADV-11
    finalize(claimId)anyoneMakes an unappealed ruling final after the window.C-36, ADV-12Auto-finalising inside settle (blurs the audit trail of statuses the spec requires).
    settle(claimId)anyoneExecutes the final ruling once.C-37, INV-03, INV-07Settlement by the claimant only (could delay release of auditors' capital).
    withdrawCredit(to)credit holderPull payment of deposit refunds and forfeits.T-17
    views (getClaim, openClaims, claimCount, isParty, incidentUsed, credits, heldDeposits, totalCredits, totalCreditWithdrawn)anyoneTransparency; maturity check; F-16.INV-08, F-16
    maxApprovable(claimId, mask)anyone (view)The C-27 bound both panels validate ballots against: min(claimedLoss − otherRecovery, claimLimit, reserved − reservedOf(mask)).C-27, T-12, ADV-04
  5. ArbitrationPanel

    Exists so that a decision is always reached by a fixed, consented roster, or the claim ends by a pre-agreed rule, and so that no party can stall it.

    ARCH §7 · C-20 · C-24 · C-25 · T-11 · ADV-03 · C-23 · C-27 · T-12 · T-29 · C-28 · C-30 · ADV-10 · INV-06

    7 functions
    FunctionCallerWhat and whyEnforcesRejected alternative
    initialize(id, siblings)factory, onceCopies the terms and the roster from the registry.ARCH §7
    openCase(claimId)own ClaimRegistrySeats the first five roster members. Round-1 times follow the claim's response deadline (caseOf reports them).C-20Random selection (no secure on-chain randomness; harder to audit).
    challenge(claimId, member, hash)party, budget per sideRemoves a member a party objects to, with evidence on record.C-24, C-25, T-11, ADV-03Unlimited challenges (blocks the panel); on-chain judgement of conflicts (impossible).
    recuse(claimId, reason)roster memberA member's own conflict is always respected.C-23
    castVote(...)seated memberReasoned, bounded ballot; fee credited regardless of ballot.C-27, T-12, T-29Simple yes/no with amount fixed at filing (no partial approval); fees as a share of the payout (outcome-dependent pay).
    closeVoting(claimId)anyoneTally with the "largest amount a quorum supports" rule, replacement round (now + voteExtension, D-39), fallback; stalls at once when fewer seats than the quorum are filled (D-42).C-28, C-30, ADV-10Average or median amount (one extreme ballot moves the result); closing at the first 3 matching ballots (lets a fast majority shut out the remaining members' amounts).
    views (seatedOf, ballotOf, caseOf, roster)anyoneSeating and ballots are public.INV-06
  6. AppealPanel

    Exists as a separate authority that can uphold, reverse or reduce, never exceed, and that ends by a pre-agreed rule.

    ARCH §7 · C-32 · C-30 · C-24 · C-23 · C-33 · C-34 · C-35 · ADV-11 · INV-06

    6 functions
    FunctionCallerWhat and whyEnforcesRejected alternative
    initialize(id, siblings)factory, onceCopies the terms and the appeal roster.ARCH §7
    openAppeal(claimId, mode)own ClaimRegistrySeats the appeal roster; escalation mode for stalled panels.C-32, C-30Same roster as the panel (no independent check).
    challenge, recuseparty / memberAs in the panel.C-24, C-23
    castVote(...)seated memberBallots bounded by signed limits and, on an auditor's appeal, by the first-instance amount.C-33Appeal panel able to raise amounts on an auditor's appeal (punishes appealing).
    closeVoting(claimId)anyoneTally with quorum 2, extension, timeout rule.C-34, C-35, ADV-11Infinite appeal (no finality).
    views (seatedOf, ballotOf, caseOf, roster)anyoneAs in the panel.INV-06
  7. SettlementEnginelibrary

    Exists so that all money arithmetic is pure, small and fuzzable in isolation.

    F-26 · F-12 · F-25 · INV-02 · F-22 · F-27 · T-19 · C-28

    5 functions
    FunctionWhat and whyEnforcesRejected alternative
    boundPayout(approved, eligibleLoss, claimLimit, reservedNonExcluded, aggregateRemaining)Minimum of all five F-26 bounds (D-29).F-26Spreading bound checks across contracts.
    headroomFree liability per auditor.F-12
    allocateLargest-remainder pro-rata with deterministic ties; exact sums.F-25, INV-02Floor-only (leaves dust unallocated and payout short); "last auditor gets the remainder" (biases against one auditor, can exceed their weight).
    waterfallPrimary layer first, shared layer only for the remainder.F-22, F-27, T-19Pro-rata across all auditors (forces shared liability).
    kthLargestRuling amount rule.C-28
  8. RewardsVault

    Exists to keep every non-principal payment (rewards, disclosure rewards, adjudicator fees) in a separate, prefunded contract with fixed formulas.

    ARCH §7 · F-31 · F-32 · F-33 · F-37 · F-39 · C-39 · T-23 · F-35 · T-22 · F-36 · A-10 · C-41 · F-38 · T-29 · T-17 · F-17 · INV-01

    14 functions
    FunctionCallerWhat and whyEnforcesRejected alternative
    initialize(id, siblings)factory, onceAs for the escrow.ARCH §7
    fund()protocolPrefunds all budgets before anyone bonds; accepted from creation until enrolEnd (D-40).F-31Paying rewards later from protocol revenue (auditors would bond on a promise).
    isFunded()anyone (view)Enrolment gate.F-31
    claimReward(to)auditorFixed reward on the original bond at maturity.F-32, F-33Reward reduced by payouts (makes reporting an incident costlier for the auditor).
    refundUnused()anyoneReturns unused budgets to the protocol under fixed rules; reverts NothingToWithdraw when it credits nothing (D-42).F-32, F-37, F-39Admin sweep (an admin path).
    commitDisclosure(c)enrolled auditorHidden, timestamped disclosure.C-39, T-23Public disclosure at commit (leaks the bug location).
    markFixed(id)protocolAllows early reveal after a fix.F-35
    revealDisclosure(...)committing auditorProves the leaf and the auditor's unit after embargo, fix or open claim.F-35, T-22
    rejectDisclosure(id, reason)protocolPublic refusal of the reward within the window.F-36, A-10Panel review of every disclosure (expensive for small rewards).
    claimDisclosureReward(id, to)committing auditorAuto-accepted reward after the window.F-36Reward only on explicit protocol approval (silent refusal).
    hasPriorDisclosure(...)anyone (view)Safe-harbour precondition for ballots.C-41, T-22Automatic immunity by leaf match (gameable).
    creditAdjudicator(member)own panelsFixed fee per ballot.F-38, T-29Fee from the claim deposit or the payout (outcome-dependent).
    withdrawCredit(to)credit holderPull payments.T-17
    views (disclosureOf, credits, rewardOf, rewardClaimed, disclosuresBy, disclosureCount, funded, fundedTotal, buckets rewardFree, rewardCommitted, disclosureFree, disclosureReserved, adjudicationFree, totalCredits, totalCreditWithdrawn, flags rewardsCommitted, cancelRefunded, disclosuresClosed)anyoneF-17 is checkable from these alone. Every state-changing call first runs the lazy activation commit or cancellation refund (D-27).F-17, INV-01

Rule IDs: T threat model, F financial spec, C claims and appeals, INV invariants, D implementation decisions.

04Tests

Test results, read from the report files.

Every number in this section is parsed from the files named next to it. These are the author's own tests, not an independent review.

Foundry tests
258 passed, 0 failed
12 suites, including 9 fuzz tests. Source: reports/forge-test.json.
Invariants
10 of 10 held
One invariant campaign: 256 runs, 16,384 random calls, 0 handler reverts. Source: reports/junit.xml and reports/forge-test.json.
JUnit cases
267 cases, 0 failures
JUnit lists each invariant function as its own case, so it counts more cases than forge test. Source: reports/junit.xml.
Slither
0 High
Slither 0.11.6 on 52 contracts with 102 detectors: 72 results, 22 Medium, 44 Low, 6 Informational after two annotated false positives. Source: slither.txt and IMPLEMENTATION_STATUS.md §5.

Invariant functions

  • pass invariant_INV01_OwedNeverExceedsAssets
  • pass invariant_INV02_PaidRemainingReservedEqualsDeposited
  • pass invariant_INV03_NoDoublePay
  • pass invariant_INV04_NoAuditorAboveLimit
  • pass invariant_INV05_NoCrossCampaignSpend
  • pass invariant_INV06_NoUnauthorisedSettle
  • pass invariant_INV07_SettledNeverReturnsToPending
  • pass invariant_INV09_NoSignatureUsedTwice
  • pass invariant_INV10_AggregateCap
  • pass invariant_INV11_PerClaimBound

Report files and their SHA-256

  • stake-to-audit/reports/forge-test.jsone5d5006a4f6557611441858c24a4ae80fe3ee853e8780f2491552e04eb27daf8
  • stake-to-audit/reports/junit.xml5aa0079c96d6c1f8c123ede139eaa9c4a1ee1fd0f67f46503b83f7b98f168dda
  • run-evidence/slither.txt5ac45c7496981189ec34521f61164516726484ac81c9194a257289761e476aab
  • stake-to-audit/docs/IMPLEMENTATION_STATUS.mde0eafb1fe2475bfc83a2eb9456e6f55fa0ec1f845ec96549e3bf9baaea26d7e9

05Verify

Check the files yourself.

The files below are the ones this page reads, served as they are. Each SHA-256 is pinned in the site's evidence release.

Contracts at commit 09e0579 of the Stake to Audit repository. The repository is not public yet.

FileSHA-256Copied from
scenarios/s1-covered-exploit.json82ff0efe0293d59ff4fb399b55f99511bd6a0cfdef2e5504854966c5c8837020run-evidence/s1-covered-exploit.json
scenarios/s2-code-changed.json183eac833c787431526736993c6ede19b2dd0e735852ef08596230f006fe8ce3run-evidence/s2-code-changed.json
scenarios/s3-withdraw-reward.jsonb7a6999e573cde4cded4abcff84203609e5e41e72e3a5f43ad436dfcd5455646run-evidence/s3-withdraw-reward.json
scenarios/s4-out-of-scope.jsond3ef89e2e774b067a1ce9d622ae5c2154204a42a512d02edb0e4c258a1f5a8aarun-evidence/s4-out-of-scope.json
scenarios/s5-appeal-reduce.jsonc3567c16e8ec03f47f1bb84e023a76d77350d7199c9b7c38b0b9eb37d94eab1brun-evidence/s5-appeal-reduce.json
scenarios/s6-replacement.json8a3daf2ca2cbad40cacd326e244dae3a65e13ee08f774fcf7f8e4897f00e5a97run-evidence/s6-replacement.json
scenarios/s7-competing-claims.jsonbce2cc827d53617d131a7abba91d66a93c836fe363d507f08e315a7c34c1bc92run-evidence/s7-competing-claims.json
test-results.v1.json37d74c2dc63ec595f3dd80f871ed15a33d0c4ddd8cd264ae25279b5776648690Derived from the report files
contracts.v1.jsonb249563403d3ec63d84d1f303b16c69135a9ff8b928191183e1e8bbb6b503e5eDerived from the report files

Recorded on a local Anvil chain. Valueless test tokens. Fictional auditors. Contracts unaudited.