The increase
function in the veRAACToken
contract contains an issue where the lock amount is incorrectly calculated during voting power updates. Specifically, the function adds the amount
parameter twice: once in _lockState.increaseLock
and again in the voting power calculation. This redundancy leads to incorrect voting power calculations, potentially allowing users to gain more voting power than intended.
The issue arises in the increase
function, where the lock amount is updated in _lockState.increaseLock
and then incorrectly used in the voting power calculation.
_lockState.increaseLock
:
This function increases the lock amount by additionalAmount
and updates the lock.amount
and state.totalLocked
values.
After this call, lock.amount
already includes the additionalAmount
.
Voting Power Calculation:
The function retrieves the updated lock amount from _lockState.locks[msg.sender]
but incorrectly adds the amount
parameter again in the voting power calculation:
This results in the lock amount being counted twice, leading to incorrect voting power calculations.
The lock.amount
is already updated in _lockState.increaseLock
to include the amount
parameter.
The voting power calculation incorrectly adds the amount
parameter again, leading to double-counting.
Users may gain more voting power than intended, undermining the fairness of governance decisions.
Manual Review
The veRAACToken::increase
function should use the updated lock.amount
directly without adding the amount
parameter again. Here's the corrected code:
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.