BaseGauge contract allows to stake and withdraw tokens with the following functions:
The problem arises because both of these functions use _balances mapping to store the amount staked by the user, and this mapping is never used in the contract to calculate the rewards.
Both functions have the updateReward(msg.sender)modifier, which will update the rewards due to the user. But this modifier never uses the staked amount and _balances mapping to compute rewards.
This means rewards are entirely independent from staking in the gauge which is not the expected behaviour.
The impact of this issue is high as it leads to incorrect computation of rewards for users.
Manual review.
Make sure to correctly implement gauge rewards mechanism.
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.