Calling BaseGauge.notifyRewardAmount() after period has ended will make _updateRewards() revert
When BaseGauge.notifyRewardAmount() is called `lastUpdateTime` is updated to block.timestamp. _updateReward() being called after that (through the updateReward modifier in stake() or withdraw()) will revert in this code line of getRewardPerToken():
This happens because lastTimeRewardApplicable returns the period end timestamp, but lastUpdateTime now is a higher value (current timestamp > period end timestamp), therefore the function return for trying to compute a negative unsigned integer.
Users cannot stake() or withdraw() if notifyRewardAmount() has been called after the period finished, preventing them from getting the staked tokens and breaking the expected behaviour of the contract.
Manual review
Do never update lastUpdateTime to a timestamp higher than period end, it is not necessary to set it as updateReward modifier will do it.
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.