Core Contracts

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

Total Supply Limit Check Mismatch Between Locked Tokens and Minted veRAAC Tokens

Summary

The lock() function enforces a total supply limit check by comparing totalSupply() + amount against MAX_TOTAL_SUPPLY. However, the amount represents the raw RAAC tokens locked, while the number of veRAAC tokens minted is derived from a calculation based on the lock’s duration and weight. This discrepancy could lead to a mismatch between the intended total supply limit and the actual veRAAC token supply.

Vulnerability Details

In the lock() function, the following check is used:

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

Here, amount is the raw amount of RAAC tokens the user is locking. However, the contract mints veRAAC tokens based on a formula that takes into account the lock’s duration and weight. This means the minted veRAAC tokens may not be equal to the raw amount locked.

The total supply limit (MAX_TOTAL_SUPPLY) appears to be intended for the veRAAC token supply. By adding the raw token amount to totalSupply(), the check might either:

  • Over-restrict the minting process if the calculated veRAAC tokens are lower than the raw amount, or

  • Fail to properly enforce the intended cap if the calculated tokens exceed the raw amount.

This issue exists in the lock() function:

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

The mismatch arises because the veRAAC tokens minted later are computed via:

(int128 bias, int128 slope) = _votingState.calculateAndUpdatePower(msg.sender, amount, unlockTime);
uint256 newPower = uint256(uint128(bias));
_mint(msg.sender, newPower);

Therefore, the supply limit is being checked against the raw amount, not the resulting newPower.

Impact

This discrepancy may lead to incorrect enforcement of the total supply cap. This could either prevent users from locking tokens when they actually should be able to (if the raw amount is higher than the minted veRAAC) or allow the veRAAC supply to exceed the intended limit (if the conversion yields a higher value). Either scenario might impact the protocol’s tokenomics, governance, and reward distribution mechanisms.

Tools Used

Manual Review

Recommended Mitigation

Modify the check to use the calculated mint amount (e.g., newPower) instead of the raw amount. For example:

uint256 newPower = uint256(uint128(bias));
if (totalSupply() + newPower > MAX_TOTAL_SUPPLY) revert TotalSupplyLimitExceeded();
Updates

Lead Judging Commences

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