Core Contracts

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

Incorrect calculation in getBoostMultiplier

Summary

In getBoostMultiplier() function of BoostController.sol

function getBoostMultiplier(
address user,
address pool
) external view override returns (uint256) {
if (!supportedPools[pool]) revert PoolNotSupported();
UserBoost storage userBoost = userBoosts[user][pool];
if (userBoost.amount == 0) return MIN_BOOST;
// Calculate actual boost multiplier in basis points
uint256 baseAmount = userBoost.amount * 10000 / MAX_BOOST;
return userBoost.amount * 10000 / baseAmount;
}

If userBoost.amount is very small, baseAmount will be 0 and the function will revert. (ex : userBoost.amount =1, or 2)

And by rounding issue, the result value will be greater than MAX_BOOST.

And the function returns always MIN_BOOST or MAX_BOOST.

Impact

  1. By useless reverting, the functions that use this function might always revert.

  2. The function always return MIN_BOOST or MAX_BOOST

Tools Used

Manual

Recommendations

  1. Please check whether the logic is correct.

  2. If correct, need to add baseAmount =0 validation and (result > MAX_BOOST) validation.

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

BoostController::getBoostMultiplier always returns MAX_BOOST for any non-zero boost due to mathematical calculation error, defeating the incentive mechanism

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.