Core Contracts

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

Total Locked Amount Not Decreased on Withdrawals Leading to Accounting Issues

Summary :

The veRAACToken contract fails to decrease _lockState.totalLocked when users withdraw their tokens, causing incorrect accounting of total locked tokens and potential system-wide issues.

Vulnerability Details :

the issue exist in :

function withdraw() external nonReentrant {
LockManager.Lock memory userLock = _lockState.locks[msg.sender];
if (userLock.amount == 0) revert LockNotFound();
if (block.timestamp < userLock.end) revert LockNotExpired();
uint256 amount = userLock.amount;
uint256 currentPower = balanceOf(msg.sender);
// Clear lock data
delete _lockState.locks[msg.sender];
delete _votingState.points[msg.sender];
// Update checkpoints
_checkpointState.writeCheckpoint(msg.sender, 0);
// Burn veTokens and transfer RAAC
_burn(msg.sender, currentPower);
raacToken.safeTransfer(msg.sender, amount);
// Missing: _lockState.totalLocked -= amount;
}

As we can see totalLocked never decreases .

Impact :

  1. Incorrect Total Value Locked (TVL) reporting that cause Broken boost calculations that rely on totalLocked.

  2. Potential DOS when totalLocked reaches uint256 max ( likelihood is low but it will happen ) .

Tools Used :

  • Manual code review

Updates

Lead Judging Commences

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

veRAACToken::withdraw / emergencyWithdraw doesn't substract the `_lockState.totalLocked`

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

veRAACToken::withdraw / emergencyWithdraw doesn't substract the `_lockState.totalLocked`

Support

FAQs

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

Give us feedback!