Core Contracts

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

Incorrect Boost Multiplier Calculation in getBoostMultiplier

Summary

The function getBoostMultiplier incorrectly calculates the boost multiplier due to a flawed formula. Instead of properly determining the multiplier based on the user’s veToken balance, it incorrectly derives a value that does not correctly reflect the intended boost mechanics.

Vulnerability Details

In getBoostMultiplier, the boost multiplier is computed as:

uint256 baseAmount = userBoost.amount * 10000 / MAX_BOOST;
return userBoost.amount * 10000 / baseAmount;
  • The baseAmount calculation incorrectly scales userBoost.amount, but the final division essentially cancels out the intended effect, returning an incorrect boost value.

  • If userBoost.amount == MAX_BOOST, then baseAmount = 10000, making the function return userBoost.amount, which is not a valid multiplier in basis points.

By contrast, the correct boost calculation is seen in calculateBoost:

uint256 votingPowerRatio = (veBalance * 1e18) / totalVeSupply;
uint256 boostRange = params.maxBoost - params.minBoost;
uint256 boost = params.minBoost + ((votingPowerRatio * boostRange) / 1e18);

This correctly computes the boost based on the user's veToken balance relative to the total supply.

Impact

  • The incorrect calculation could lead to misrepresented boost values, potentially allowing incorrect reward distributions or unintended behavior in the system.

Tools Used

Manual Review

Recommendations

  • Update getBoostMultiplier to use a calculation similar to calculateBoost, ensuring that the boost is based on the user’s veToken balance relative to total veToken supply.

Updates

Lead Judging Commences

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