Git Source (opens in a new tab)

*ZetaTokenConsumer makes it easier to handle the following situations:

  • Getting Zeta using native coin (to pay for destination gas while using connector.send)
  • Getting Zeta using a token (to pay for destination gas while using connector.send)
  • Getting native coin using Zeta (to return unused destination gas when onZetaRevert is executed)
  • Getting a token using Zeta (to return unused destination gas when onZetaRevert is executed)*

The interface can be implemented using different strategies, like UniswapV2, UniswapV3, etc

getZetaFromEth

function getZetaFromEth(address destinationAddress, uint256 minAmountOut) external payable returns (uint256);

getZetaFromToken

function getZetaFromToken(
    address destinationAddress,
    uint256 minAmountOut,
    address inputToken,
    uint256 inputTokenAmount
)
    external
    returns (uint256);

getEthFromZeta

function getEthFromZeta(
    address destinationAddress,
    uint256 minAmountOut,
    uint256 zetaTokenAmount
)
    external
    returns (uint256);

getTokenFromZeta

function getTokenFromZeta(
    address destinationAddress,
    uint256 minAmountOut,
    address outputToken,
    uint256 zetaTokenAmount
)
    external
    returns (uint256);

hasZetaLiquidity

function hasZetaLiquidity() external view returns (bool);

EthExchangedForZeta

event EthExchangedForZeta(uint256 amountIn, uint256 amountOut);

TokenExchangedForZeta

event TokenExchangedForZeta(address token, uint256 amountIn, uint256 amountOut);

ZetaExchangedForEth

event ZetaExchangedForEth(uint256 amountIn, uint256 amountOut);

ZetaExchangedForToken

event ZetaExchangedForToken(address token, uint256 amountIn, uint256 amountOut);