Incorrect check for checking if user have claimed from the last epoch or not
User can claim their rewards using claimReward(), which gives them 2 options to either withdraw early by paying penaltyAmount or after claimCycle(no penalty)
Now there is a check, which ensures user doesn't have pending claimReceipt & user have not claimed from the last epoch. The problem is with later check as this will never be checked. Lets see how..
If user claimed early then claimReceipt is not created, directly funds are transferred to msg.sender. So therefore, claimReceipts[msg.sender].requestEpoch = 0, which means when next time user will come in same epoch or next epoch to claimReward, above check will not revert because requestEpoch is 0(zero)
If user claimed after claimCycle then claimReceipt is created with requestEpoch = currentEpoch. But the problem is when user completes his claim then claimReceipt is deleted, which means claimReceipts[msg.sender].requestEpoch = 0 As result when user claims again then above check will not revert because requestEpoch is 0(zero)
User will be able to claim rewards in the same epoch or next epoch, which is against the protocol working
Manual Review
Don't delete the claimReceipt or store the last claimed epoch of user in a mapping and check if this is last epoch or not
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.