Whenever a user stakes tokens in the BaseGauge with the stake function, updateReward modifier will update the user's rewards:
The problem arises because the state.rewards value is independent from the staked amount and will be calculated as follows:
This will return a non zero value, depending on the weight of the gauge and the voting power of the user (boost).
After that, user is able to call getRewards, also protected by the updateReward modifier:
This means users will get rewards like if they owned all the staked tokens of the gauge. There is no ponderation mechanism to distribute rewards depending on the staked amount. This is a serious issue as it will lead to first users claiming too much rewards and last users not being able to claim rewards at all.
The impact of this issue is high as it leads to incorrect computation of rewards for users.
Manual review.
Make sure to take into account the staked amount in the reward computation, so that users cannot claim more rewards than they should.
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.