Any user who front-runs the addReward() call will disrupt the rewards distributions.
Each user interaction triggers the checkEpochRollover() modifier, which verifies if the current epoch has ended, calculates the rewards for the last epoch, and updates the total staked tokens with those from the past epoch.
This approach ensures that the epoch is always up-to-date and rewards are accurately calculated whenever a user makes a call. However, there is another function, addReward(), which can only be called by the Rewards Admin. This function transfers the tokens to be distributed to stakers from past epochs and checks if the epoch should be rolled over. According to the comments, this function should be the last action in the epoch and should trigger the rollover to prevent any further increase in the total staked amount. However, as mentioned earlier, any user interaction can also trigger the epoch rollover.
In summary, any user who front-runs the Rewards Admin's addReward() call when the epoch should be rolled over will cause incorrect rewards distribution in the subsequent epochs.
If a user front-runs the Rewards Admin's addReward() call, it will cause the epoch to roll over. This action will disrupt the accurate calculation and distribution of rewards for the last epoch. As a result, the rewards intended for stakers in the last epoch will be misallocated, leading to some users receiving less than their fair share of rewards.
Manual review, VS code
Add reward to be called in the middle of the epoch, this will guarantee that at the end of it, the calculations about the rewards will be calcualted correctly.
Only the addReward() function to be able to trigger the roll of an epoch. This is possible, because _redeem()(as most important) and all other functions are using the currentEpoch state variable which is only updated on epoch roll over.
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.