The increaseLock function in the LockManager library is designed to allow users to add more tokens to their existing lock. However, there is a logical error in the increase function of the veRAACToken contract where the userLock.amount is incorrectly added twice: once in increaseLock and again in the increase function. This results in an incorrect calculation of the total locked amount and voting power, leading to potential inconsistencies in the contract state.
The increaseLock function in the LockManager library correctly updates the lock.amount and state.totalLocked by adding the additionalAmount.
However, in the increase function of the veRAACToken contract, the userLock.amount is added again when calculating the new voting power:
Here the userLock.amount + amount is incorrect, leading to the incorrect result of the newBias.
Incorrect Voting Power: The voting power calculation is inflated because the additionalAmount is added twice.
State Inconsistency: The total locked amount and voting power do not accurately reflect the actual state of the contract.
Unfair Advantage: Users who increase their lock may receive more voting power than they are entitled to.
The impact is High, the likelihood is High, so the severity is High.
Manual Review
Consider following fix:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.