Core Contracts

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

Insufficient validation of amount provided to notifyRewardAmount

In guage.notifyRewardAmount, we validate that the rewardsToken balance of the
contract is sufficient to cover future reward emissions:

uint256 balance = rewardToken.balanceOf(address(this));
if (rewardRate * getPeriodDuration() > balance) {//@audit
revert InsufficientRewardBalance();
}
}

In the current implementation, the contract only checks if balanceOf rewardsToken is greater than the future rewards.

However, under normal circumstances, since users can not withdraw all their rewards in time, the balance in the contract contains rewards that belong to the users but have not been withdrawn yet. This means the current checks can not be sufficient enough to make sure the contract has enough amount of rewardsToken.
As a result, users can continuously call distributeRewards from the controller to notifyRewardAmount with reward within the same period emission, the contract would end up in a wrong state that makes some users unable to claim their rewards.

Impact

some users would be end up being unable to claim there rewards

Recommendation

Consider using transferFrom to receive reward amount

Updates

Lead Judging Commences

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

BaseGauge::notifyRewardAmount checks token balance without accounting for unclaimed rewards, allowing allocation of more rewards than available tokens

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

BaseGauge::notifyRewardAmount checks token balance without accounting for unclaimed rewards, allowing allocation of more rewards than available tokens

Support

FAQs

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