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 _burn function 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 _withdrawFromGauge to make up the difference.

  • Use safeTransfer to 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.

Zellic © 2025Back to top ↑