Warp Routes: Fast Native Transfers via Custom Gas Tokens
This document will walk you through how to use Hyperlane to enable fast native transfers to and from your L2 via a custom gas token.
Primary Motives
- Create a custom gas token to use on your L2 of choice.
- Use this gas token to enable fast native transfers, instead of long wait times for settlement via canonical bridges.
Pre-Requisites
To complete the following walkthrough, you should have the following available:
- A L2 network (”yourchain”) on which you are able to specify a custom gas token and would like to enable fast native transfers to and from.
- A sole deployer or authorized owner to receive mint of the receipt token (more information on this token below).
- An installed instance of the Hyperlane CLI and a wallet private key sourced as
HYP_KEY
, funded on all relevant networks.
Walkthrough: Fast Native Transfers
info
- Note that a “receipt token” below is a (one-time) mintable “dummy” token used to collateralize a warp-route on yourchain's corresponding L1. You will burn the minting rights to the token after creating it.
- Also, depending on your L2, the token symbol of your custom gas token may be assigned the same symbol as your receipt token. If deploying on ethereum, you may want to set your symbol to
ETH
.
1) Deploy a Receipt Token
Deploy an ETH
receipt token to ethereum to become your L2's custom gas token.
-
For example, you may deploy your receipt token via Remix with a funded wallet and a contract similar to below:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract YourchainETH is ERC20 {
constructor() ERC20("YourchainETH", "ETH") {
_mint(msg.sender, 10000000 * (10 ** 18));
}
} -
Ensure 100% of the total supply of your
ETH
receipt token is minted to the deployer or authorized address of choice. This must be a one-time mint event in order to avoid value dilution of the ethereum ↔ yourchain native warp route, below. -
Once deployed, save the address of the contract for use below.