https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/tokens/veRAACToken.sol#L226-L226
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/tokens/veRAACToken.sol#L312-L312
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/tokens/veRAACToken.sol#L371-L371
veRAACToken.sol::lock mechanism can lead to a permannet lock of RAAC funds
veRAACToken.sol::lock when creating a lock, calls this line which creates a lock on the lockState
_lockState.createLock(msg.sender, amount, duration);
The createLock method is implemented as follows.
When we create a lock, a certain amount of RAAC token is sent to the veRAACToken and we get an equivalent amount of veRAACToken minted to us and then a Lock is created indicating the amount locked and the endtime of the lock. All the other methods that permit to go the reverse route, that is, from veRAACToken to RAAC token only convert the amount of the lock and not a user defined value. In other words, the user can't determine which amount to unlock or convert other than the whole of the amount in the Lock to be withdrawn. These methods are:
The issue here is that, if I lock amounts X and an hour after I like amount Y. Given that, my lock state for amount X has now been overriden by that of amount Y, I can no longer recover my X amount of RAAC tokens I created the first lock with. This is because, that lock is nowhere to be found in the system to be unlcoked.
One might ask, why would the user create 2 locks? 2 answers come to my head quickly.
Said user lost track of the fact that, he had already created a lock
User thought that, creating a lock for the second time will update the existing lock with the additional amount and or new end time of the incoming lock. Given the impact and how trivial the fix is, I think this warrants fixing.
Permanent lock of user funds
Manual review
File: LockManager.sol
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.