Core Contracts

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

Everyone will receive max boost due to `minBoost` not being in basis points

Details

Initial boost parameters in BaseGauge are as follows

// Initialize boost parameters
boostState.maxBoost = 25000; // 2.5x
boostState.minBoost = 1e18;
boostState.boostWindow = 7 days;

Min boost is denominated in 1e18 instead of basis points which will cause the snippet below to always return inflated amounts.

// Ensure boost is within bounds
if (boost < params.minBoost) { // @note this is always true
return params.minBoost;
}
if (boost > params.maxBoost) {
return params.maxBoost;
}
return boost;

Another affected place is _calculateBoost which will also return max amounts always

(uint256 boostBasisPoints, uint256 boostedAmount) = BoostCalculator.calculateTimeWeightedBoost(
params,
userBalance,
totalSupply,
amount
);
if (boostedAmount < amount) {
return amount;
}
uint256 maxBoostAmount = amount * MAX_BOOST / 10000;
if (boostedAmount > maxBoostAmount) { // @audit boostedAmount will always be absurdly high
return maxBoostAmount;
}
return boostedAmount;

boostedAmount will always be higher than maxBoostAmount due to being in 1e18, hence why everyone will receive max boost.

Impact

Unfair reward distribution, logic error

Mitigation

Use basis points for all boosts

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!