This project hosts the contracts that power the Decent bridge. It's built using LayerZero's OFT contracts.
- Install Foundry.
- Install packages:
forge install
- Install node packages:
pnpm i
forge test
Just like houndry-toolkit, this project
uses tons of hardhat tasks. In fact it uses houndry-toolkit as a
dependency, so it inherits all the HH (Hardhat) tasks that houndry-toolkit
exports.
Run
npx hardhat --help
and you'll see:
AVAILABLE TASKS:
add-liquidity
bridge
check Check whatever you need
clean Clears the cache and deletes all artifacts
compile Compiles the entire project, building all artifacts
console Opens a hardhat console
deploy-decent-bridge
flatten Flattens and prints contracts and their dependencies. If no file is passed, all the contracts in the project will be flattened.
full-setup
help Prints this message
list-forks lists all running forks
node Starts a JSON-RPC server on top of Hardhat Network
run Runs a user-defined script after compiling the project
start-fork starts a fork of a chain
start-forknets
start-forks starts forks of multiple chains
start-glue starts the glue service
stop-all-forks lists all running forks
stop-fork
stop-glue starts the glue service
test Runs mocha tests
watch-logs
wire-up
wire-up-src-to-dst
The new tasks are as follows:
A utility task for running a whole bunch of forknets at the
standardized ports
that we have defined in box-common.
These are the chains that it starts.
Deploys the decent bridge.
pnpm task deploy-decent-bridge --chain polygon --runtime forknet
Wires up the contracts from a source chain to a dst chain:
pnpm task wire-up --src arbitrum --dst optimism
pnpm task wire-up --chain arbitrum --amount 1.2 --runtime mainnet
When developing, previously we deployed these contracts to 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"