> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperlane.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Bridge a Token

<Info>
  **This guide is for EVM-based chains.** For other environments, check out:

  * [SVM Hyperlane Warp Route Guide](/docs/guides/warp-routes/svm/svm-warp-route-guide)
  * [EVM ↔ SVM Hyperlane Warp Route Guide](/docs/guides/warp-routes/evm-svm-warp-route-guide)
  * [Cosmos Hyperlane Warp Route Guide](/docs/guides/warp-routes/cosmos/cosmos-warp-route-guide)
  * [EVM ↔ Cosmos Hyperlane Warp Route Guide](/docs/guides/warp-routes/evm-cosmos-warp-route-guide)
  * [Cosmos ↔ SVM Hyperlane Warp Route Guide](/docs/guides/warp-routes/cosmos-svm-warp-route-guide)
</Info>

This section provides a step-by-step walkthrough for creating an interchain token bridge by deploying Hyperlane Warp Route (HWR) contracts.

## Prerequisites

* [Hyperlane CLI](/docs/reference/developer-tools/cli)
* A private key for contract transaction signing

## 1. Configuration

### HWR deployment config

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

* Which token, on which chain, is this HWR being created for?
* *Optional:* Hyperlane connection details, such as contract addresses for the [Mailbox](/docs/reference/addresses/deployments/mailbox), [Interchain Gas](/docs/reference/hooks/interchain-gas), and [Interchain Security Modules](/docs/protocol/ISM/modular-security#core-concepts).
* *Optional:* Token standard, including ERC20 (fungible tokens), ERC721 (NFTs), and ERC4626 (yield-bearing tokens). Note ERC721 support is experimental and some Hyperlane tooling won't work for NFTs yet.

The easiest way to create a HWR deployment config file is with the CLI's config command:

```
hyperlane warp init
```

This command provides a walkthrough, prompting you for configuration choices directly in the terminal. You will be asked to select specific options for each part of the configuration, such as the network type, chains to connect, token type, and whether to use trusted ISMs.

<Info>
  * If your config looks correct, you can now skip to [Step 2:
    Deployment](#2-deployment). Or see below for details on how to define your
    config manually.
  * If you need any help setting up a token bridge, reach out on [GitHub Discussions](https://github.com/hyperlane-xyz/hyperlane-monorepo/discussions) or [get in touch](https://forms.gle/KyRTaWvo4XNmNvrq6).
</Info>

#### Deployment config schema

Your config consists of a map of chain names to deployment configs. Each config sets details about the token for which you are creating a HWR.

* **type**:
  * Set this to `collateral` to create a basic HWR for an ERC20/ERC721 token
  * Set this to `collateralVault` to create a yield-bearing HWR for an ERC20 token that deposits into an existing ERC4626 vault
  * Set this to `native` to create a HWR for a native token (e.g. ether)

* **address:**
  * If using `collateral`, the address of the ERC20/ERC721 contract for which to create a route
  * If using `collateralVault`, the address of the existing ERC4626 vault to deposit collateral into

* **isNft:** If using `collateral` for an ERC721 contract, set to `true`.

#### Optional fields[​](#optional-fields "Direct link to 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](/docs/reference/registries#default-registry).

* **symbol:** The token symbol
* **name:** The token name
* **decimals:** The number of decimal places for the token
* **mailbox:** The address of the [mailbox](/docs/reference/addresses/deployments/mailbox) contract to use to send and receive messages
* **interchainSecurityModule:** The address of an [interchain security modules](/docs/protocol/ISM/modular-security#core-concepts) to verify interchain messages

#### Example[​](#example "Direct link to Example")

For a minimal Warp deployment config example using local anvil chains, see [`warp-route-deployment.yaml`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/warp-route-deployment.yaml).

<Info>
  * Learn more about HWR types and the different configurations in the following sections:

    * [HWR Types](/docs/protocol/warp-routes/warp-routes-types)
    * [HWR Example Usage](/docs/protocol/warp-routes/warp-routes-example-usage)
</Info>

### Chain Configurations

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](https://github.com/hyperlane-xyz/hyperlane-registry), you must specify chain metadata for them. See the [CLI reference](/docs/reference/developer-tools/cli) for details.

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

```
hyperlane registry list
```

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

```
hyperlane registry init
```

Or you can define the config manually. See the [ChainMetadata type](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/metadata/chainMetadataTypes.ts#L62) for its schema. See [chain-config.yaml](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/chain-config.yaml) for an example.

<Warning>
  Where possible, be sure to **reuse any existing chains** from the registry/CLI
  in your HWR config instead of setting up a new mailbox.
</Warning>

## 2. Deploy the HWR

Once your configuration is ready, initiate the HWR deployment with:

```
hyperlane warp deploy
```

During deployment, the CLI requires access to your private key to sign transactions. You can set this up in one of two ways:

1. **Environment Variable**: Set your private key as HYP\_KEY to avoid entering it each time:

   ```
   export HYP_KEY=<your_private_key>
   ```

2. **Manual Entry**: Alternatively, you can enter the private key directly when prompted during deployment.

The `hyperlane warp deploy` command will create deployment artifacts in your local registry at `$HOME/.hyperlane/deployments/warp_routes/<warpRouteId>/`.

The warp route ID follows the format `SYMBOL/id` (e.g., `ETH/yourid`). This ID is used with CLI commands like `warp read`, `warp send`, and `warp apply`.

<Info>
  Warp route configs are stored in the registry. To modify a warp route config, edit the files in `$HOME/.hyperlane/deployments/warp_routes/<warpRouteId>/` and then run `hyperlane warp apply`.
</Info>

### Testing

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

```
hyperlane warp send --relay -w TOKEN/chain1-chain2
```

The `--relay` flag is optional and will relay the message to the destination chain. `--relay` only works when both origin and destination are EVM chains.

For non-EVM routes, see the [CLI Warp Send reference](/docs/reference/developer-tools/cli#warp-send).

You can also run a relayer that delivers only for your HWR in the background with:

```
hyperlane relayer -w TOKEN/chain1-chain2
```

You can test in either direction between where you have the HWR set. However, if you deployed `native` or `collateral` HWR, you must select the origin where the route corresponding to where that `native` or `collateral` type is deployed. By default, the amount sent is `1` of the smallest unit of the token.

<Tip>
  You can also use just the symbol (e.g., `-w ETH`) and the CLI will auto-select if there's only one matching route, or prompt you to choose if multiple exist.
</Tip>

<Info>
  **Next Steps**

  * If you were following the [Deploy Hyperlane to a new chain](/docs/guides/chains/deploy-hyperlane#3-hyperlane-warp-route) guide and want to connect other chains or move to production with Abacus Works, continue with the [Submit to Registry](/docs/guides/chains/deploy-hyperlane#4-submit-to-registry) guide.

  * For interacting with HWRs via a UI, continue to the [Warp UI docs](/docs/guides/warp-routes/bridge-ui-guide).
</Info>

## Learn More

* Check out the [HWR](docs/applications/warp-routes/overview) reference page for more information on the interface and security implications of a HWR. The [interface](docs/applications/warp-routes/overview#interface) section covers calling `transferRemote` to transfer tokens to a specified recipient on a destination chain. Note that you'll have to prompt for a token approval prior to calling `transferRemote`.

* A HWR is a type of [router](/docs/reference/developer-tools/libraries/router) application, a pattern enabling you to link multiple contracts across chains together.
