Deployment
Managing multi-chain contract deployments
HyperlaneDeployer
helps manage the deployment of contracts across multiple chains. Hyperlane apps should extend a deployer to specify the needed types and implement any needed logic for deployment of their contracts.
Implement
Developers must provide an implementation for deployContracts
which describes the logic for deploying the application on a single chain. Developers building with the Router pattern can extend HyperlaneRouterDeployer
, which handles some Router-specific boilerplate.
Deployers will also need contract Factories, which be defined manually or generated automatically by tooling like TypeChain (recommended).
For a simple, single contract app that extends the Router
contract, it is sufficient to call the deployContract
method in the deployContracts
implementation:
For an example deployer implementation see the Hyperlane Hello World app.
Interact
Once aHyperlaneDeployer
class has been defined, the deployer can be instantiated with a Multiprovider and a map of chains to configurations. These configs will be provided to your deployContracts
methods and can include any values needed there. The initialization of Invoking deploy()
will deploy contracts for all specified chains.
In scripts that calls deploy
, consider persisting deployment artifacts as they will be important for future use of your application. This includes addresses, compiler options, and contract constructor arguments.
For an example deployment script, see the Hyperlane Hello World app. This script is the same as the one provided above.
Last updated