Core Contracts

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

Incorrect veRAACToken Supply Check in lock Function

Summary

The lock function in the veRAACToken contract performs an incorrect supply check by comparing the total supply of veRAAC tokens (totalSupply()) with the amount of RAAC tokens being locked (amount). As a result, the contract may allow the total veRAAC supply to exceed the defined MAX_TOTAL_SUPPLY limit of 100 million tokens.

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/tokens/veRAACToken.sol

Vulnerability Details

incorrectly uses amount of RAACTokens to check VeRAACToken max supply.

problematic 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();// <--issue
if (duration < MIN_LOCK_DURATION || duration > MAX_LOCK_DURATION)
revert InvalidLockDuration();

This check is flawed because amount represents the raw RAAC token quantity, not the corresponding veRAAC equivalent.

Impact

Supply Dilution : The total veRAAC supply can exceed the intended limit of 100 million tokens, diluting the voting power and reward distribution for legitimate users.

Tools Used

manual review

Recommendations

The lock function should calculate the veRAAC equivalent before performing the supply check;

function lock(uint256 amount, uint256 duration) external nonReentrant whenNotPaused {
if (amount == 0) revert InvalidAmount();
if (amount > MAX_LOCK_AMOUNT) revert AmountExceedsLimit();
if (duration < MIN_LOCK_DURATION || duration > MAX_LOCK_DURATION)
revert InvalidLockDuration();
uint256 veAmount = calculateVeAmount(amount, duration); // Calculate veRAAC equivalent
if (totalSupply() + veAmount > 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.