This repository serves as a template for developers to kickstart a Hashi project using Hardhat/Foundry.
This template includes basic contracts and deployment scripts to set up a Hashi-based project quickly. To follow along, refer to Quick Start
tutorial in the Hashi documentation.
/foundry
: Template using Foundry. Consist of contracts, deploy scripts, and configuration./hardhat
: Template using Hardhat. Consist of contracts, deploy scripts, and configuration./offchain
: Offchain helper scripts and contract ABI./public
: images for illustration purpose.
Sender
: contract from source chain that callsYaho
to dispatch message on target chain. Developers can define the logic in their sender contract from source chain, i.e.SepoliaSender.sol
.Receiver
: contract on target chain that receives callback fromYaru
and execute further logic is threshold is met by oracles (adapters on target chain). Developers can define the logic in their receiver contract on target chain, i.e.ChiadoReceiver.sol
.
The end to end workflow of message dispatching
State verifying contains the logic to verify storage proof and event proof.
HashiProver
: A modified version of HashiProver.sol, which changes the visibility ofverifyForeignEvent
andverifyForeignStorage
function to public. Developers can simply pass the contract address into theMockERC20Prover.sol
constructor. The deployed HashiProver address can be found in Hashi documentation.MockERC20
: A mock ERC20 contract that is deployed on source chain.MockERc20Prover
: A mock prover contract against the storage and event fromMockERC20
contract, should be deployed on target chain.
The end to end workflow of state(storage or event) verifying
To learn more about the key contracts in Hashi, check out Key Contracts in Hashi Documentation.
To get the deployment addresses of Yaho and Yaru, check out here. Note that Yaho
is deployed on source chain, and Yaru
is deployed on target/destination chain with respect to the source chain.
To get the oracle(reporter & adapter) addresses, check out here. At the moment, LayerZero covers most of the networks that are supported by Hashi.
To get the Hashi Prover addresses, check out here
- Hashi documentation: https://crosschain-alliance.gitbook.io/hashi
- Hashi repository: https://github.com/gnosis/hashi/
- Hashi Explorer: https://hashi-explorer.xyz/