In BaseGauge, timestamps are not handled correctly during reward calculation, causing the reward period to extend indefinitely.
lastUpdateTime is initialized as 0, and the period length is 10.
At block.timestamp = 2, a user calls getReward. The _updateReward function computes getRewardPerToken based on rate * (2 - 0), then updates lastUpdateTime to 2. Consequently, periodFinish is now 2 + 10 = 12, instead of the expected 10.
At block.timestamp = 4, getRewardPerToken is recalculated as rate * (4 - 2). Due to the incorrect computation of periodFinish, it extends indefinitely. Now, periodFinish becomes 4 + 10 = 14, instead of remaining at 10.
The incorrect computation of periodFinish results in an unintended extension of the reward period. This leads to incorrect reward distribution, potential reward manipulation, and unfair advantages for some users.
Manual review
Modify periodFinish to be determined based on a fixed start time plus a defined period duration, rather than relying on lastUpdateTime.
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.