Core Contracts

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

malicious user can exceed total supply amount limit because of missing check in function

Summary

In veRAACToken.sol in increase function >>> missing check of (amount > MAX_LOCK_AMOUNT)or not and (totalSupply() + amount > MAX_TOTAL_SUPPLY)or not . malicious user can exceed total supply amount limit that will break PROTOCOL Rule .

Vulnerability Details

In veRAACToken.sol in increase function >>> missing check of (amount > MAX_LOCK_AMOUNT)or not and (totalSupply() + amount > MAX_TOTAL_SUPPLY)or not . That will break protocol rule . Notice marked commented line

function increase(uint256 amount) external nonReentrant whenNotPaused {
@>> // There missing check of `(amount > MAX_LOCK_AMOUNT)`or not and `(totalSupply() + amount > MAX_TOTAL_SUPPLY)`or not.
@>> //That can Exceed Max Amount limit
// Increase lock using LockManager
_lockState.increaseLock(msg.sender, amount);
_updateBoostState(msg.sender, locks[msg.sender].amount);
// Update voting power
LockManager.Lock memory userLock = _lockState.locks[msg.sender];
(int128 newBias, int128 newSlope) = _votingState.calculateAndUpdatePower(
msg.sender,
userLock.amount + amount,
userLock.end
);
// Update checkpoints
uint256 newPower = uint256(uint128(newBias));
_checkpointState.writeCheckpoint(msg.sender, newPower);
// Transfer additional tokens and mint veTokens
raacToken.safeTransferFrom(msg.sender, address(this), amount);
_mint(msg.sender, newPower - balanceOf(msg.sender));
emit LockIncreased(msg.sender, amount);
}

Think about a situation where malicious user can exceed those limits . that are mention in codebase

/**
* @notice Maximum total supply of veRAACToken
*/
uint256 private constant MAX_TOTAL_SUPPLY = 100_000_000e18; // 100M
/**
* @notice Maximum amount that can be locked in a single position
*/
uint256 private constant MAX_LOCK_AMOUNT = 10_000_000e18; // 10M

Impact

malicious user can exceed total supply amount limit that will break PROTOCOL Rule .

Tools Used

Recommendations

use check point in increase function .

Updates

Lead Judging Commences

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

veRAACToken::increase doesn't check the token supply, making it possible to mint over the MAX

Support

FAQs

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