HelloWorld
The skeleton of an Hyperlane-connected contract and app
****HelloWorld **** app **** is the skeleton of an Hyperlane-connected contract and app using the App framework.
Its contract sends a user-specified string to another chain which handles the message by increasing counters and emitting events.
To conveniently implement the router pattern, the contract extends
@hyperlane-xyz/core/contracts/Router.sol
To send the message, it calls the
_dispatchWithGas
method.The main purpose of defining a deployer is to provide the custom types and implementation of the
deployContracts
method. See Deploying contracts for more details.export class HelloWorldDeployer<
Chain extends ChainName,
> extends HyperlaneRouterDeployer<
Chain,
HelloWorldConfig,
HelloWorldContracts,
HelloWorldFactories,
>
The
sendHelloWorld
method shows an example of triggering the remote message dispatch: const tx = await sender.sendHelloWorld(toDomain, message, {
...chainConnection.overrides,
gasLimit,
value,
});
Last modified 5mo ago