withdraw
and emergencyWithdraw
functions in veRAACToken contract are defined as follows:
We can see that when a withdrawal occurs, the user's lock is deleted with delete _lockState.locks[msg.sender];
. The problem arises because _lockState.totalLocked
is not decremented by the withdrawn amount.
totalLocked
field value will be systematically over-estimated. The more time passes, the more it will be over-estimated.
Because totalLocked
is never decremented during withdrawals, _boostState
will be wrong: indeed, internal function _updateBoostState
executes the following line:
The will induce an incorrect computation of boosts.
The impact of this issue can be considered as high as it will lead to wrong calculation of boost for users. Also, core internal accounting for locks is broken.
Manual review.
Make sure to update _lockState.totalLocked
in withdraw
and emergencyWithdraw
functions.
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.