Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: high
Valid

Incorrect assginment of userRewards in FeeCollector::claimRewards() after claiming rewards

Summary

Incorrect assginment of userRewards[user] in FeeCollector::claimRewards() after claiming rewards

Vulnerability Details

FeeCollector::claimRewards() if used for user to claim reward fee from feeCollector contract. state varible userRewards[user] stores each user's updated reward share. However it is incorrectly assigned as totalDistributed:

function claimRewards(address user) external override nonReentrant whenNotPaused returns (uint256) {
if (user == address(0)) revert InvalidAddress();
uint256 pendingReward = _calculatePendingRewards(user);
if (pendingReward == 0) revert InsufficientBalance();
// Reset user rewards before transfer
userRewards[user] = totalDistributed; //@audit
// Transfer rewards
raacToken.safeTransfer(user, pendingReward);
emit RewardClaimed(user, pendingReward);
return pendingReward;
}

Impact

user may not be able to claim rewards because of the incorrect assignment

Tools Used

manual

Recommendations

consider change the userRewards[user] to updated share.

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

FeeCollector::claimRewards sets `userRewards[user]` to `totalDistributed` seriously grieving users from rewards

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.