Core Contracts

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

Incorrect emission cap comparison while setting emissions in BaseGauge

Summary

The setEmission function in BaseGauge contains a logic error where it compares the new emission amount with the current emission instead of the maximum allowed emission (maxEmission).

Vulnerability Details

The issue is in the setEmission function of the BaseGuage contract:

function setEmission(uint256 emission) external onlyController {
// Incorrect comparison with current emission instead of maxEmission
if (emission > periodState.emission) revert RewardCapExceeded();
periodState.emission = emission;
emit EmissionUpdated(emission);
}

The function compares new emission with periodState.emission instead of maxEmission. So, even if the protocol wants to increase emissions, it can never be done. Since no new emission can be higher than the past ones because of the incorrect variable used.

Impact

The protocol will not be able to set the desired emission as trying to increase emissions from the periodState.emission will always revert. The protocol will not function as intended.

Tools Used

Manual review

Recommendations

Update the comparison to use maxEmission:

function setEmission(uint256 emission) external onlyController {
if (emission > maxEmission) revert RewardCapExceeded();
periodState.emission = emission;
emit EmissionUpdated(emission);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Appeal created

inallhonesty Lead Judge 3 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.