Core Contracts

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

Wrong check in function `veRAACToken::lock`.

Summary

The function veRAACToken::lock incorrectly assumes that 1 RAAC token is equal to 1 veRAAC token, leading to a flawed total supply validation. This miscalculation can bypass supply constraints or result in incorrect vesting allocations.

Vulnerability Details

In the function veRAACToken::lock, the following check is used to enforce the maximum total supply of veRAAC tokens:

if (totalSupply() + amount > MAX_TOTAL_SUPPLY) revert TotalSupplyLimitExceeded();
  • Issue:

    • Here, totalSupply() represents the total amount of veRAAC tokens minted so far, while amount refers to the RAAC tokens being locked.

    • This check assumes a 1:1 ratio between RAAC and veRAAC, which is incorrect.

    • In most veToken models, the amount of veTokens issued depends on the lock duration (e.g., longer locks yield more veTokens).

    • If the actual veRAAC minting logic scales based on lock duration, this check is inaccurate and could allow the total supply to exceed the intended limit.

Example Issue in Code:

function lock(uint256 amount, uint256 duration) external nonReentrant whenNotPaused {
if (amount == 0) revert InvalidAmount();
if (amount > MAX_LOCK_AMOUNT) revert AmountExceedsLimit();
if (totalSupply() + amount > MAX_TOTAL_SUPPLY) revert TotalSupplyLimitExceeded();@audit // Incorrect supply check
if (duration < MIN_LOCK_DURATION || duration > MAX_LOCK_DURATION)
revert InvalidLockDuration();
// Transfer RAAC tokens
raacToken.safeTransferFrom(msg.sender, address(this), amount);
// Calculate unlock time
uint256 unlockTime = block.timestamp + duration;
...
}
  • The correct total supply check should factor in the veRAAC conversion logic, ensuring the minted veTokens do not exceed MAX_TOTAL_SUPPLY.

Impact

  • Total veRAAC supply may exceed the intended cap due to an incorrect assumption in supply validation.

  • Governance manipulation risk as users may receive more veRAAC than expected.

  • Inaccurate supply constraints leading to economic imbalances in the protocol.

Tools Used

  • Manual review

Recommendations

  • Modify the total supply check to consider the veRAAC minting formula.

  • Ensure veRAAC minting logic correctly reflects the vesting model.

Updates

Lead Judging Commences

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

Incorrect `MAX_TOTAL_SUPPLY` check in the `veRAACToken::lock/extend` function of `veRAACToken` could harm locking functionality

Support

FAQs

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