Core Contracts

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

Incorrect constructor initialised value for boostState.minBoost causes denial of service in calculate boost if the controller doesn't alter the initial values

Summary

Incorrect boostState.minBoost value is set in the BaseGauge contract constructor.

Vulnerability Details

The docs state that boosState.minBoost should be set to 10000, however, the value is set to 1e18.

It also is clearly incorrect because maxBoost < minBoost, which doesn't make logical sense.

boostState.maxBoost = 25000; // 2.5x
boostState.minBoost = 1e18;

This will cause an underflow error whenever calculateBoost is called (given that the parameters haven't been set to different values by the controller through setBoostParameters.

The underflow error occurs due to the calculation:

uint256 boostRange = params.maxBoost - params.minBoost;
// 25000 - 1e18 < 0

Impact

Low

The controller can just alter the initial values through calling setBoostParameters, however, that doesn't mean the issue is non-existent.

Tools Used

Manual review

Recommendations

Set the initial value for minBoost correctly, as per the docs.

Updates

Lead Judging Commences

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