Core Contracts

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

Incorrect Supply Check in `veRAACToken::lock` Function: Comparing veRAAC Supply with RAAC Token Amounts

Summary

The lock function in the veRAACToken contract incorrectly compares the total supply of veRAAC tokens (totalSupply() + amount) against MAX_TOTAL_SUPPLY. This comparison mixes units, as totalSupply() represents veRAAC tokens, while amount represents RAAC tokens. The correct check should compare the total locked RAAC tokens (_lockState.totalLocked + amount) against MAX_TOTAL_LOCKED_AMOUNT. This issue could lead to incorrect enforcement of the maximum locked amount, potentially allowing users to lock more RAAC tokens than intended.

Vulnerability Details

The lock function enforces a maximum total supply of veRAAC tokens by checking:

if (totalSupply() + amount > MAX_TOTAL_SUPPLY) revert TotalSupplyLimitExceeded();

However, this comparison is flawed because:

  • totalSupply() returns the total supply of veRAAC tokens, which are not directly equivalent to RAAC tokens.

  • amount represents the amount of RAAC tokens being locked.

  • The correct comparison should be between the total locked RAAC tokens (_lockState.totalLocked + amount) and MAX_TOTAL_LOCKED_AMOUNT.

Impact

  • The incorrect comparison undermines the protocol's design, which is intended to limit the total amount of RAAC tokens that can be locked.

Tools Used

Manual Review

Recommendations

Update the lock function to compare the total locked RAAC tokens against MAX_TOTAL_LOCKED_AMOUNT.

Updates

Lead Judging Commences

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

`veRAACToken::lock` function doesn't check MAX_TOTAL_LOCKED_AMOUNT

Support

FAQs

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