Submitted by bin2chen
Transfer missing _updateRewards(), resulting in the loss of froms reward.
StaticATokenLM contains the rewards mechanism, when the balance changes, the global _accRewardsPerToken needs to be updated first to calculate the users rewardsAccrued more accurately.
Example: mint()/burn() both call _updateRewards() to update _accRewardsPerToken.
When transfer()/transerFrom(), the balance is also modified, but without calling _updateRewards() first. The result is that if the user transfers the balance, the difference in rewards accrued by from is transferred to to along with it. This doesnt make sense for from.
_beforeTokenTransfer first trigger _updateRewards().
Context
tbrent (Reserve) commented:
julianmrodri (Reserve) commented:
tbrent (Reserve) acknowledged
