Core Contracts

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

Incorrect Total Supply Check in veRAACToken.sol lock Function

Summary & Vulnerability Details

In the veRAACToken contract, the lock function attempts to limit the total minted supply by comparing totalSupply() + amount to a maximum threshold, MAX_TOTAL_SUPPLY. The goal is to ensure that the total supply of veRAACToken never exceeds 100,000,000e18

/**
* @notice Maximum total supply of veRAACToken
*/
uint256 private constant MAX_TOTAL_SUPPLY = 100_000_000e18;
/**
* @notice Creates a new lock position for RAAC tokens
* @dev Locks RAAC tokens for a specified duration and mints veRAAC tokens representing voting power
* @param amount The amount of RAAC tokens to lock
* @param duration The duration to lock tokens for, in seconds
*/
function lock(uint256 amount, uint256 duration) external nonReentrant whenNotPaused {
......
if (totalSupply() + amount > MAX_TOTAL_SUPPLY) revert TotalSupplyLimitExceeded();
......
}

Here, amount represents the user’s deposited assets(raacToken) to acquire veRAACToken, but this deposit value is not necessarily in a 1:1 ratio with the actual veRAACToken minted. Consequently, using amount directly in this check causes the total supply limit validation to be incorrect. The function does not accurately enforce the intended maximum total supply limit, potentially allowing the real total supply of veRAACToken to exceed MAX_TOTAL_SUPPLY.

Impact

Because the total supply check relies on a potentially misleading parameter (amount), the mechanism to prevent over-minting is ineffective.Attackers or users could use this flaw to mint more tokens than intended by the contract’s design, undermining trust and stability of the protocol.

Tools Used

Manual review of veRAACToken.sol

Recommendations

To accurately enforce the maximum supply constraint, move the total supply check to occur immediately after the _mint call. For example:

function lock(uint256 amount, uint256 duration) external nonReentrant whenNotPaused {
......
// Mint veTokens
_mint(msg.sender, newPower);
// Perform the check after minting to ensure updated total supply
if (totalSupply() > MAX_TOTAL_SUPPLY) {
revert TotalSupplyLimitExceeded();
}
}
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.