The lock
function in the veRAACToken
contract is designed to allow users to lock RAAC tokens and receive veRAAC tokens representing voting power. However, there is a critical issue where a user can call the lock
function multiple times, overwriting their existing lock while still receiving new veRAAC tokens. This leads to a situation where users have veRAAC tokens but cannot withdraw their locked RAAC tokens.
When a user calls lock
, the function overwrites their existing lock state without checking if they already have an active lock. Since the previous lock is overwritten, userLock.amount
will only reflect the most recent lock, effectively deleting the earlier locked amount.
Withdraw only checks locked amount not token balanca. Because of this even though the user has veRAAC tokens minted from multiple locks, they cannot withdraw their previously locked RAAC tokens, leading to a loss of funds.
Users lose access to previously locked RAAC tokens if they lock new tokens before withdrawing their previous lock
Manual
Before processing a new lock, the function should check whether the user already has an active lock and revert if they do.
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.