The claimRewards() function does not update the user's last claim time (lastClaimTime) after successfully transferring rewards. This omission can lead to incorrect reward calculations in future claims and potentially allow users to claim rewards multiple times within the same distribution period.
Incorrect Reward Calculations:
The _calculatePendingRewards() function relies on the lastClaimTime to determine the time elapsed since the user's last claim. Without updating this value, future reward calculations may be incorrect, leading to unfair distributions.
Potential Double-Spending:
A user could potentially claim rewards multiple times within the same distribution period if the lastClaimTime is not updated, leading to double-spending of rewards.
Violation of Time-Weighted Reward Design:
The contract is designed to distribute rewards based on time-weighted averages. Failing to update the lastClaimTime undermines this design, as the contract cannot accurately track the time since the user's last claim.
Manual Review
Add a call to _updateLastClaimTime(user) after transferring rewards to the user:
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.