Deployment
Managing multi-chain contract deployments
Last updated
Managing multi-chain contract deployments
Last updated
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.
Developers must provide an implementation for deployContracts
which describes the logic for deploying the application on a single chain. Developers building with the pattern can extend HyperlaneRouterDeployer
, which handles some Router-specific boilerplate.
Deployers will also need contract , 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:
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 deployer implementation see the app.
Once aHyperlaneDeployer
class has been defined, the deployer can be instantiated with a 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.
For an example deployment script, see the app. This script is the same as the one provided above.