Build
Architecture
protocol
contracts
zevm
interfaces
IGatewayZEVM.sol
Interface.igatewayzevm

Git Source (opens in a new tab)

Inherits: IGatewayZEVMErrors, IGatewayZEVMEvents

Interface for the GatewayZEVM contract.

Defines functions for cross-chain interactions and token handling.

withdraw

Withdraw ZRC20 tokens to an external chain.

function withdraw(
    bytes memory receiver,
    uint256 amount,
    address zrc20,
    RevertOptions calldata revertOptions
)
    external;

Parameters

NameTypeDescription
receiverbytesThe receiver address on the external chain.
amountuint256The amount of tokens to withdraw.
zrc20addressThe address of the ZRC20 token.
revertOptionsRevertOptionsRevert options.

withdraw

Withdraw ZETA tokens to an external chain.

function withdraw(
    bytes memory receiver,
    uint256 amount,
    uint256 chainId,
    RevertOptions calldata revertOptions
)
    external;

Parameters

NameTypeDescription
receiverbytesThe receiver address on the external chain.
amountuint256The amount of tokens to withdraw.
chainIduint256
revertOptionsRevertOptionsRevert options.

withdrawAndCall

Withdraw ZRC20 tokens and call a smart contract on an external chain.

function withdrawAndCall(
    bytes memory receiver,
    uint256 amount,
    address zrc20,
    bytes calldata message,
    uint256 gasLimit,
    RevertOptions calldata revertOptions
)
    external;

Parameters

NameTypeDescription
receiverbytesThe receiver address on the external chain.
amountuint256The amount of tokens to withdraw.
zrc20addressThe address of the ZRC20 token.
messagebytesThe calldata to pass to the contract call.
gasLimituint256Gas limit.
revertOptionsRevertOptionsRevert options.

withdrawAndCall

Withdraw ZETA tokens and call a smart contract on an external chain.

function withdrawAndCall(
    bytes memory receiver,
    uint256 amount,
    uint256 chainId,
    bytes calldata message,
    RevertOptions calldata revertOptions
)
    external;

Parameters

NameTypeDescription
receiverbytesThe receiver address on the external chain.
amountuint256The amount of tokens to withdraw.
chainIduint256Chain id of the external chain.
messagebytesThe calldata to pass to the contract call.
revertOptionsRevertOptionsRevert options.

call

Call a smart contract on an external chain without asset transfer.

function call(
    bytes memory receiver,
    address zrc20,
    bytes calldata message,
    uint256 gasLimit,
    RevertOptions calldata revertOptions
)
    external;

Parameters

NameTypeDescription
receiverbytesThe receiver address on the external chain.
zrc20addressAddress of zrc20 to pay fees.
messagebytesThe calldata to pass to the contract call.
gasLimituint256Gas limit.
revertOptionsRevertOptionsRevert options.

deposit

Deposit foreign coins into ZRC20.

function deposit(address zrc20, uint256 amount, address target) external;

Parameters

NameTypeDescription
zrc20addressThe address of the ZRC20 token.
amountuint256The amount of tokens to deposit.
targetaddressThe target address to receive the deposited tokens.

execute

Execute a user-specified contract on ZEVM.

function execute(
    zContext calldata context,
    address zrc20,
    uint256 amount,
    address target,
    bytes calldata message
)
    external;

Parameters

NameTypeDescription
contextzContextThe context of the cross-chain call.
zrc20addressThe address of the ZRC20 token.
amountuint256The amount of tokens to transfer.
targetaddressThe target contract to call.
messagebytesThe calldata to pass to the contract call.

depositAndCall

Deposit foreign coins into ZRC20 and call a user-specified contract on ZEVM.

function depositAndCall(
    zContext calldata context,
    address zrc20,
    uint256 amount,
    address target,
    bytes calldata message
)
    external;

Parameters

NameTypeDescription
contextzContextThe context of the cross-chain call.
zrc20addressThe address of the ZRC20 token.
amountuint256The amount of tokens to transfer.
targetaddressThe target contract to call.
messagebytesThe calldata to pass to the contract call.

depositAndCall

Deposit ZETA and call a user-specified contract on ZEVM.

function depositAndCall(zContext calldata context, uint256 amount, address target, bytes calldata message) external;

Parameters

NameTypeDescription
contextzContextThe context of the cross-chain call.
amountuint256The amount of tokens to transfer.
targetaddressThe target contract to call.
messagebytesThe calldata to pass to the contract call.

executeRevert

Revert a user-specified contract on ZEVM.

function executeRevert(address target, RevertContext calldata revertContext) external;

Parameters

NameTypeDescription
targetaddressThe target contract to call.
revertContextRevertContextRevert context to pass to onRevert.

depositAndRevert

Deposit foreign coins into ZRC20 and revert a user-specified contract on ZEVM.

function depositAndRevert(
    address zrc20,
    uint256 amount,
    address target,
    RevertContext calldata revertContext
)
    external;

Parameters

NameTypeDescription
zrc20addressThe address of the ZRC20 token.
amountuint256The amount of tokens to revert.
targetaddressThe target contract to call.
revertContextRevertContextRevert context to pass to onRevert.