Skip to content

palmcivet7/ethlondon-hyperlane-wormhole-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hyperlane WormholeHook

This project contains a Hyperlane WormholeHook and WormholeISM for sending Hyperlane messages via Wormhole.

Table of Contents

Overview

The WormholeHook contract inherits Hyperlane's IPostDispatch, and Wormhole's IWormholeRelayer contract. The WormholeISM contract inherits Hyperlane's IInterchainSecurityModule contract, and Wormhole's IWormholeRelayer and IWormholeReceiver contracts.

WormholeHook.sol

The WormholeHook.sol contract has a postDispatch() function that is intended to be called by a Hyperlane Mailbox contract, passing it a "message" as bytesdata. This function calls the wormholeRelayer.sendPayloadToEvm() using the message data and sends it to the WormholeISM contract on another chain.

Goerli deployment

WormholeISM.sol

The WormholeISM.sol contract has a receiveWormholeMessages() function for receiving messages sent by the Hook contract on the other chain, and emits a MessageReceived event.

Fuji deployment

Installation

To install the necessary dependencies, first ensure that you have Foundry installed by running the following command:

curl -L https://foundry.paradigm.xyz | bash

Then run the following commands in the project's root directory:

foundryup
forge install

Deployment

You will need to have a .env file in each directory with your $PRIVATE_KEY.

Replace $PRIVATE_KEY, $SEPOLIA_RPC_URL and $FUJI_RPC_URL in the .env with your respective private key and rpc url.

Deploy the WormholeHook.sol and WormholeISM.sol contracts to their chains by running the following commands:

source .env
forge script script/DeployWormholeISM.s.sol --rpc-url $FUJI_RPC_URL --private-key $PRIVATE_KEY --broadcast

Update the deploy script to include the ISM address in the Hook's constructor.

forge script script/DeployWormholeHook.s.sol --rpc-url $GOERLI_RPC_URL --private-key $PRIVATE_KEY --broadcast

Tx Hashes

Goerli Tx

Fuji Tx

License

This project is licensed under the MIT License.

About

Won a prize at the ETHLondon 2023 Hackathon.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published