Core Contracts

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

Un-used variable `distributionCap` may cause pool being drained

Summary

In the contract contracts/core/governance/gauges/BaseGauge.sol function setDistributionCap()

The distributionCap variable is not used acorss the project.

Vulnerability Details

This varialbe is referenced ONLY in the mocked comment code at file contracts/mocks/core/governance/gauges/MockBaseGauge.sol at Line 82

The mock file indicates the real notifyRewardAmount function within file contracts/core/governance/gauges/BaseGauge.sol possibly needs to have check the rewards cap with distributionCap before emit the RewardNotified event

// function notifyRewardAmount(uint256 amount) external override onlyController updateReward(address(0)) {
// if (amount > distributionCap) revert ExcessiveRewardRate();
// uint256 duration = getPeriodDuration();
// uint256 oldRewardRate = rewardRate;
// uint256 newRewardRate = amount / duration;
// if (newRewardRate > MAX_REWARD_RATE) revert ExcessiveRewardRate();
// rewardRate = newRewardRate;
// lastUpdateTime = block.timestamp;
// emit RewardNotified(amount, oldRewardRate, newRewardRate);
// }

This could cause incorrect RewardNotified event in the function notifyRewardAmount for the BaseGuage contract and incorrect rewards been sent.

Impact

Incorrect reward may cause further logic error or pool been drained

Tools Used

Manual review

Recommendations

Adding check to make sure the reward amount is less than the distributionCap

if (amount > distributionCap) revert DistributionCapExceeded();
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!