The veRAACToken#lock() allows users to create a lock for their RAACTokens, granting them voting power. However, the function does not check whether the user already has an existing lock. As a result due to overwrite the previous lock, it will lead the loss of previously locked funds.
If a user already has a lock and calls lock() again, the old lock is replaced with a new one.
The previously locked tokens remain in the contract but become inaccessible to the user.
There is no way for the user to withdraw or recover these locked funds even transfer is unavailable in _update().
Proof Of Code
Testcode is written in veRAACToken.test.js
As seen in the POC, first lock amount1 is overwritten by second lock amount2 and user has only second lock amount2.
User's RAACTokens are locked
manual, hardhat
Modify the lock() function to reject users who already have a lock and instruct them to use increaseLock() instead.
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.