Hyperlane is a permissionless interoperability layer that allows developers to connect any blockchain, out-of-the-box. Its primary goal is to unify the crypto user experience by connecting fragmented assets and chains.
This article will walk you through how to deploy a Warp Route with the Hyperlane CLI.
You can use Github CodeSpace, VPS or Ubuntu.
First download Yarn
npm install -g yarn
We need the Hyperlane CLI to deploy the Warp Route contract.
Run the following command to install the Hyperlane CLI.
yarn global add @hyperlane-xyz/cli
Continue entering the following command line. Remember to enter each command line.
yarn global bin
export PATH="$(yarn global bin):$PATH"
source ~/.bashrc
After entering the above commands, continue entering the command below.
hyperlane --version
This command is used to check the Hyperlane CLI version, if it looks like the image below, you did it correctly.
Before starting the contract deployment, you should create a burner wallet and send in small amounts of ETH for gas fees. Once the wallet is created, you’ll need to export the private key to allow the Hyperlane CLI to access it.
You should use a secondary wallet, or a wallet with less assets in it. Always be careful.
Run the following command in your terminal, replacing “YOUR_PRIVATE_KEY” with the private key of the burner wallet you created.
export HYP_KEY="YOUR_PRIVATE_KEY"
After exporting your private key, you can initialize the Hyperlane Warp Route with the following command:
hyperlane warp init
The Hyperlane CLI will automatically detect your wallet address from the private key you exported. You’ll be prompted to confirm the public key, type Y
in the prompt box to confirm.
Next, you’ll be prompted in the terminal to choose between mainnet and testnet. We will be working with mainnet chains for this tutorial walkthrough; select mainnet and then press enter.
Next you will see a long list of chains available to choose from. I want to bridge the token Coinbase Wrapped BTC (cbBTC) with the contract address 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf which is currently live on Base to BSC. Navigate to Base and BSC, use the spacebar button to select both chains, then hit enter.
The next step is configuring the warp route for the Coinbase Wrapped BTC token. There are few options available to configure a warp route:
Synthetic: Used when creating a new ERC-20 token on a new chain.
Collateral: Used for ERC-20 tokens that have been deployed on a particular chain.
Since the Coinbase Wrapped BTC token is live on Base, choose the collateral option.
The Hyperlane CLI will automatically detect the mailbox address for each chain from its registry. Confirm the detected mailbox address by typing Y
when prompted.
Next, you will be prompted to enter the contract address of the token:
0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf
This is the contract address for the Coinbase Wrapped BTC token on Base. You can buy some Coinbase Wrapped BTC on Aerodrome or Uniswap . You will need the Coinbase Wrapped BTC token to complete the Warp Route bridging.
Next step is configuring the warp route for the Coinbase Wrapped BTC token on BSC.
In this scenario, choose the synthetic option since the Coinbase Wrapped BTC token is not live on BSC. It’s essentially a new token being deployed and a new bridge route being configured by Hyperlane.
Again, confirm the mailbox address on BSC when prompted.
Our warp route configuration has been defined; the next step is to deploy the contract.
With the warp route configured, you can now deploy the warp route contract by running the command:
hyperlane warp deploy
You’ll be prompted with an option to use an API key to verify the contract. For this tutorial, type N
, as it's not necessary.
The CLI will then create a Warp Route Deployment Plan and it will prompt you to confirm if it’s correct. Type Y
to proceed.
If you get a warning in your terminal about “Deployment may fail due to insufficient balance(s)”, ensure you have at least $2 worth of ETH on Base and 2$ worth of BNB on BSC, then type Y
to proceed.
Once the deployment is complete, you’ll see a confirmation in your terminal. The output will include your warp route configuration, which should look something like this:
tokens:
- chainName: base
standard: EvmHypCollateral
decimals: 8
symbol: cbBTC
name: Coinbase Wrapped BTC
addressOrDenom: "0x773137689dCf05d8d610bC6a90b815bAC1D701C8"
collateralAddressOrDenom: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"
connections:
- token: ethereum|bsc|0xf86Ba45160ded3E5B9B9b051Fb0B8FC6621430d1
- chainName: bsc
standard: EvmHypSynthetic
decimals: 8
symbol: cbBTC
name: Coinbase Wrapped BTC
addressOrDenom: "0xf86Ba45160ded3E5B9B9b051Fb0B8FC6621430d1"
connections:
- token: ethereum|base|0x773137689dCf05d8d610bC6a90b815bAC1D701C8
The next thing you want to do is copy the warp route config output, and we are ready to bridge our Coinbase Wrapped BTC token to BSC.
Once the contract is deployed, you can now bridge the Coinbase Wrapped BTC token between the Base and BSC chains. To do this:
Go to the Hyperlane Superbridge app.
Click on the Settings icon.
Navigate to Warp Routes and click Customize.
Paste the warp route config output you copied into the box and hit Save.
Connect your wallet and choose the Base and BSC chains.
Select the amount of Coinbase Wrapped BTC tokens you want to bridge, and initiate the bridging process.
And the result
And you can also bridge Coinbase Wrapped BTC tokens from BSC to Base
And result
You can check if your bridging was successful on the hyperlane explorer:
And finally, don't forget to enter the command below into the terminal to delete the private key for wallet security.
unset HYP_KEY
Hyperlane provides a seamless and secure way to bridge tokens between blockchains. In this guide, we walk through deploying a Warp Route to bridge the Coinbase Wrapped BTC token from Base to BSC and vice versa.
Happy to contribute a little effort to build Base.
Good luck!!!