The recordVote
function records that a user has voted on a proposal but does not specify whether the vote is for or against the proposal. This ambiguity makes it impossible to determine the outcome of a vote, rendering the governance system ineffective. The issue arises because the function does not include a parameter to capture the user's voting stance (e.g., "for" or "against").
Affected Code: veRAACToken::recordVote
The recordVote
function currently records only that a user has voted on a proposal, without capturing the direction of the vote (for or against). This design flaw has the following implications:
Ambiguity in Voting Outcomes: The system cannot determine whether a vote supports or opposes a proposal, making it impossible to tally results accurately.
Governance Dysfunction: Proposals cannot be approved or rejected based on user votes, undermining the purpose of the governance system.
Lack of Transparency: Users cannot verify how their votes were counted, leading to mistrust in the governance process.
The function does not include a parameter to specify the user's voting stance (e.g., "for" or "against").
The VoteCast
event emits only the voter's address, proposal ID, and voting power, but not the direction of the vote.
This vulnerability renders the governance system ineffective because it cannot accurately tally votes for or against proposals.
Governance Dysfunction: Proposals cannot be approved or rejected based on user votes, undermining the purpose of the governance system.
Loss of Trust: Users cannot verify how their votes were counted, leading to mistrust in the governance process.
Manual Code Review
To fix this issue, modify the recordVote
function to include a parameter for the user's voting stance (e.g., "for" or "against"). Additionally, update the contract to store and tally votes based on their direction.
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.