_applyBoost math is flawed, messing rewards accounting
User rewards are calculated with earned, where it calls getUserWeight in order to calculate how much rewards each individual user should get
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/governance/gauges/BaseGauge.sol#L583
Where after getting the user weight we apply a boost (I know _getBaseWeight doesn't work, but that's another bug). Where inside the boost we perform the flawed math. More precisely the return is flawed as it will return in 4 decimals (boost order of magnitude), instead of 18 (weight order of magnitude) - return (baseWeight * boost) / 1e18;
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/governance/gauges/BaseGauge.sol#L229
Example:
User weight is 100e18
BoostCalculator.calculateBoost calcualtes his boost to be 12k
The return will math out -> (baseWeight * boost) / 1e18 = 100e18 * 12000 / 1e18 = 1.2e6
getUserWeight will get a tiny weight and when that weight is used in earn the following will occur
Users receive orders of magnitude less rewards, due to a wrong formula inside _applyBoost
Manual review
Change the math to:
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.