The notifyRewardAmount function in the rewards distribution contract incorrectly overrides the rewardRate without considering its previous value. This leads to a loss of already distributed rewards, as the ongoing reward distribution is disrupted, potentially preventing users from claiming their entitled rewards.
The function directly sets rewardRate using notifyReward, which calculates rewardRate as:
This calculation completely overrides the existing rewardRate, without accumulating previous values.
The contract does not track or distribute rewards that were already in progress, leading to loss of unclaimed rewards.
Users may lose a portion of their entitled rewards when a new reward amount is notified.
If rewards are meant to be continuously distributed over time, resetting rewardRate disrupts the expected distribution.
Assume rewardRate is set for an initial reward amount of 1000 over 10 seconds (rewardRate = 100 per second).
Users accumulate rewards at 100 per second for 5 seconds.
The controller calls notifyRewardAmount(500), which resets rewardRate instead of accumulating it.
The previous accumulated rewards for the first 5 seconds are lost, leading to user loss.
Modify notifyRewardAmount to accumulate the previous rewardRate before updating it:
This ensures that rewards already in progress are carried forward into the new reward calculation.
Loss of funds: Users lose rewards due to incorrect calculations.
Implement cumulative reward calculations.
This issue results in significant user losses and disrupts the intended reward distribution mechanism.
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.