Git Product home page Git Product logo

ethlondon-hyperlane-wormhole-hook's Introduction

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.

ethlondon-hyperlane-wormhole-hook's People

Contributors

palmcivet7 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.