Core Contracts

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

getBoostMultiplier() from BoostController.sol will always return the max boost

Summary

getting the currect boost multiplier for a user in a pool by getBoostMultiplier() from BoostController.sol will always return the max boost

Vulnerability Details

When calculating the boost multiplier in the getBoostMultiplier() these are the calculations ->

function getBoostMultiplier(address user, address pool) external view override returns (uint256) {
//code
// Calculate actual boost multiplier in basis points
uint256 baseAmount = userBoost.amount * 10000 / MAX_BOOST;
return userBoost.amount * 10000 / baseAmount;
//@audit it will always return 25000
}

The formula looks like this -> (x * 10 000) / 25 000 = baseAmount

return (x * 10 000) / baseAmount ;

which will always return 25 000, because

(x * 10 000) / (( x * 10 000) / 25 000)) = 25 000

the x * 10 000 will be cancelled out, thus will always return 25 000, regardless of the userBoost.amount

Impact

incorrect calculation, always returning the Max Boost

Tools Used

Recommendations

Use another logic for the calculation

Updates

Lead Judging Commences

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