Core Contracts

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

Mapping `lastClaimTime` is NOT getting updated in `claimRewards()`

Description

The function _updateLastClaimTime() is an internal function which updates the state variable lastClaimTime i.e. Source

function _updateLastClaimTime(address user) internal {
lastClaimTime[user] = block.timestamp;
}

This state variable gives us the latest time when the user last claimed his rewards. However, it does not get called from any other function making it completely useless.

Most likely it should have been called from claimRewards() as this is where a user can claim his pending rewards.
However, it has not been done, making the function completely obsolete.

Tools Used

Manual

Recommendations

Consider adding a call to function _updateLastClaimTime() in claimRewards() or directly update the mapping.

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!