The emergencyUnlockEnabled flag is set in the contract, but the withdraw function does not check it, rendering the emergency unlock feature ineffective. This issue prevents users from withdrawing locked tokens during an emergency unlock scenario before their lock expires.
Inwithdraw function in the veRAACToken contract, the executeEmergencyUnlock function that sets the emergencyUnlockEnabled flag.
The withdraw function only checks whether the lock has expired (block.timestamp < userLock.end) and does not consider the emergencyUnlockEnabled flag.
While the emergencyUnlockEnabled flag can be set via the executeEmergencyUnlock function, it has no effect on the withdraw function, which is the primary mechanism for users to retrieve their tokens after lock expiry.
This makes the emergency unlock feature non-functional in the context of normal withdrawal, as it doesn’t override the LockNotExpired check.
withdrawfunction
executeEmergencyUnlock function:
Users cannot withdraw locked tokens during an emergency unlock scenario before their lock expires, defeating the purpose of the emergencyUnlockEnabled feature.
The emergencyUnlockEnabled flag becomes redundant, as users must rely on the emergencyWithdraw function, which has its own activation process (enableEmergencyWithdraw) and delay (emergencyWithdrawDelay).
Users may expect an "emergency unlock" to enable immediate withdrawal without needing a separate emergencyWithdraw call
Modify the withdraw function to respect the emergencyUnlockEnabled flag, allowing withdrawal before lock expiry when enabled:
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.