Core Contracts

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

Missing MAX_REWARD_RATE Check Can Lead to Overflow or Excessive Rewards

Summary

The function notifyReward does not implement a check enforce that the rewardRate does not exceed the MAX_REWARD_RATE which will result in an integer overflow and unintended reward distribution

Vulnerability Details

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/governance/gauges/BaseGauge.sol#L369-L392

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/governance/gauges/BaseGauge.sol#L60-L61

The storage variable MAX_REWARD_RATE is never used in the contract to ensure that the rewardRate does not exceed the limit.

Impact

  1. Potential Integer Overflow

  2. Excessive Emissions: Without capping the reward rate, the contract might distribute rewards beyond the intended limit.

Tools Used

Manual review

Recommendations

consider adding the below check in the notifyReward

function notifyReward(
PeriodState storage state,
uint256 amount,
uint256 maxEmission,
uint256 periodDuration
) internal view returns (uint256) {
if (amount > maxEmission) revert RewardCapExceeded();
if (amount + state.distributed > state.emission) revert RewardCapExceeded();
uint256 rewardRate = amount / periodDuration;
if (rewardRate == 0) revert ZeroRewardRate();
// Ensure rewardRate does not exceed MAX_REWARD_RATE
if (rewardRate > MAX_REWARD_RATE) revert RewardRateExceedsLimit();
return rewardRate;
}
Updates

Lead Judging Commences

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

BaseGauge lacks enforcement of both distributionCap and MAX_REWARD_RATE limits

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

BaseGauge lacks enforcement of both distributionCap and MAX_REWARD_RATE limits

Support

FAQs

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

Give us feedback!