Skip to content

feat: dispute resolution flow with payout freeze (#129)#249

Open
Jemiiah wants to merge 1 commit intoNetwalls:mainfrom
rejoicetukura-blip:feat/dispute-resolution-flow
Open

feat: dispute resolution flow with payout freeze (#129)#249
Jemiiah wants to merge 1 commit intoNetwalls:mainfrom
rejoicetukura-blip:feat/dispute-resolution-flow

Conversation

@Jemiiah
Copy link
Contributor

@Jemiiah Jemiiah commented Feb 26, 2026

Summary

  • Add resolve_dispute function — creator-only endpoint to uphold (→ CANCELLED + refund stake) or dismiss (→ RESOLVED, stake kept) a dispute
  • Freeze payouts during disputesclaim_winnings now panics with "Market has active dispute - payouts frozen" when market is in DISPUTED state
  • Add DisputeResolvedEvent — emits market_id, upheld, and timestamp on resolution
  • Add 5 new contract tests covering upheld/dismissed resolution, payout freeze, post-dismiss claims, and unauthorized access

Closes #129

Test plan

  • test_resolve_dispute_upheld — dispute upheld → state = CANCELLED, stake refunded
  • test_resolve_dispute_dismissed — dispute dismissed → state = RESOLVED, stake kept
  • test_claim_winnings_frozen_during_dispute — claim panics during active dispute
  • test_claim_winnings_after_dispute_dismissed — claim succeeds after dispute dismissed
  • test_resolve_dispute_unauthorized — non-creator cannot resolve disputes
  • All 42 existing market tests still pass

…Netwalls#129)

Add dispute resolution flow: resolve_dispute (creator-only) to uphold or
dismiss disputes, freeze claim_winnings during DISPUTED state, and 5 new
contract tests covering the full dispute lifecycle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

[Testing] Contract tests for dispute flow

1 participant