The veRAACToken
contract's getVotingPowerForProposal
function relies on a storage mapping proposalPowerSnapshots
to determine voting power at proposal creation time, but this mapping is never updated. This breaks the snapshot mechanism intended to prevent vote manipulation through token transfers after proposal creation.
In voting systems, it's crucial to capture voting power at the time a proposal is created to prevent manipulation through token transfers after the fact. The veRAACToken
contract implements this through proposalPowerSnapshots
mapping:
The issue stems from the fact that while this functionality exists for querying voting power at proposal creation, the proposalPowerSnapshots
mapping is never populated. Looking at the governance flow:
Governance.propose()
creates new proposals
Governance.castVote()
records votes
veRAACToken.getVotingPowerForProposal()
is meant to get historic voting power
The connection between these pieces is broken because:
The Governance
contract doesn't call any function to record the block number when proposals are created
The veRAACToken
contract doesn't expose any function to set snapshot blocks
The proposalPowerSnapshots
mapping remains empty, causing getVotingPowerForProposal
to always revert
This means the system is missing a critical security feature - the ability to get voting power from when the proposal was created rather than current voting power.
Looking at the PowerCheckpoint library used by veRAACToken:
This infrastructure for historical lookups exists but cannot be properly utilized without the snapshot mapping being maintained.
Alice creates a proposal via Governance.propose()
The proposal is created but no snapshot block is recorded
Bob tries to query voting power via veRAACToken.getVotingPowerForProposal()
The call reverts because proposalPowerSnapshots[proposalId]
is 0
The missing snapshot mechanism means:
Voting power cannot be properly determined at proposal creation time
Users can manipulate their voting power after proposals are created
A core security feature of the governance system is non-functional
Manual review
Add a function in veRAACToken to set proposal snapshots:
Modify Governance.propose() to record the snapshot:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.