Skip to main content

Overview

Mayan Forwarder serves as the unified entry point for interacting with Mayan’s cross-chain swap methods—Swift, MCTP, and Wormhole Swap. It streamlines integration by providing a single, secure interface and maintains a whitelist of trusted protocol addresses to mitigate risks from compromised quote data. The Forwarder contract is deployed across multiple EVM-compatible chains—including Ethereum, Arbitrum, Base, Optimism, Avalanche, Polygon, BSC, Unichain, Linea, HyperEVM and Monad. All share the same contract address:

Swap From EVM

To initiate a swap using an ERC20 token as input, you must first approve the required allowance for the Mayan Forwarder contract or alternatively provide a permit object to enable spending.
After approval, you can generate the complete transaction payload using the getSwapFromEvmTxPayload function from the Mayan SDK and then pass it to the Mayan Forwarder contract. If you need to build the payload manually and use Mayan Forwarder, you should choose the right method based on your input token:
  • forwardERC20: For input tokens that are ERC-20.
  • swapAndForwardERC20: Same as forwardERC20 but performs a swap on the source chain before bridging.
  • forwardEth: For input tokens that are native tokens of the chain.
  • swapAndForwardEth: Similar to forwardEth but performs a swap before bridging.