@decent.xyz/hardhat-decent-bridge

1.0.3 • Public • Published

Decent Bridge

This project hosts the contracts that power the Decent bridge. It's built using LayerZero's OFT contracts.

Setup

  1. Install Foundry.
  2. Install packages:
forge install
  1. Make sure you have money on both Sepolia and FTM. Here are two generous faucets for this:

    1. Alchemy's Sepolia Faucet
    2. Fantom's testnet faucet
  2. (On Mac OS) Sometimes, MacOS by default has some wack version of make installed. You can easily install the correct version with:

brew install make # binary's called gmake

Then you have to alias it in your rc file. Add this line to the bottom of your rcfile: That's ~/.zshrc if you're using zsh, and it's ~/.bashrc if you're using bash. You can check which shell you're using with echo $SHELL.

alias make="gmake"

Deploying Contracts

To deploy contracts, you need to have a .env file in the root of this project. Refer to .env.example for reference.

Then, you can deploy contracts with:

make bridge-e2e

Refer to the Makefile for more commands, or to see what bridge-e2e does.

How does deployment work?

Deploying the Router

First we have to deploy the router contracts. The script for this deployment is in DeployRouter.s.sol.

Wiring up Contracts

The router contract on one chain needs to know about the other contracts on the target chains. So, we have to wire them up and let them know of each other. The WireUpContracts.s.sol does exactly just that.

Bridging Tokens

To bridge tokens, use the BridgeEth.s.sol contract.

Readme

Keywords

none

Package Sidebar

Install

npm i @decent.xyz/hardhat-decent-bridge

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

39.7 MB

Total Files

2303

Last publish

Collaborators

  • edricy
  • arshankhanifar
  • wkantaros
  • zev2axa
  • cdsiren
  • decentxyz