Function: withdraw()
This function ensures that users can only withdraw their lockedToken after the lockup period ends and then call the _burn function to destroy the user's lockedToken.
Branches and code coverage
Intended branches
Reset the user's lockout amount and end time to zero.
Call the
_burnfunction to destroy the user's lockedToken.Get the lockedToken balance available in the contract. If the balance is not enough to pay the user's withdrawal request, call
_withdrawFromGaugeto make up the difference.Use
safeTransferto transfer the locked tokens back to the user.
Negative behavior
Revert if the user's lock amount is zero.
Revert if lock has not expired.