Function: withdraw(uint256 id, address trader, uint256 amount, uint8 v, byte[32] r, byte[32] s)
This function is for withdrawing the paymentToken, verifying the signature with given v, r, and s.
Inputs
idControl: Completely controlled by the caller.
Constraints: The
processedWithdrawalsof givenidmust not be true and must be the signedidfor the given signature.Impact: An
idto set as true on theprocessedWithdrawals.
traderControl: Completely controlled by the caller.
Constraints: This must be the signed
traderfor the given signature.Impact: The address to send the
paymentToken.
amountControl: Completely controlled by the caller.
Constraints: This must be the signed
amountfor the given signature, and the value must be bigger than zero.Impact: The amount to transfer.
vControl: Completely controlled by the caller.
Constraints: This must be a part of the valid signature with given
id,trader, andamount.Impact: A part of the signature to verify.
rControl: Completely controlled by the caller.
Constraints: This must be a part of the valid signature with given
id,trader, andamount.Impact: A part of the signature to verify.
sControl: Completely controlled by the caller.
Constraints: This must be a part of the valid signature with given
id,trader, andamount.Impact: A part of the signature to verify.
Branches and code coverage
Intended branches
Verify the given signature.
Send the
paymentTokento the giventrader.
Negative behavior
Revert when it fails to verify the signature.
Revert when the amount is not bigger than zero.
Revert when the given
processedWithdrawalsis already withdrawn.