Skip to content

feat: implement v2 dispute and third-party registration - #81

Merged
collinsezedike merged 1 commit into
mainfrom
feat/v2-dispute-registration
Aug 11, 2026
Merged

feat: implement v2 dispute and third-party registration#81
collinsezedike merged 1 commit into
mainfrom
feat/v2-dispute-registration

Conversation

@collinsezedike

Copy link
Copy Markdown
Collaborator

Summary

Implements #66: dispute() and the third-party registration phase that follows it.

  • New Position record (one address's stake, keyed by (assertion_id, address)) and Resolution record (per-dispute deadlines and the running eligible total W), matching V2_RESOLUTION.md's storage layout: AssertionV2 stays claim/parties/policy, Resolution is the mutable per-dispute state that grows as reveal ([Feature] V2: implement reveal phase and commitment verification #67) and settlement ([Feature] V2: implement settlement and forfeiture distribution #69) land.
  • dispute(disputer, id): rejects disputing your own assertion, creates the two initial Fixed positions (asserter for, disputer against), opens registration with a deadline, transfers the disputer's bond, emits Disputed.
  • register(voter, id, amount, commitment): third-party deposits, salted-commitment-hidden side, aggregating top-ups that can't change their original commitment, atomic rejection if position/total bounds would be exceeded, bounded anti-sniping extension on late deposits.

Two SDK constraints found along the way, both now documented inline for later issues:

Closes #66

Test plan

  • cargo fmt --check, cargo clippy --workspace --all-targets --locked -- -D warnings, cargo test --workspace --locked all pass (67 v1 + 49 v2 + 2 integration-example tests)
  • cargo build -p tholos-v2 --target wasm32v1-none --release --locked succeeds
  • mdbook build succeeds
  • Every new Error variant has a dedicated test triggering it
  • Anti-sniping extension tested both for triggering and for capping at the hard deadline (repeated late deposits from fresh addresses)
  • Token balance assertions confirm bonds and deposits actually move

@collinsezedike
collinsezedike merged commit a892ac4 into main Aug 11, 2026
3 checks passed
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.

[Feature] V2: implement dispute and third-party registration

1 participant