Core Contracts

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

BaseGauge::notifyRewardAmount() does not get any funds transfered rewards to gauges leading to DOS of distributeRewards in gaugeController

Summary

The distribution of rewards to the gauges works by calling the GaugeController to allocate rewards to all gauges that have weight. Although this process is simple and straightforward, it presents a problem because the execution flow does not transfer any funds.

Vulnerability Details

First, the GaugeController initiates distributeRewards, which calculates the rewards for each gauge based on its weight.

function distributeRewards(
address gauge
) external override nonReentrant whenNotPaused {
if (!isGauge(gauge)) revert GaugeNotFound();
if (!gauges[gauge].isActive) revert GaugeNotActive();
uint256 reward = _calculateReward(gauge);
if (reward == 0) return;
IGauge(gauge).notifyRewardAmount(reward);
emit RewardDistributed(gauge, msg.sender, reward);
}
function notifyRewardAmount(uint256 amount) external override onlyController updateReward(address(0)) {
if (amount > periodState.emission) revert RewardCapExceeded();
rewardRate = notifyReward(periodState, amount, periodState.emission, getPeriodDuration());
periodState.distributed += amount;
uint256 balance = rewardToken.balanceOf(address(this));
if (rewardRate * getPeriodDuration() > balance) {
revert InsufficientRewardBalance();
}
lastUpdateTime = block.timestamp;
emit RewardNotified(amount);
}

Whenever it calls notifyRewardAmount, the function checks the balance as if funds have already been transferred to the contract. However, since the contract is empty, the condition fails, causing a continuous revert and leading to a Denial of Service (DoS).

Impact

  • No rewards are distributed to gauges.

  • Core functionality is broken.

Tools Used

  • Manual review

Recommendations

  • Ensure that funds are transferred to the gauges before calling notifyRewardAmount.

Updates

Lead Judging Commences

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

GaugeController notifies gauges of rewards without transferring tokens in both distributeRewards and _distributeToGauges functions, breaking reward distribution

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

GaugeController notifies gauges of rewards without transferring tokens in both distributeRewards and _distributeToGauges functions, breaking reward distribution

Support

FAQs

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

Give us feedback!