Core Contracts

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

Missing Implementation of _updateLastClaimTime in FeeCollector Contract

Summary

The function _updateLastClaimTime in the FeeCollector contract is declared but not implemented, which results in the failure to properly track the timestamp of when a user last claimed rewards. This introduces a potential flaw in the contract, where users could potentially exploit the lack of tracking to claim rewards multiple times within a short window, bypassing intended cooldown periods or frequency limits.

Vulnerability Details

The vulnerability arises from the incomplete implementation of the function _updateLastClaimTime in the FeeCollector contract. While this function is declared in the contract, it has not been implemented, which causes missing functionality for updating and tracking the last claim time for users.

This function is expected to update the lastClaimTime mapping, which tracks the timestamp of when a user last claimed their rewards. Without this functionality, the contract fails to prevent users from claiming rewards multiple times within an undesired timeframe. As a result, users can exploit this flaw to claim rewards excessively, potentially bypassing business logic that was intended to prevent such behavior.

Impact

  • Excessive Claims: Users could potentially claim rewards more frequently than intended if there is no tracking of previous claim timestamps.

  • Reward Exploitation: If the contract is designed to restrict claims based on time (e.g., only allowing claims once per 24 hours), the missing timestamp could allow for abuse, leading to an unfair advantage or higher rewards than expected.

  • Incomplete Business Logic: The absence of this function also indicates other areas of incomplete contract implementation, which could lead to further security or usability issues in the future.

Tools Used

Manually

Recommendations

Implement the _updateLastClaimTime function as intended, within the claimRewards function (or any other function that involves reward distribution) to track the last claim timestamp for users.

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);
+ _updateLastClaimTime(user);// Update the last claim time after the transfer
emit RewardClaimed(user, pendingReward);
return pendingReward;
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 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.