👒Development Guide
This guide provides detailed instructions for compiling, deploying, testing, and interacting with the core smart contracts essential to Shadow Bridge. The principal contracts include ShadowBridgeToken, GovernorAlpha/Timelock, Boreas, and ShadowBridge (Coin, ERC20).
Preparation
Install Truffle
Install Dependencies
Install Ioctl Install ioctl, a command-line tool for blockchain interactions, as per the instructions provided in the Shadow Bridge Documentation.
Compile Contracts
Deploy Contracts
ShadowBridgeToken Deploy a ShadowBridgeToken sbt:
Timelock & GovernorAlpha Deploy Timelock tl:
Deploy GovernorAlpha ga (e.g., voting duration: 3 days):
Set Timelock's pending admin to GovernorAlpha ga:
Accept Admin from GovernorAlpha ga triggered by guardian:
Boreas Add Liquidity for SBG/IOTX on MimoFactory and receive SBG-IOTX LP Token:
Invoke sbt.addMinter() to set Boreas as minters for SBG token:
ShadowBridge (Coin, ERC20) Deploy Hasher hr and Verifier vr:
Deploy CoinShadowBridge csb and ERC20ShadowBridge esb linked by Hasher hr with Boreas, vr, sbt, mf and, if necessary, XRC20 token address:
Testing Contracts
Use Node.js version 11.15.0 with nvm and build zk circuits using npm run build.
For the test network:
For the development network, adjust truffle-config.js for the development network settings, then run ganache-cli -i 1337 and npm run test.
Interacting with Contracts
Refer to the detailed steps to set up your environment for depositing, withdrawing, and engaging with the governance process through the GovernorAlpha contract. These steps will guide you in proposing and voting on changes within the Shadow Bridge ecosystem.
Last updated