Core Contracts

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

`BaseGauge:voteDirection` uses `balanceOf` instead of `getVotingPower`

Summary

RAAC system is designed to use veRAAC token for gauge voting. But instead of the getVotingPower the fixed balanceOf is used in the voteDirection function.

Vulnerability Details

Users can use Basegauge:voteDirection function to vote for the specific direction.

function voteDirection(
uint256 direction
) public whenNotPaused updateReward(msg.sender) {
if (direction > 10000) revert InvalidWeight();
uint256 votingPower = IERC20(IGaugeController(controller).veRAACToken())
.balanceOf(msg.sender); //@audit use getVotingPower()
if (votingPower == 0) revert NoVotingPower();
totalVotes = processVote(
userVotes[msg.sender],
direction,
votingPower,
totalVotes
);
emit DirectionVoted(msg.sender, direction, votingPower);
}

as you can see here, the veRAACToken.balanceOf(msg.sender) is used to get the voting power of the user which is wrong.

The balanceOf function of VeRAAC returns the fixed deposit amount for the user and in voting, we should use a function that accounts for the decays like getVotingPower

Impact

The veRAAC is completely wasted if we are not accounting for power decays when voting.

Recommendation

use veRAAC:getVotingPower instead.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

BaseGauge::_applyBoost, GaugeController::vote, BoostController::calculateBoost use balanceOf() instead of getVotingPower() for vote-escrow tokens, negating time-decay mechanism

Support

FAQs

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

Give us feedback!