Core Contracts

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

Users with zero voting power can vote on proposals

Summary

Users with zero voting power can successfully vote on proposals.

Vulnerability Details

There's a function recordVote inside veRAACToken.sol which records votes for a proposal:

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);
}

As you can see, there is no check to verify if the user has any voting power. The function only checks the voting power after the user has successfully voted, and then it emits the voting power.

Impact

This vulnerability allows users with zero voting power to cast votes, potentially distorting the voting process.

Tools Used

Manual Review

Recommendations

function recordVote(
address voter,
uint256 proposalId
) external {
+ require(getVotingPower(voter) > 0, "no voting power");
if (_hasVotedOnProposal[voter][proposalId]) revert AlreadyVoted();
_hasVotedOnProposal[voter][proposalId] = true;
- uint256 power = getVotingPower(voter);
emit VoteCast(voter, proposalId, power);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 6 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.