Summary
bond_amount is validated and set once in initialize (contracts/tholos/src/lib.rs:266-282) and read by assert_outcome (lib.rs:586) for every new assertion. There is no function anywhere in contracts/tholos/src/lib.rs that changes it afterward. A deployment that needs to adjust its bond, for example in response to real usage data, a token's price movement, or spam/griefing patterns observed in production, has no on-chain path to do so; the only option is deploying an entirely new contract instance.
This is the same class of gap as the admin-rotation issues (#128/#129), scoped narrowly to just this one parameter.
Scope
- Add a
set_bond_amount(new_bond_amount) function, admin-gated the same way update_resolvers and set_paused already are, validated against the same bounds initialize already enforces (bond_amount > 0, bond_amount <= MAX_BOND_AMOUNT).
- Decided: a bond change applies only to assertions created after the change. No new snapshot field is needed for this:
Assertion.bond (lib.rs:106) already pins the bond amount at creation, and every payout path (dispute at lib.rs:668, finalize at lib.rs:712/735, resolve at lib.rs:801) already reads assertion.bond, never the live DataKey::BondAmount, so this guarantee already holds structurally. Update Assertion.bond's doc comment to state this pinning explicitly (it's currently true only as an implicit consequence of no payout path re-reading DataKey::BondAmount, not stated anywhere), and add a regression test proving a set_bond_amount call doesn't retroactively change an already-open assertion's payout.
- Emit an event on change, and add tests covering the update itself, auth-gating, and bound validation.
Proposed approach
A direct set_bond_amount, gated by admin.require_auth(), reusing initialize's existing bond_amount <= 0 || bond_amount > MAX_BOND_AMOUNT check, writing straight to DataKey::BondAmount. Pair it with the doc-comment update and regression test described above so the pinning guarantee is explicit and tested rather than an unstated accident of the current code.
Summary
bond_amountis validated and set once ininitialize(contracts/tholos/src/lib.rs:266-282) and read byassert_outcome(lib.rs:586) for every new assertion. There is no function anywhere incontracts/tholos/src/lib.rsthat changes it afterward. A deployment that needs to adjust its bond, for example in response to real usage data, a token's price movement, or spam/griefing patterns observed in production, has no on-chain path to do so; the only option is deploying an entirely new contract instance.This is the same class of gap as the admin-rotation issues (#128/#129), scoped narrowly to just this one parameter.
Scope
set_bond_amount(new_bond_amount)function, admin-gated the same wayupdate_resolversandset_pausedalready are, validated against the same boundsinitializealready enforces (bond_amount > 0,bond_amount <= MAX_BOND_AMOUNT).Assertion.bond(lib.rs:106) already pins the bond amount at creation, and every payout path (disputeatlib.rs:668,finalizeatlib.rs:712/735,resolveatlib.rs:801) already readsassertion.bond, never the liveDataKey::BondAmount, so this guarantee already holds structurally. UpdateAssertion.bond's doc comment to state this pinning explicitly (it's currently true only as an implicit consequence of no payout path re-readingDataKey::BondAmount, not stated anywhere), and add a regression test proving aset_bond_amountcall doesn't retroactively change an already-open assertion's payout.Proposed approach
A direct
set_bond_amount, gated byadmin.require_auth(), reusinginitialize's existingbond_amount <= 0 || bond_amount > MAX_BOND_AMOUNTcheck, writing straight toDataKey::BondAmount. Pair it with the doc-comment update and regression test described above so the pinning guarantee is explicit and tested rather than an unstated accident of the current code.