Skip to content

pinglu-pingu/hyperlane-erc-5164

 
 

Repository files navigation

Hyperlane EIP-5164 Implementation

EIP-5164 defines a cross-chain execution interface for EVM-based blockchains allowing contracts on one chain to call contracts on another. This repo contains an implementation of EIP-5164 that uses Hyperlane as the transport layer.

The two main contracts are HyperlaneERC5164Relayer.sol and HyperlaneERC5164Executor which are implementations of EIP-5164 CrossChainRelayer and CrossChainExecutor respectively as well implementations of Hyperlane Message Sender and Message Recipient respectively allowing them to provide an EIP-5164 interface while using Hyperlane as the cross-chain transport layer.

Instructions

Install

$ yarn install

Deploy and Run

Setup Environment

Create a .env file and set the following variables

  • PRIVATE_KEY
  • ETHERSCAN_API_KEY

Fund the account for the above private key with test tokens from a faucet (e.g the Paradigm faucet at https://faucet.paradigm.xyz.)

These additional variables can also be set depending on your networks of choice

  • MOONSCAN_API_KEY
  • POLYSCAN_API_KEY
  • SNOWTRACE_API_KEY
  • ARBISCAN_API_KEY

Compile contracts

$ yarn build

Clear cache and delete artifacts

$ yarn clean

Deploy Hyperlane EIP-5164 relayer and executor contracts

Deploy the Hyperlane EIP-5164 executor
$ yarn hardhat deploy-executor --network goerli --origin moonbasealpha
Deploy the Hyperlane EIP-5164 relayer
$ yarn hardhat deploy-relayer --network moonbasealpha --executor "EXECUTOR_ADDRESS" --remote goerli

Send messages via Hyperlane EIP-5164 relayer and executor contracts

Deploy an EIP-5164 call target
$ yarn hardhat deploy-call-target --network goerli --executor "EXECUTOR_ADDRESS"
Send a message to the EIP-5164 call target via the EIP-5164 relayer and executor contracts
$ yarn hardhat send-message --network moonbasealpha --relayer "RELAYER_ADDRESS" --target "CALL_TARGET_ADDRESS" --message "MESSAGE"

Automated Testing

Testing

$ yarn test

Coverage

$ yarn coverage

Security and Liability

All contracts are WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

License

All smart contracts are released under GPL-3.0

About

Hyperlane ERC-5164 Implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 53.3%
  • TypeScript 44.8%
  • JavaScript 1.9%