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.
Check out the Warp Route reference page for more information on the interface and security implications of a Warp Route.
Prerequisites
- Hyperlane CLI
- A private key for contract transaction signing
1. Configuration
Warp Route deployment config
To deploy the route, you will need a Warp Route deployment 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. Note that ERC721 support is experimental and some Hyperlane tooling won't work for NFTs yet.
The easiest way to create one is with the CLI's config command:
hyperlane config create warp
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.
Deployment config schema
Your config consist of a map of chain names to deployment configs. Each config sets details about the token for which you are creating a Warp Route.
- type:
- Set this to
collateral
to create a basic Warp Route for an ERC20/ERC721 token. - Set this to
collateralVault
to create a yield-bearing Warp Route for an ERC20 token that deposits into an ERC4626 vault. - Set this to
native
to create a Warp Route for a native token (e.g. ether)
- Set this to
- address:
- If using
collateral
, the address of the ERC20/ERC721 contract for which to create a route - If using
collateralVault
, the address of the ERC4626 vault to deposit collateral into
- If using
- isNft: If using
collateral
for an ERC721 contract, set totrue
.
Optional fields
You may specify the following optional values in your config entries. If no values are provided, the deployer will attempt to pull these values from elsewhere. In the case of metadata (symbol, name decimals), it will query the contract. For addresses (mailbox, ISM) it will check the registry, either yours (if provided) or the default.
- symbol: The token symbol
- name: The token name
- decimals: The number of decimal places for the token
- 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
Example
For a minimal Warp deployment config example using local anvil chains, see warp-route-deployment.yaml
.
Chain configs
The deployment will require basic information about any chains it will be interacting with. If the target chains are not already in the Hyperlane Registry, you must specify chain metadata for them. See the CLI reference for details.
To see what chains are in the currently known, 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. See chain-config.yaml for an example.
2. Deployment
Run the following command to initiate the Warp Route deployment:
hyperlane deploy warp
Once finished, the CLI will create two new artifact files: [CHAIN_NAMES]-addresses.yaml
and [CHAIN_NAMES]-config.yaml
. The first contains just addresses for the newly deployed Warp router contracts. The second is a config file which can be used with the CLI and Warp UI to interact with the new Warp Route.
3. Testing
You can initiate a test transfer of a single wei with the following command:
hyperlane send transfer --warp YOUR_NEW_CONFIG_FILE.yaml
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
Next Step
Use the Hyperlane Warp UI app template for interacting with Warp Routes. Continue on to the Warp UI docs for details on how to set it up.