Description
Many revenue-share offerings grant voting rights proportional to shares. Add a lightweight propose / cast_vote / tally flow keyed on offering_id, using current holder share BPS as voting weight at proposal-snapshot block.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
Revora-Contracts/src/lib.rs
- Voting weight must be snapshotted at proposal creation, not at vote-cast time
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/governance-voting-hook
- Implement changes
- Add
Proposal { id, offering_id, snapshot_period, end_ts, for_bps, against_bps }
- Add
propose, cast_vote(proposal_id, for_), tally(proposal_id)
- Reject votes from blacklisted holders
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Double-vote attempt must be rejected with
AlreadyVoted
- Include test output and security notes
Example commit message
feat: add governance voting hook weighted by snapshot share BPS
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Many revenue-share offerings grant voting rights proportional to shares. Add a lightweight
propose / cast_vote / tallyflow keyed on offering_id, using current holder share BPS as voting weight at proposal-snapshot block.Requirements and context
Revora-Contracts/src/lib.rsSuggested execution
git checkout -b feat/governance-voting-hookProposal { id, offering_id, snapshot_period, end_ts, for_bps, against_bps }propose,cast_vote(proposal_id, for_),tally(proposal_id)Test and commit
cargo test --allAlreadyVotedExample commit message
feat: add governance voting hook weighted by snapshot share BPSGuidelines