Core Contracts

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

Incorrect decimals in boost parameters prevents gauge interactions

Summary

Different decimals between maxBoost and minBoost parameters will cause all gauge interactions to fail when veRAACToken.totalSupply() > 0 and gaugeWeight > 0, preventing users from interacting with the gauge system.

Root Cause

In BaseGauge.sol, the constructor sets maxBoost to 25000 (2.5x) and minBoost to 1e18, using different decimal scales. This causes underflow in BoostCalculator.sol when calculating boostRange.

constructor(
address _rewardToken,
address _stakingToken,
address _controller,
uint256 _maxEmission,
uint256 _periodDuration
) {
.........................
// Initialize boost parameters
-> boostState.maxBoost = 25000; // 2.5x
-> boostState.minBoost = 1e18;
boostState.boostWindow = 7 days;
.........................
}

This causes underflow in the boost calculation:

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
89-> uint256 boostRange = params.maxBoost - params.minBoost;
// ...
}

Impact

The protocol becomes unusable as key functions like state() and withdraw() will revert due to the updateReward modifier's call chain: _updateReward() => earned() => getUserWeight() => _applyBoost() => calculateBoost().

Mitigation

Align the decimal scales between maxBoost and minBoost:

constructor(
address _rewardToken,
address _stakingToken,
address _controller,
uint256 _maxEmission,
uint256 _periodDuration
) {
.........................
// Initialize boost parameters
boostState.maxBoost = 25000; // 2.5x
- boostState.minBoost = 1e18;
+ boostState.minBoost = 10000;
boostState.boostWindow = 7 days;
.........................
}
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!