Core Contracts

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

The usage of veToken `balanceOf` instead of actual votingPower leads to incorrect gauge reward allocation and unfair reward boost

Summary

Protocol uses the the veRaac token balanceOf() as a measure of an user's voting power. This balance doesn't decay over time, leading to unfair gauge rewards allocation and incorrect users reward boost.

Vulnerability Details

Users can lock Raac tokens to receive veRaac tokens which are used as decaying voting power.
The amount of veRaac tokens minted and initial voting power is given by the following formula:

uint256 initialPower = (amount * duration) / MAX_LOCK_DURATION;

The voting power depends on the amount of locked tokens and on the lock duration.
The voting power decays liniarely to 0 at unlock time.

The protocol uses incorrectly the initial, non decayed voting power by using the veRaacToken.balanceOf in:

Users with expired lock, meaning their voting power is 0, can vote on gauge rewards distribution and to boost their rewards.

Impact

Users will use the non decaying voting power to decide how rewards are split between gauges and to boost their rewards.
Users have no incentive to lock again their Raac tokens.

Tools Used

Recommendations

Consider using getPastVotes(address account, uint256 blockNumber) to get the voting power based on checkpoints.
Each time an user extend thier lock or increase the locked amount, a new checkpoint is created, thus reflecting their latest voting power.

Updates

Lead Judging Commences

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