Skip to main content

Deploy a Warp Route

Create an interchain route for your token

A Warp Route is a type of router application, requiring a HypERC20 or HypERC721 token contract to be deployed on each chain you wish to support.

info

Check out the Warp Route reference page for more information on the interface and security implications of a Warp Route.

Prerequisites

1. Configuration

Warp Route config

To deploy the route, you will need a Warp Route config file. A valid config will specify:

  • Which token, on which chain, is this Warp Route being created for?
  • Optional: Hyperlane connection details including contract addresses for the mailbox, interchain gas, and interchain security modules.
  • Optional: The token standard - fungible tokens using ERC20 or NFTs using ERC721. Defaults to ERC20.

The easiest way to create one is with the CLI's config command:

hyperlane config create warp
tip

If your config looks correct, you can now skip to Step 2: Deployment. Or see below for details on how to define your config manually.

If you want to use custom chains(To use custom chains, first you need to deploy Hyperlane onto your chain) in your Warp Route config, use the --chains flag.

hyperlane config create warp --chains <PATH-TO-CHAINS-FILE>

Base

Your config must have exactly one base entry. Here you will configure details about the token for which you are creating a Warp Route.

  • chainName: Set this equal to the chain on which your token exists
  • type: Set this to TokenType.collateral to create a Warp Route for an ERC20/ERC721 token, or TokenType.native to create a Warp Route for a native token (e.g. ether)
  • address: If using TokenType.collateral, the address of the ERC20/ERC721 contract for which to create a route
  • isNft: If using TokenType.collateral for an ERC721 contract, set to true.

Synthetics

Your config must have at least one synthetics entry. Here you will configure details about the remote chains supported by your Warp Route.

  • chainName: Set this equal to the chain on which you want a wrapped version of your token

Optional fields

You may specify the following optional values in your base and synthetics entries. If no values are provided, values from core deployment artifacts will be used, either yours (if provided) or the SDK's.

  • mailbox: The address of the the mailbox contract to use to send and receive messages
  • interchainSecurityModule: The address of an interchain security modules to verify interchain messages
  • interchainGasPaymaster: The address of a interchain gas payments to pay for the gas needed to deliver interchain messages

Example

For a minimal Warp config example using local anvil chains, see warp-tokens.yaml.

Chain config

The Warp Route deployment will require basic information about any chains it will be interacting with. If the target chains include any not already in the Hyperlane SDK, you must specify chain metadata for it.

To see what chains are in the SDK, run the following command:

hyperlane chains list

To create a chain metadata config for any other chains, run the following command:

hyperlane config create chain

Or you can define the config manually. See the ChainMetadata type for its schema. A minimal example can be found in anvil-chains.yaml.

2. Deployment

Run the following command to initiate the Warp Route deployment:

hyperlane deploy warp
tip

If you are using custom chains(To use custom chains, first you need to deploy Hyperlane onto your chain) in your Warp Route config, don't forget to use the --chains flag.

hyperlane deploy warp --chains <PATH-TO-CHAINS-FILE>

Once finished, the CLI will create two new JSON artifact files: warp-deployment and warp-ui-token-config. The first contains just addresses for the newly deployed Warp router contracts. The second is a config file for the Warp UI, which you can use for the next optional step.

3. Testing

You can initiate a test transfer of a single wei with the following command:

hyperlane send transfer

If everything goes well, you should see the output similar to the following:

Waiting for message delivery on destination chain
Waiting for message delivery on destination chain
Waiting for message delivery on destination chain
Message delivered on destination chain!
Confirmed balance increase
Warp test transfer complete

4. (Optional) Warp UI

The Warp UI is a DApp template for interacting with Warp Routes. See the Warp UI docs for details on how to set it up.