Core Contracts

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

Wrong update will lead to users receiving less rewards in `FeeCollector`

Summary

Wrong update of the userRewards[user] mapping will lead to users receiving less rewards in FeeCollector. This is due to the mapping update with the totalDistributed variable as seen right here:

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;

Vulnerability Details

updating the userRewards[user] with totalDistributed is unreasonable because the user gets just a share of the totalDistributed, meaning he won't be able to get rewards for very long time until the shares he should receive exceed the mapping, and even if they do, the user will receive way less rewards than he should

Impact

Users being practically robbed of their rewards

Tools Used

Manual Review

Recommendations

Instead of updating the mapping with totalDistributed, update it with pendingReward. This will keep the reward distribution fair

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 month 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.