Skip to content

Starknet implementation of the Hyperlane protocol.

License

Notifications You must be signed in to change notification settings

txfusion/hyperlane_starknet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ Hyperlane Starknet ⚡

A Starknet implementation of Hyperlane

https://hyperlane.xyz


This repository is an implementation of the Hyperlane protocol for Starknet app-chains. You can learn more about Hyperlane here.

The implementation guidelines can be found here.

Supported Features

Feature Supported
Mailbox
Merkle Tree Hook
Protocol Fee Hook
Aggregation Hook
Routing Hook
Pausable Hook
Multisig ISM
Pausable ISM
Aggregation ISM
Routing ISM
Interchain Gas Payment
Warp Routes

Project structure

Contracts

The contracts are located in the contracts/ directory. It's a scarb project, so you can use the scarb CLI to build it.

It uses Starknet Foundry for tests.

See the contracts README for more information.

Pre-requisites

  • Install Scarb (see here)
  • Install Starknet Foundry (see here)

Build

Once installed, you can compile the contracts by executing this command:

scarb build

Format

To format your code:

scarb fmt

Testing

Run the tests using snforge:

snforge test

Integration Tests

To run the integration tests:

Once installed, build the contracts:

cd contracts && scarb build && cd -

Open another terminal, start a new Katana instance:

 katana -b 1000 &

Run evm -> strk messaging test on the first terminal:

cd rust && cargo test -- test_mailbox_evm_to_strk

Once the test passed, kill the katana instance:

pkill katana

Restart another instance for the second test (strk -> evm):

cd rust && cargo test -- test_mailbox_strk_to_evm

📖 License

This project is licensed under the MIT license. See LICENSE for more information.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

🪛 Deployment

This section details the steps to deploy Hyperlane contracts on Starknet. Note that the deployment script will set a basic configuration for all the required contracts. Further configuration process might be required based on the use case. Constructors parameters can be specified in the contract_config.json. Firstly, set the following environment variables, important for the deployment process:

STARKNET_RPC_URL=
ACCOUNT_ADDRESS=
BENEFICIARY_ADDRESS=
NETWORK=
PRIVATE_KEY=

The beneficiary address is the account that will be used to recover funds from the protocol fee. Once set, the contracts can be deployed using this command( assuming ts-node is installed):

ts-node deploy.ts  

About

Starknet implementation of the Hyperlane protocol.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Cairo 93.7%
  • Rust 5.0%
  • TypeScript 1.3%