The `claimRewards()` function incorrectly updates `userRewards[user]`, causing users to lose access to unclaimed rewards and preventing them from claiming rewards after their first claim.
In the claimRewards() function, the contract incorrectly updates userRewards[user] by setting it to totalDistributed instead of properly updating it with the claimed rewards:
Since totalDistributed represents the total rewards distributed to all users, this could lead to incorrect calculations in _calculatePendingRewards() for subsequent claims:
As a result, users lose access to unclaimed rewards.
Note: Suppose a user is eligible for 1% of totalDistributed. Their pendingReward will remain 0 until totalDistributed increases 100 times.
Users will be unable to claim any further rewards after their first claim.
vscode
Just add the pendingReward:
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.