Decent Bridge
This project hosts the contracts that power the Decent bridge. It's built using LayerZero's OFT contracts.
Setup
- Install Foundry.
- Install packages:
forge install
-
Make sure you have money on both Sepolia and FTM. Here are two generous faucets for this:
-
(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.