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 aqueuedWithdraw
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.