Submitted by rscodes, also found by 0xpiken and novamanbg
In MultiFeeDistribution.sol, the function _notifyReward(address rewardToken, uint256 reward) does not change r.rewardPerTokenStored and hence, relies on _updateReward(address account) to be called before any calls to _notifyReward. The rest of the functions who call _notifyReward follows this rule; except for vestTokens when it is called by a minter to give incentives to the lockers.
Since _updateReward is an internal function, we also cannot expect minters to call it on their side before calling vestTokens.
Hence, this bug results in rewardData[rewardToken].rewardPerTokenStored being inaccurate as it will not contain the previous results accumulated by the previous rewardData[rewardToken].rewardPerSecond when minters call vestTokens. This results in all lockers losing the rewards previously accumulated by the previous rewardPerSecond.
Console Output:
Adding _updateReward(address(this)) will ensure rewardData[address(rdntToken)].rewardPerTokenStored is updated accordingly, so that lockers will not lose previously given incentives.
Foundry, VSCode
amarcu (LoopFi) confirmed
0xAlix2 (warden) commented:
radin100 (warden) commented:
