Wrong calculation of reward due to penaltyAmount
PenaltyAmount levied on early claimer is not transferred out of the contract but totalRewards is subtracted by penaltyAmount as well as rewardAmount.
The issue is totalRewards is used for calculating pendingRewards, which subtracts the totalRewards from contract balance. We reduced totalRewards by penaltyAmount but did not transfer it out from contract therefore contract balance is greater than totalRewards due to penaltyAmount & this penaltyAmount will be considered as reward and will be distributed to stakers
_checkEpochRollover(), which calculates the pendingRewards using totalRewards
This is a loss to protocol as penaltyAmount is distributed to other stakers
VS code
Remove the penaltyAmount from contract from contract
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.