The increase
function in the veRAACToken
contract incorrectly calculates the new voting power by adding the amount
parameter to userLock.amount
. Since userLock
is assigned after _lockState.increaseLock(msg.sender, amount);
is called, userLock.amount
already reflects the updated value. This results in an inflated voting power calculation.
The issue occurs because increase
calls _lockState.increaseLock(msg.sender, amount);
first, which updates the lock amount in storage. Then, it retrieves userLock
from _lockState.locks[msg.sender]
, which already includes the updated amount. However, the function incorrectly adds amount
again, leading to an overestimation of voting power.
The following is the output from running the should allow users to increase lock amount
test. Console logs were added to the increase
function, placed right before the _lockState.increaseLock(msg.sender, amount);
line, immediately after it, and also to display the result of userLock.amount + amount
:
Governance manipulation: Users receive more voting power than they should, unfairly influencing governance decisions.
Boost miscalculations: _updateBoostState
relies on _votingState.calculateAndUpdatePower
, causing further inaccuracies in voting weight distribution.
Manual review of the contract’s logic.
Modify the increase
function to use userLock.amount
directly:
This ensures that voting power calculations accurately reflect the correct locked balance.
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.