The boost calculation in the contract is flawed because it uses the user's veRAAC balance (voting power) instead of their locked RAAC balance to determine the boost multiplier. This leads to incorrect reward calculations, potentially giving users unfair advantages or disadvantages.
The boost calculation relies on the user's veRAAC balance (balanceOf(user)) instead of their locked RAAC balance (_lockState.locks[user].amount). This discrepancy occurs in the calculateBoost function:
User A locks 1000 RAAC tokens for 4 years, receiving a high voting power (veRAAC balance).
User B locks 500 RAAC tokens for 1 year, receiving a lower voting power.
The boost calculation uses the veRAAC balance, giving User A a disproportionately high boost compared to User B, even though User B has a significant locked balance.
Deploy the veRAACToken contract with the RAAC token address.
User A locks 1000 RAAC tokens for 4 years (MAX_LOCK_DURATION).
User B locks 500 RAAC tokens for 1 year.
Call calculateBoost for User A and User B.
Observe that User A receives a disproportionately high boost compared to User B, even though User B has a significant locked balance.
Verify that the boost calculation is based on the veRAAC balance (balanceOf(user)) instead of the locked RAAC balance (_lockState.locks[user].amount).
The boost calculation should use the locked RAAC balance to ensure fair and accurate rewards.
Actual Behavior
The boost calculation uses the veRAAC balance, leading to incorrect and unfair rewards.
User A receives a higher boost than User B, even though User B has a significant locked balance.
The boost calculation is based on the veRAAC balance (balanceOf(user)) instead of the locked RAAC balance (_lockState.locks[user].amount).
Users may receive incorrect rewards due to inaccurate boost calculations.
Users with high voting power but low locked balances could receive disproportionately high boosts.
Incorrect boosts could undermine user trust in the fairness of the reward distribution system.
Modify the calculateBoost function to use the locked RAAC balance (_lockState.locks[user].amount) instead of the veRAAC balance (balanceOf(user)).
Ensure that the boost value is clamped to the valid range (MIN_BOOST to MAX_BOOST).
Emit an event when the boost is calculated to improve transparency and facilitate debugging.
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.