Build
Architecture
protocol
contracts
evm
interfaces
IERC20Custody.sol
Interface.ierc20custody

Interface.ierc20custody

Git Source (opens in a new tab)

Inherits: IERC20CustodyEvents, IERC20CustodyErrors

whitelisted

Mapping of whitelisted tokens => true/false.

function whitelisted(address token) external view returns (bool);

withdraw

Withdraw directly transfers the tokens to the destination address without contract call.

This function can only be called by the TSS address.

function withdraw(address token, address to, uint256 amount) external;

Parameters

NameTypeDescription
tokenaddressAddress of the ERC20 token.
toaddressDestination address for the tokens.
amountuint256Amount of tokens to withdraw.

withdrawAndCall

WithdrawAndCall transfers tokens to Gateway and call a contract through the Gateway.

This function can only be called by the TSS address.

function withdrawAndCall(
    MessageContext calldata messageContext,
    address token,
    address to,
    uint256 amount,
    bytes calldata data
)
    external;

Parameters

NameTypeDescription
messageContextMessageContextMessage context containing sender.
tokenaddressAddress of the ERC20 token.
toaddressAddress of the contract to call.
amountuint256Amount of tokens to withdraw.
databytesCalldata to pass to the contract call.

withdrawAndRevert

WithdrawAndRevert transfers tokens to Gateway and call a contract with a revert functionality through the Gateway.

This function can only be called by the TSS address.

function withdrawAndRevert(
    address token,
    address to,
    uint256 amount,
    bytes calldata data,
    RevertContext calldata revertContext
)
    external;

Parameters

NameTypeDescription
tokenaddressAddress of the ERC20 token.
toaddressAddress of the contract to call.
amountuint256Amount of tokens to withdraw.
databytesCalldata to pass to the contract call.
revertContextRevertContextRevert context to pass to onRevert.

Continue Learning

Continue with the next part or try a related tutorial

Feedback
How has your developer experience been?
Share your feedback and help improve it for everyone.