-
Notifications
You must be signed in to change notification settings - Fork 63
Add Delegation & Proxy Functions to Governance Contract #507
Copy link
Copy link
Open
Description
Component: Contracts (Governance) | Effort: 4-5 days | Priority: MEDIUM
Current State
No vote delegation or proxy voting support.
Missing Functions
Delegation functions:
delegate_votes()- Delegate voting power to another addressundelegate_votes()- Remove delegationget_delegate()- Get who user delegated toget_voting_power()- Get total voting power (own + delegated)get_delegators()- Get list of addresses who delegated to user
Why This Matters
- Participation: Users can delegate if they can't vote
- Efficiency: Experts can vote on behalf of others
- Governance: Increases voter participation
- Standard: Most governance systems support delegation
Tasks
- Add delegation storage (delegator -> delegate mapping)
- Implement
delegate_votes()function- Store delegation
- Emit VotesDelegated event
- Add
undelegate_votes()function - Implement
get_voting_power()calculation- Own tokens + delegated tokens
- Add
get_delegate()view function - Implement
get_delegators()view - Update
vote()to use voting power - Add delegation history tracking
- Add tests for delegation scenarios
- Document delegation system
Acceptance Criteria
- Users can delegate voting power
- Voting power calculated correctly
- Delegates can vote with delegated power
- Delegation can be revoked
- Tests cover delegation scenarios
- Documentation explains delegation
Reactions are currently unavailable