Madara Bootstrapper is a tool that helps to deploy the Token Bridge & Eth Bridge contract between a madara/katana Appchain and another L2 or L1 network. It will also declare wallet contracts from OpenZappelin, Argent and Braavos. You can find the full list of contracts in Info
Currently Supported :
- Madara App Chain <----> Ethereum / EVM based chains
- 👷🏼 more coming soon......
There are three test in the repository :
- bridge deployment e2e
- eth bridge deposit and claim
- erc20 token bridge deposit and claim
- You need to comment/remove the #[ignore] tags in src/tests/mod.rs file
- Only one test can be run at one time as all the tests are e2e tests.
- You also would need to restart both the chains after running each test.
# 1. Run madara instance with eth as settlement layer :
./target/release/madara --dev --da-layer=ethereum --da-conf=examples/da-confs/ethereum.json --settlement=Ethereum --settlement-conf=examples/da-confs/ethereum.json
# 2. Run anvil instance
~/.foundry/bin/anvil
# 3. Run tests
RUST_LOG=debug cargo test -- --nocapture
You can provide the env variables as arguments also, or you can also provide them in .env file.
Refer .env.example file for setup
cp .env.example .env
cargo build --release
RUST_LOG=info cargo run -- --help
# If you have provided env vars in .env
RUST_LOG=info cargo run
# To run in dev mode (uses unsafe proxy and minimal setup)
RUST_LOG=info cargo run -- --dev
IMP 🚨 : It will store all the addresses in data/addresses.json
-
You need to set up the .env file first. Fill all the variables in .env file
cp .env.example .env
-
You need to run docker compose command to build the image
docker compose build
-
Run the image
# If both the networks are running locally docker compose -f docker-compose-local.yml up # If you are hosting on already deployed networks docker compose up
IMP 🚨 : It will store all the addresses in data/addresses.json
Here are some contract descriptions on why they are used in our context.
ERC20 (starkgate)
: This ERC20 contracts works without a proxy and is used by erc20 token bridge in order to deploy the token on L2.ERC20 (legacy : starknet)
: This contract is used for deploying the implementation of ETH token on L2.ERC20 token bridge (starkgate)
: Contract for Token bridge.OpenZeppelinAccount (legacy : starknet)
: Contract used for declaring a temp account for declaring V1 contract that will be used to deploy the user account with provided private key in env.
Important
For testing in Github CI we are using the madara binary build with
--disable-fee-flag
. The source for madara code :
https://github.com/karnotxyz/madara/tree/madara-ci-build