Assessment reports>GTE -- Perp>Threat Model>cancelWithdraw

Function: cancelWithdraw(uint256 id)

This function allows a user to cancel their own previously queued withdrawal request, which is identified by the id parameter.

Inputs

  • id

    • Control: Full control.

    • Constraints: id must correspond to a queuedWithdraw initiated by the caller.

    • Impact: Affects queuedShares, queuedWithdraw, and _withdrawQueue.

Branches and code coverage

Intended branches

  • Removes the specified withdrawal from the queuedWithdraw mapping.

  • Decreases the user's total queuedShares by the amount of shares associated with the canceled withdrawal.

  • Updates the _withdrawQueue data.

  • Emits a WithdrawCanceled event.

Negative behavior

  • Reverts if the user tries to cancel a withdrawal they do not own.

Zellic © 2025Back to top ↑