Core Contracts

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

Wrong Comparison in the BaseGuage::setEmission()

Summary

Vulnerability Details

The new emmision amount in the setEmission() function of the BaseGuage abstract contract should be compared to _maxEmission and not periodState.emission

/**
* @notice Sets emission cap for the period
* @param emission New emission amount
*/
function setEmission(uint256 emission) external onlyController {
if (emission > periodState.emission) revert RewardCapExceeded(); // @audit emission should be compared to max_emission not periodState.emission which is prone to change
periodState.emission = emission;
emit EmissionUpdated(emission);
}

This little oversight would cause the emission cap to get increasingly smaller as a lesser emission is set, because the periodState.emission rate is set to the current emission. Lets us consider a scenario where _maxEmission is set to 1000 and the controller for a particular period sets the current emission to say 50. Subsequent setting of a new emission amount would be capped at the previous amount which is set to 50.

Impact

The Gauge controller is unable to set a higher emission than a previously set emission

Tools Used

Manual Review

Recommendations

Create and use a seperate _maxEmission state variable for the cap for emission amount

/**
* @notice Sets emission cap for the period
* @param emission New emission amount
*/
function setEmission(uint256 emission) external onlyController {
if (emission > _maxEmission) revert RewardCapExceeded(); // @audit emission should be compared to max_emission not periodState.emission which is prone to change
periodState.emission = emission;
emit EmissionUpdated(emission);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Appeal created

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

BaseGuage::setEmission can be configured only to lower values limiting the

Support

FAQs

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

Give us feedback!