Skip to content

Add validation that DisputeVoting voter cannot also be original disputer #616

Description

@greatest0fallt1me

Description

DisputeVoting in disputes.rs accepts a vote from the address that opened the dispute, biasing tallies. Reject any vote_on_dispute call where voter == disputer.

Requirements and Context

  • Add an early check in DisputeManager::vote_on_dispute returning Error::DisputerCannotVote
  • Update disputes.rs and tests
  • Emit DisputeVoteRejectedEvent (extend events.rs if needed)
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b fix/dispute-self-vote-rejection
  2. Implement changes
    • contracts/predictify-hybrid/src/disputes.rs
    • contracts/predictify-hybrid/src/err.rs
  3. Test and commit
    • cargo test -p predictify-hybrid dispute -- --nocapture
    • Cover edge cases: disputer != voter, disputer == voter
    • Include test output and notes in the PR

Example commit message

fix: reject self-vote by dispute opener in DisputeManager

Acceptance Criteria

  • Self-vote test fails with DisputerCannotVote
  • Existing legitimate vote path unchanged
  • No unwrap() introduced
  • Documented in disputes.rs rustdoc

Guidelines

  • require_auth(&voter) must precede the new check
  • Minimum 95% coverage
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GRANTFOX OSSGrantFox open-source campaign taskMAYBE REWARDEDMay be rewarded under the GrantFox campaignOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveIssues in the Stellar wave programrustRust implementationsecuritySecurity hardeningsmart-contractSoroban smart-contract worksorobanSoroban SDK / Stellar

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions