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
- Fork the repo and create a branch
git checkout -b fix/dispute-self-vote-rejection
- Implement changes
contracts/predictify-hybrid/src/disputes.rs
contracts/predictify-hybrid/src/err.rs
- 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
Guidelines
require_auth(&voter) must precede the new check
- Minimum 95% coverage
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
DisputeVotingindisputes.rsaccepts a vote from the address that opened the dispute, biasing tallies. Reject anyvote_on_disputecall wherevoter == disputer.Requirements and Context
DisputeManager::vote_on_disputereturningError::DisputerCannotVotedisputes.rsand testsDisputeVoteRejectedEvent(extend events.rs if needed)Suggested Execution
contracts/predictify-hybrid/src/disputes.rscontracts/predictify-hybrid/src/err.rscargo test -p predictify-hybrid dispute -- --nocaptureExample commit message
Acceptance Criteria
DisputerCannotVoteunwrap()introduceddisputes.rsrustdocGuidelines
require_auth(&voter)must precede the new check