Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: high
Invalid

Ambiguous Voting Mechanism in `recordVote` Function

Summary

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


Vulnerability Details

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:

  1. Ambiguity in Voting Outcomes: The system cannot determine whether a vote supports or opposes a proposal, making it impossible to tally results accurately.

  2. Governance Dysfunction: Proposals cannot be approved or rejected based on user votes, undermining the purpose of the governance system.

  3. Lack of Transparency: Users cannot verify how their votes were counted, leading to mistrust in the governance process.

Code Snippet

function recordVote(address voter, uint256 proposalId) external {
if (_hasVotedOnProposal[voter][proposalId]) revert AlreadyVoted();
_hasVotedOnProposal[voter][proposalId] = true;
uint256 power = getVotingPower(voter);
emit VoteCast(voter, proposalId, power);
}

Issue:

  • 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.


Impact

  • 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.


Tools Used

  • Manual Code Review


Recommendations

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.

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.