Rewards distributed to gauges don't account for user boosts leading to the last users claiming unable to receive their rewards.
When gauges are notified of rewards, the rewardRate is updated.
The updateRewards() modifier (akin to Synthetix staking rewards) then syncs the user state:
The state.rewards variable is assigned to earned(account), which applies the user's boost:
Thus, the user's base rewards per token will be multiplied by the boost and weight from the BoostCalculator.
But when users try to claim rewards, the function will check whether reward > balance and if it is, revert:
This creates an issue, let's follow it with an example:
10,000 rewards notified in gauge to be distributed
10 participants each eligible for 1000 rewards
The updateRewards() modifier will assign the user earned rewards as baseReward * boost
10k distributed, but due to boosts, users are eligible for 15k rewards
There are 10k rewards in the contract but 15k to be claimed, creating a race condition among users for who claims
First users that claim rewards will receive boosted amounts but last users claiming will be unable to claim rewards due to notify rewards not taking into account the boosted rewards. With current implementation it will be challenging to calculate the correct rewards to notify ahead of time with ever-changing user boosts and weights.
Manual Review
Refactor the rewards distribution to gauges.
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.