The increase
function in the veRAACToken.sol
contains a bug where the lock amount is counted twice when calculating voting power, leading to inflated voting power for users who increase their lock amounts.
Looking at the increase
function, we can see that the amount is double-counted during voting power calculation:
_lockState.increaseLock(msg.sender, amount)
adds the amount to the user's lock. userLock = _lockState.locks[msg.sender]
loads the lock that already includes the new amount and calculateAndUpdatePower
is called with userLock.amount + amount
, effectively adding the amount twice
Inflated voting power for users who increase their lock amounts. Also, lead to incorrect governance voting weight calculations thereby providing unfair boost multipliers in the protocol.
Manual code review
Fix the double-counting by removing the second addition of amount:
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.