Scripts for deploying Hyperlane contracts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
hyperlane-deploy/README.md

3.4 KiB

Hyperlane Deploy

Overview

Hyperlane is an interchain messaging protocol that allows applications to communicate between blockchains.

Developers can use Hyperlane to share state between blockchains, allowing them to build interchain applications that live natively across multiple chains.

To read more about interchain applications, how the protocol works, and how to integrate with Hyperlane, please see the documentation.

Deploying Hyperlane

For more detailed instructions on how to deploy Hyperlane to the EVM chain of your choice, see docs.hyperlane.xyz.

Setup

Deploying core contracts

This script is used to incrementally deploy the core Hyperlane smart contracts to a new chain.

If a contract address for $LOCAL is set to 0x0 in ./config/networks.json, that contract will be deployed. If not, the script will assert that the contract is configured according to the config in ./config.

If you're deploying to a new chain, ensure there is a corresponding entry for $LOCAL in ./config/networks.json with all contract addresses set to 0x0.

The script deploys:

  • A ProxyAdmin, used to administer TransparentUpgradableProxies for Mailbox and InterchainGasPaymaster
  • A Mailbox, which applications can use to send and receive messages
  • A MultisigIsm. Applications can optionally use this ISM to verify interchain messages sent to the local chain.
  • An InterchainGasPaymaster. Applications can optionally use this contract to pay a relayer to deliver their interchain messages to remote chains.
  • A TestRecipient. Users can send messages to this contract to verify that everything is working properly.
# The private key that will be used to deploy the contracts. Does not have any
# permissions post-deployment, any key with a balance will do.
export PRIVATE_KEY=0x1234
# The name of the chain to deploy to. Used to configure the localDomain for the
# Mailbox contract.
export LOCAL=YOUR_CHAIN_NAME
# An RPC url for the chain to deploy to.
export RPC_URL=YOUR_CHAIN_RPC_URL
# The comma separated name(s) of the chains to receive messages from.
# Used to configure the default MultisigIsm.
export REMOTES=ethereum,polygon,avalanche,celo,arbitrum,optimism,bsc,moonbeam

forge script scripts/DeployCore.s.sol --broadcast --rpc-url $RPC_URL --private-key $PRIVATE_KEY

Deploying a MultisigIsm

This script is used to deploy a MultigsigIsm to the chain of your choice. It will be initialized to verify messages from $REMOTES using the config for each remote chain specified in ./config/multisig_ism.json.

Applications can optionally use this ISM to verify interchain messages.

The script will also deploy a TestRecipient, configured to use the deployed ISM.

# This address will wind up owning the MultisigIsm after it's deployed.
export OWNER=0x1234
# The private key that will be used to deploy the contracts. Does not have any
# permissions post-deployment, any key with a balance will do.
export PRIVATE_KEY=0x1234
# An RPC url for the chain to deploy to.
export RPC_URL=YOUR_CHAIN_RPC_URL
# The comma separated name(s) of the chain(s) to receive messages from.
export REMOTES=YOUR_CHAIN_NAME

forge script scripts/DeployMultisigIsm.s.sol --broadcast --rpc-url $RPC_URL --private-key $PRIVATE_KEY