Core Contracts

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

Incorrect maxBoost initial value in BaseGauge

Summary

Incorrect maxBoost initial value in BaseGauge

Vulnerability Details

In BaseGauge, stakers' rewards will be calculated based on the basic weight and the boost calculation. Boost parameters are initialized in the constructor contract.

The stakers' reward boost will be calculated in function calculateBoost. In calculateBoost() function, we will calculate the different between maxBoost and minBoost.

The problem here is that maxBoost's initial value is less than the minBoost initial value. This will cause the calculation reverted.

boostState.maxBoost = 25000; // 2.5x
boostState.minBoost = 1e18;
function calculateBoost(
uint256 veBalance,
uint256 totalVeSupply,
BoostParameters memory params
) internal pure returns (uint256) {
if (totalVeSupply == 0) {
return params.minBoost;
}
uint256 votingPowerRatio = (veBalance * 1e18) / totalVeSupply;
uint256 boostRange = params.maxBoost - params.minBoost;
uint256 boost = params.minBoost + ((votingPowerRatio * boostRange) / 1e18);
if (boost < params.minBoost) {
return params.minBoost;
}
if (boost > params.maxBoost) {
return params.maxBoost;
}
return boost;
}

Impact

Users cannot stake or withdraw because of the reverted boost calculation. The boost parameter can be updated via the setBoostParameters function. Before the admin does not update the boost parameters, users cannot stake/withdraw.

Tools Used

Manual

Recommendations

Initial maxBoost & minBoost with correct value.

Updates

Lead Judging Commences

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

boostState.minBoost is set to 1e18

Support

FAQs

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