Core Contracts

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

wrong Initialize minBoost parameter

Summary

The minBoost value is incorrectly set to a value greater than maxBoost, leading to an arithmetic underflow when calculating the boostRange. This results in an invalid boostRange value and disrupts all dependent logic.

Vulnerability Details

In the code snippet below, the minBoost is initialized to 1e18 (1,000,000,000,000,000,000) while maxBoost is set to 25000:

boostState.maxBoost = 25000; // 2.5x
boostState.minBoost = 1e18; // 1x (incorrectly set)

When calculating boostRange, the subtraction maxBoost - minBoost is performed:

uint256 boostRange = params.maxBoost - params.minBoost;

Since maxBoost (25,000) is smaller than minBoost (1e18), this operation will underflow. Solidity’s unchecked arithmetic (default in versions <0.8.0) would result in an extremely large positive value for boostRange, while in Solidity >=0.8.0, the transaction would revert entirely.

Impact

The whole system is broken because updating reward and calculating boost will revert. But admin can set right parameter by calling setBoostParameters.

Tools Used

manual

Recommendations

- boostState.minBoost = 1e18;
+ boostState.minBoost = 10000;
Updates

Lead Judging Commences

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

Give us feedback!