Skip to content

[Bug] dispute doesn't prevent an asserter from disputing their own assertion #113

Description

@collinsezedike

Summary

dispute (contracts/tholos/src/lib.rs:618-655) requires disputer.require_auth() and checks the assertion is Pending and within the challenge window, but never checks disputer != assertion.asserter. An asserter can call dispute on their own pending assertion, consuming the assertion's one dispute slot and locking out any honest third party who might otherwise have disputed a bad-faith assertion. Because resolve's winner is selected purely from assertion.asserter/assertion.disputer, when disputer == asserter the winner is the same address regardless of the resolver committee's actual vote, guaranteeing both bonds back independent of the truth. This nullifies the bond-forfeiture deterrent that is the entire economic premise of the dispute mechanism.

Scope

  • Add a check in dispute rejecting a caller whose address matches assertion.asserter.
  • Add a new Error::SelfDispute variant.

Proposed approach

if disputer == assertion.asserter {
    return Err(Error::SelfDispute);
}

Placed alongside the existing Pending/challenge-window checks in dispute. Add a test asserting this returns Err(Error::SelfDispute) and doesn't mutate assertion state.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignbugSomething isn't workingeasySmall, low-risk change

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions