Core Contracts

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

"The `lastClaimTime` mapping is not updated anywhere in the `FeeCollector` contract."

Summary

The function _updateLastClaimTime, which updates the lastClaimTime mapping, is not called anywhere.

Vulnerability Details

The _updateLastClaimTime function updates the lastClaimTime mapping and should be called when the user claims rewards by calling the claimRewards function.

The claimRewards function should call _updateLastClaimTime to update the mapping whenever the user claims their reward.

function _updateLastClaimTime(address user) internal {
lastClaimTime[user] = block.timestamp;
}
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;
// Transfer rewards
raacToken.safeTransfer(user, pendingReward);
emit RewardClaimed(user, pendingReward);
return pendingReward;
}

Impact

The contract will lose track of users' claim times.

Recommendations

  1. Update the lastClaimTime while user claims the rewards.

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();
+ _updateLastClaimTime(user);
// Reset user rewards before transfer
userRewards[user] = totalDistributed;
// Transfer rewards
raacToken.safeTransfer(user, pendingReward);
emit RewardClaimed(user, pendingReward);
return pendingReward;
}
Updates

Lead Judging Commences

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

_updateLastClaimTime not properly used to track rewards claim time

Support

FAQs

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

Give us feedback!