Submitted by hash
Whenever a new emission schedule is to be followed, i.e., block.timestampbecomes greater than the startOffset of the schedule, the setScheduledRewardsPerSecond function invokes the _massUpdatePools function in order to bring the pools to the latest state.
Inside the _massUpdatePools, the previous rewardsPerSecond is used until block.timestamp instead of the startOffset of the new schedule; i.e., the correct update of oldRewardsPerSecond * (newScheduleStartTimestamp - lastUpdateStamp) + newRewardsPerSecond * (block.timestamp - newScheduleStartTimestamp) is not used.
_massUpdatePools -> _updatePool -> _newRewards
Correct the formula to similar like: oldRewardsPerSecond * (newScheduleStartTimestamp - lastUpdateStamp) + newRewardsPerSecond * (block.timestamp - newScheduleStartTimestamp).
amarcu (LoopFi) confirmed
pkqs90 (warden) commented:
Koolex (judge) commented:
