precision loss occurs in the getBoostMultiplier function of the BoostController contract. Specifically, the function's calculation of the boost multiplier would lead to a situation where the resulting value exceeds MAX_BOOST, violating key system invariants. This occurs due to an incorrect denominator in the division operation, which can cause an unintended amplification of the boost multiplier, particularly for specific values of userBoost.amount.
https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/governance/boost/BoostController.sol#L282This function is designed to compute a boost multiplier based on userBoost.amount and return it in basis points (1e4).
The issue arises due to the incorrect calculation of baseAmount:
This step performs a scaling operation, but when userBoost.amount takes specific values (such as 333, 499, 999), it introduces precision loss due to integer division and users with this amount gets more rewards.
The final calculation:
would cause the return value to exceed MAX_BOOST, violating expected constraints.
I added the senario for value 333, and other user amounts that would cause this issue. Invariant is completely broken:
Integer division causes truncation, leading to unintended behavior in the calculation of baseAmount.
When userBoost.amount is 333,499,999 baseAmount gets truncated to a much smaller value.
As a result, dividing userBoost.amount * 10000 by baseAmount leads to an inflated return value.
This allows an attacker to gain an unintended higher boost multiplier, breaking system invariants.
Boost Multiplier Inflation:
The function would return as seen a value higher than MAX_BOOST, causing unintended reward calculations.
Attackers with specific deposit amounts would manipulate their boost multipliers beyond the intended limit.
Reward Exploitation:
Since rewards are computed using the boost multiplier, an attacker would earn a disproportionately high reward share.
This results in unfair distribution and economic imbalances in the system.
System Integrity Violation:
The contract assumes MAX_BOOST is an upper bound, which is violated by this flaw.
Fix the Calculation Logic
The correct calculation should prevent integer division from introducing precision loss:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.