The recordVote
function in veRAACToken
contains multiple design flaws that compromise voting integrity, including lack of proposal validation, incorrect voting power calculation, and missing voter eligibility checks.
Missing Voter Eligibility:
No check if voter has any voting power, this allow any one with or without voting power to record their vote
Missing Proposal Registration:
There is no function to register valid proposals
Also, there is no way to set proposal snapshots, only getVotingPowerForProposal
which is use to retrieve voting power for a specific proposal.
Incomplete governance integration
Incorrect Power Calculation:
It uses current power (getVotingPower
) instead of snapshot power to get the available power for the voter.
Invalid Proposal Voting:
There is no validation to check if proposalId exists as the contract lacks mapping/state to track valid proposals, this allow users to record votes for non-existent proposals.
Output:
It will create an unreliable voting history because there is no way to track voting history.
Governance system will be messed up because it allow anyone who either hold or does not hold token to vote.
Votes can be recorded for non-existent proposals which will create invalid governance records
Manual code review
Add Proposal Tracking:
Fix Vote Recording:
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.