Core Contracts

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

DOUBLE COUNTING LOCKED AMOUNT INCREASES VOTE POWER

Summary

The veRAACToken::increase() function incorrectly adds the amount to the total locked amount when calculating the new vote power, leading to double counting of tokens and inflated vote power.

Vulnerability Details

The veRAACToken::increase() function first increases the user's lock and then adds the amount and the current userLock.amount together when calculating the total locked amount. This results in double counting the locked tokens when calculating the user's new voting power, as both the original locked amount and the newly increased amount are included in the calculation.

File: veRAACToken.sol
252: // Increase lock using LockManager
253:> _lockState.increaseLock(msg.sender, amount);
254: _updateBoostState(msg.sender, locks[msg.sender].amount);
255:
256: // Update voting power
257: LockManager.Lock memory userLock = _lockState.locks[msg.sender];
258: (int128 newBias, int128 newSlope) = _votingState.calculateAndUpdatePower(
259: msg.sender,
260:> userLock.amount + amount,
261: userLock.end
262: );
263:

The issue arises because the function adds amount and userLock.amount again in the voting power calculation, which leads to an inflated vote power. This means that if a user initially locks just 1 wei, they can then increase the lock by any amount, and the newBias and newPower calculations will mistakenly count that 1 wei twice.

Impact

The vulnerability allows users to artificially inflate their vote power by:

  • Locking a minimal amount (such as 1 wei) and then increasing it, leading to double counting of their locked tokens.

  • Gaining vote power disproportionate to the actual amount of tokens locked, potentially manipulating governance outcomes.

Tools Used

vscode

Recommendations

Ensure that the amount is not added again when calling the voting power update function. Instead, pass the updated lock amount directly, without adding it twice.

Updates

Lead Judging Commences

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

veRAACToken::increase doubles the voting power of users

Support

FAQs

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

Give us feedback!