Core Contracts

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

incorrect lock amount checking in veRAACToken::lock()

Summary

incorrect lock amount checking in veRAACToken::lock()

Vulnerability Details

veRAACToken::lock() is for user to lock Raac tokens and get voting power represented by veRAACToken.

The implementation is as follow:

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 MAX_TOTAL_SUPPL is for veToken
if (duration < MIN_LOCK_DURATION || duration > MAX_LOCK_DURATION) //@audit no checking for MAX_TOTAL_LOCKED_AMOUNT
revert InvalidLockDuration();
// ...
}

before locking, lock amount is checked against some predefined parameters. However these checks are not implemented correctly. For example,

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

totalSupply() is total minted veToken, while amount is Raac token, and "MAX_TOTALSUPPLY" is a limitation for veToekn amount. Moreover, "MAX_TOTALLOCKED_AMOUNT ", the limitation of total locked amount is not checked

Impact

users may deposit more than protocol intended

Tools Used

manual

Recommendations

consider implement right restriction on locked amount

Updates

Lead Judging Commences

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

`veRAACToken::lock` function doesn't check MAX_TOTAL_LOCKED_AMOUNT

Support

FAQs

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