BaseGauge contract shows incorrect periodFinish()
BaseGauge.periodFinish() expects to return the timestamp in which the period ends, but fails to do it properly as end timestamp is calculated as lastUpdateTime + getPeriodDuration()
, being `lastUpdateTime` the timestamp at which rewards were last updated.
As `lastUpdateTime` is updated overtime, so will be periodFinish() meaning that the end timestamp of the period is never reached as it grows over time.
periodFinish() will never show the correct timestamp. As a result, lastTimeRewardApplicable() does not return the real last time that applies for rewards and `getRewardPerToken()` (which makes use of lastTimeRewardApplicable()) will miscalculate rewardPerTokenStored, leading to a much higher reward than expected.
Manual review
Correct the BaseGauge.periodFinish() function to return the true period end timestamp:
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.