Core Contracts

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

Incorrect Boost Parameter in BaseGauge Constructor

Summary

The BaseGauge contract constructor initializes boostState.minBoost with a value (1e18) that is significantly larger than maxBoost (25000), which breaks the boost calculation logic.

Vulnerability Details

The minBoost value of 1e18 is significantly larger than the maxBoost value of 25000, which breaks the intended boost calculation logic where minBoost should represent 1x (10000) and maxBoost should represent 2.5x (25000).

in the constructor:

constructor(
address _rewardToken,
address _stakingToken,
address _controller,
uint256 _maxEmission,
uint256 _periodDuration
) {
rewardToken = IERC20(_rewardToken);
stakingToken = IERC20(_stakingToken);
controller = _controller;
// Initialize roles
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(CONTROLLER_ROLE, _controller);
// Initialize boost parameters
boostState.maxBoost = 25000; // 2.5x
// @audit minBoost is set to a value larger than maxBoost
boostState.minBoost = 1e18;
boostState.boostWindow = 7 days;
uint256 currentTime = block.timestamp;
uint256 nextPeriod = ((currentTime / _periodDuration) * _periodDuration) + _periodDuration;
...rest of the code
}


Impact

The incorrect minBoost value will cause the boost calculation to malfunction since:

  • minBoost (1e18) > maxBoost (25000)

  • This breaks the calculateBoost function in the BoostCalculator library BoostCalculator::calculateBoost

    and cause an underflow revert error due to uint256 boostRange = params.maxBoost - params.minBoost;

    function calculateBoost(
    uint256 veBalance,
    uint256 totalVeSupply,
    BoostParameters memory params
    ) internal pure returns (uint256) {
    // Return base boost (1x = 10000 basis points) if no voting power
    if (totalVeSupply == 0) {
    return params.minBoost;
    }
    // Calculate voting power ratio with higher precision
    uint256 votingPowerRatio = (veBalance * 1e18) / totalVeSupply;
    // Calculate boost within min-max range
    ---> this will always cays it to revert>> uint256 boostRange = params.maxBoost - params.minBoost;
    uint256 boost = params.minBoost + ((votingPowerRatio * boostRange) / 1e18);
    ...rest of the code
    }

Tools Used

Manual code review

Recommendations

Fix the boost parameters:

boostState.minBoost = 10000; // 1x base

Updates

Lead Judging Commences

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