Core Contracts

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

Max amount being lower than min in GaugeBase DOSes core functions

Vulnerability Details

At BaseGauge the initial max and min amounts for boosts have incompatible values.

The thing is that the max is actually a smaller value than the min. See here.

Impact

Effectively DOSing core functions due to always revert on the _applyBoost() function.

This is because these min and max amounts are passed to the BoostCalculator::calculateBoost() logic, here. And inside there is a max - min operation, which will revert on underflow. Here.

Flow:

//ALL FUNCS WITH THE MODIFIER -> updateReward modifier -> _updateReward() -> earned() -> getUserWeight() -> _applyBoost() -> BoostCalculator::calculateBoost() -> revert

Some functions with the modifier:

  • stake()

  • withdraw()

  • voteDirection()

Recommendations

Make max and min values sent to the BoostCalculator call in _applyBoost() in the same units. I looks like they both are percentages but with different decimals of precission. Be consistent with the units.

Boost calculator seems to use both as a percentage, see here, so I guess because of the division by 1e18 that the max amount should be scaled to the 1e18 precision.

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.