Core Contracts

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

incorrect max veerac cap forced on users

Summary

when locking raac the code in the lock function checks if amount is more than max lock amount

the validation is on the assumption that veerac is minted 1:1 to raac however this is false and results in the max amount cap being harsh on users


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

here in calculatandupdatepower function we can see the formula used to determine how many veeracs user gets is based on his amount and lock time

uint256 duration = unlockTime - block.timestamp;
uint256 initialPower = (amount * duration) / MAX_LOCK_DURATION; // Normalize by max duration

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/libraries/governance/VotingPowerLib.sol#L89-L90
example scenario

amount = 11,000,000
duration = 2 years = 2 * 365 * 24 * 60 * 60 = 63,072,000 seconds
MAX_LOCK_DURATION = 4 years = 4 * 365 * 24 * 60 * 60 = 126,144,000 seconds

uint256 amount = 11_000_000;
uint256 duration = 2 * 365 * 24 * 60 * 60; // 63,072,000 seconds
uint256 MAX_LOCK_DURATION = 4 * 365 * 24 * 60 * 60; // 126,144,000 seconds
uint256 initialPower = 5_500_000;

which means the final veeRAAC amount minted is 5.5 million for 11 million lock amount which is well within the max veerac amount

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/tokens/veRAACToken.sol#L69

impact

harsh cap limit on users applied

Recommendations

the cap should be on the final mint amount

Updates

Lead Judging Commences

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

Give us feedback!