The current implementation of the lock mechanism in the veRAACToken contract can lead to a permanent lock of RAAC tokens.
The veRAACToken.sol::lock is used to lock RAAC tokens and gain voting power. It invokes the LockManager::createLock function in that process to create a Lock for the user locking RAAC tokens. Here's is how the LockManager::createLock function is implemented.
When users create a lock position for RAAC tokens using , a Lock is created, the amount to lock is sent
function to mint the equivalent amount of veRAACToken to the.
When a user creates a lock position using the veRAACToken::lock function, the veRAACToken gets the amount of RAAC token from the user and invokes the LockManager::createLock to create a Lock that stores the amount locked and the time by which the lock position ends.
The issue here is that there is no way to ensure that the veRAACToken::lock function is called only once by a same address. Which means if a user locks twice (maybe he didn't know creating a second lock will erase override the first or just forgot he already created a lock), the amount of the first time will be permanently locked since the second lock will erase the lock's amount (the 1st amount) and overrides its value.
Also, there is no way to recover those locked tokens since all the methods that allow a user to unlock his RAAC tokens only convert the amount of the lock and do not take into account the user's veRAACToken balance.
Permanent lock of user funds
Manual review.
Check whether the user has already created a Lock or not.
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.