This repo contains the smart contracts for wrapping ETH and ERC20 tokens onto Tidechain. It also contains Rust utilities for interacting with these contracts in a type-safe way.
contracts/Router.solcontracts/IRouter.solcontracts/SafeOwnable.sol
npx hardhat compile
npx hardhat node
cargo test
- create a config file, like
config/config.testnet.json - populate it with the necessary fields:
eth_url(infura or other)thresholdownersarray of H160 addresseschain_idprivate_keyprivate key that owns rETH for deployment gas fees. You can send yourself ETH in metamask (ropsten) and extract your private key from there.
export NETWORK=testnet- deploy USDT/USDC:
cargo run --bin 1_assets- then add
usdt_addressandusdc_addressto config
- then add
- deploy SAFE factory:
cargo run --bin 2_factory- then add
safe_factory_addressto config
- then add
- deploy SAFE:
cargo run --bin 3_safe- then add
safe_addressto config
- then add
- deploy Router:
cargo run --bin 4_router- then add
router_addressto config
- then add
- add assets to router acceptlist:
cargo run --bin 5_add_assets - assign the router owner to be the SAFE:
cargo run --bin 6_router_owner - assign the safe owners:
cargo run --bin 7_safe_owners- (make sure the owners array in config matches the ETH pubkeys from running qourum members)
- check everything is ready:
cargo run --bin 8_ready_check