calculateBoost calculates boos wrongly as it compares 2 different variables
Before moving into the bug I need to explain away 2 variables first:
1 userVotingPower is the current bias the user has. It would further imply that userVotingPower decays with the bias. If a user has 1000 bias for 1 year lock, after the 6th months his bias (and userVotingPower) would be 500
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/governance/boost/BoostController.sol#L151
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/tokens/veRAACToken.sol#L426
2 totalVotingPower is the important one here, where we can see that it's just the veToken totalSupply.
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/governance/boost/BoostController.sol#L97
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/governance/boost/BoostController.sol#L385
Simply put when tokens are locked we mint veTokens representing the initial bias (the full one without factoring the decay).
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/tokens/veRAACToken.sol#L564
With the above 2 in mind we come to the conclusion that userVotingPower is a decaying variable, while totalVotingPower is all of the biases combined without factoring the decay.
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/governance/boost/BoostController.sol#L141
After knowing this we could see that the above function makes an error when it uses these 2 different variables to calculate the boost. This will lead to all users having way less boost, as all combined userVotingPower will be less than totalVotingPower and by a huge margin.
Boost is calculated wrong
Users will always have way less boost
total userVotingPower < totalVotingPower - invariant broken
Boost is used in number of instances to calculate rewards, which would mean that user will receive less in general and some rewards may end up stuck.
Manual review
Either don't use current bias and use user balance or have a variable to track global decay (really hard) and use it instead of totalVotingPower
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.