Deplying Hyperlane Warp Routes for ERC20 Token Bridging

A. Objective

In this guide, we will show how to bridge WETH10 from L1 (Sepolia) to L2 (Rollup Testnet) using Hyperlane Warp Routes.

These steps apply to all other ERC-20 tokens on any AltLayer Rollup

B. Contract Deployment

For this tutorial, we will use the following addresses

Deployer: 0xC6391bAb6AfCc5dBDcbafA57C3340BbF9C800d33

Validator: 0x7C19F05dB313D89dea09781DF2c076EC1132C423

Relayer: 0x5d3C6567683d9467B2c317A02ddA5B97E20F6029

You will need to generate your own addresses for the following role. Please ensure they are funded with gas tokens

To begin, clone the hyperlane repo https://github.com/hyperlane-xyz/hyperlane-deploy and run

yarn install

Modify config/chains.ts with your chain configuration

The following is a sample configuration with L1 being Sepolia and L2 being AltLayer Testnet.

import { ChainMap, ChainMetadata } from '@hyperlane-xyz/sdk';

export const chains: ChainMap<ChainMetadata> = {
  sepolia: {
    name: 'sepolia',
    chainId: 11155111,
    nativeToken: {
      name: 'ether',
      symbol: 'ETH',
      decimals: 18,
    },
    publicRpcUrls: [
      {
        http: 'https://eth-sepolia.g.alchemy.com/v2/api-key',
      },
    ],
  },
  testnet: {
    name: 'testnet',
    chainId: 9997,
    nativeToken: {
      name: 'ALT',
      symbol: 'ALT',
      decimals: 18,
    },
    publicRpcUrls: [
      {
        http: 'https://testnet-rollup-api.altlayer.io',
      },
    ],
  },
};

Modify config/multisig_ism.ts. In this example, we will set it to 1. In the production environment, a higher threshold should be set.

Run the following command using the deployer private key to deploy the contracts on L1 (Sepolia)

Run the following command using the deployer private key to deploy the contracts on L2

After running the command, some artifacts will be produced. Here's a sample

  1. artifacts/addresses.json

  1. artifacts/agent_config.json

Modify config/warp_tokens.ts using values from artifacts/addresses.json. In this configuration, we filled the contract addresses of WETH10, the token we would like to bridge from L1 to L2.

Run this command using the deployer private key to deploy the wrap contracts. This will deploy the HypERC20 contracts to L2. In this example, the HypERC20 contract will be WETH10 on L2.

After running the command, artifacts will be produced

  1. artifacts/warp-token-addresses.json

  1. artifacts/warp-ui-token-list.json

Last updated