Core Contracts

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

veRAACToken.sol::getVotingPowerForProposal() will always revert with misleading error, since the proposalPowerSnapshots are never set.

Summary

Since proposalPowerSnapshots is never set to anything, it will revert with misleading error that the proposal is invalid.
The proposalId might be correct, but the error is misleading.

Vulnerability Details

Permanent revert with misleading error.
Users could misinterpret the error and assume that the proposalId is wrong, even when it might be correct.

function getVotingPowerForProposal(
address account,
uint256 proposalId
) external view returns (uint256) {
// @audit this will always revert because the snapshot is never set to anything.
uint256 snapshotBlock = proposalPowerSnapshots[proposalId];
if (snapshotBlock == 0) revert InvalidProposal();
return getPastVotes(account, snapshotBlock);
}

Impact

The function always reverts with InvalidProposal(), which users might understand it as invalid proposalId, when in reality the issue is that proposalPowerSnapshots[proposalId] was never set.

Tools Used

Manual

Recommendations

Implement functionality to set the powerSnapShots.

Updates

Lead Judging Commences

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

Give us feedback!