Core Contracts

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

In `GaugeController:vote` , `getVotingPower` should be used instead of veRAAC balance.

Summary

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

Vulnerability Details

user can use GaugeController:vote function to vote for the specific gauge.

function vote(
address gauge,
uint256 weight
) external override whenNotPaused {
if (!isGauge(gauge)) revert GaugeNotFound();
if (weight > WEIGHT_PRECISION) revert InvalidWeight();
-> uint256 votingPower = veRAACToken.balanceOf(msg.sender); // should use `getVotingPower`
if (votingPower == 0) revert NoVotingPower();
uint256 oldWeight = userGaugeVotes[msg.sender][gauge];
userGaugeVotes[msg.sender][gauge] = weight;
_updateGaugeWeight(gauge, oldWeight, weight, votingPower);
emit WeightUpdated(gauge, oldWeight, weight);
}

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!