You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Accrued event is emitted without regard to rewardsAccrued: sometimes, when claiming rewards for assets the user didn't supply/borrow for, Accrued events are emitted because the reward's asset index was updated, without the user's data being updated.
Recommendation
Split the Accrued event in 2:
RewardIndexUpdated(asset, reward, newAssetIndex): emitted whenever the asset's index is updated in storage
RewardAccrued(asset, reward, user, rewardsAccrued): emitted whenever a user's rewards was accrued
What I think we can learn
The condition rewardDataUpdated || userDataUpdated is too broad: each condition corresponds to a storage update, and should thus be bound to independent events
The text was updated successfully, but these errors were encountered:
Issue
https://github.com/morpho-org/morpho-aave-v3/blob/03cee70c50a8d0abf3c5eebdd416127fe8a54ea5/src/RewardsManager.sol#L355-357
Accrued
event is emitted without regard torewardsAccrued
: sometimes, when claiming rewards for assets the user didn't supply/borrow for,Accrued
events are emitted because the reward's asset index was updated, without the user's data being updated.Recommendation
Split the
Accrued
event in 2:RewardIndexUpdated(asset, reward, newAssetIndex)
: emitted whenever the asset's index is updated in storageRewardAccrued(asset, reward, user, rewardsAccrued)
: emitted whenever a user's rewards was accruedWhat I think we can learn
rewardDataUpdated || userDataUpdated
is too broad: each condition corresponds to a storage update, and should thus be bound to independent eventsThe text was updated successfully, but these errors were encountered: