In FeeCollector.sol, user can claim their RAAC rewards via claimRewards(). However, in this function. the updating of userRewardsmapping is done incorrectly, leading to user being unable to claim any subsequent rewards after the first claim.
In claimRewards(), the pending reward of a user is calculated via _calculatedPendingRewards(). However, as seen below, the userRewards mapping for the user is updated to totalDistributed.
function claimRewards(address user) external override nonReentrant whenNotPaused returns (uint256) {
if (user == address(0)) revert InvalidAddress();
TotalDistributedis the total RAAC tokens distributed historically to stakeholders - this amount would be the accounting for all distributions to veRAAC holders, treasury, repair fund, and to burn.
Assume this scenario that user had claimed rewards for the first time. Now, userRewards[user] = totalDistributed.
Now, user call claimRewards()for the second time. As seen in the code snippet above (Line 1), _calculatePendingRewards()is called.
After calculating userVotingPower and totalVotingPower, share is calculated. However, 0 will always be returned, because share will always be less than userRewards[user], since userRewards[user] = totalDistributed.
Once userRewards[user] has been set to be equals to totalDistributed, user can never claim any rewards - user can only claim once and never again.
Ensure the updating of userRewards[] mapping is done correctly in claimRewards()function in the FeeCollector.sol 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.