Skip to content

withdraw ​

solidity
function withdraw(address token, uint256 amount) external

Transfers a caller's previously credited token balance from the escrow contract.

The amount must be greater than zero and no greater than:

solidity
userBalances[msg.sender][token]

The contract reduces the internal balance before calling token.transfer, following checks-effects-interactions ordering within this function.

Reverts ​

  • InvalidAmount()
  • InsufficientBalance()
  • TransferFailed()

A reverting token call reverts the entire transaction, including the preceding balance reduction.

Documentation grounded in the current ERC-20 escrow implementation.