Prerequisites
Note: This project uses Foundry for tests and Hardhat for deployment make sure to install both.
See the official Foundry installation instructions.
Then, install the foundry toolchain installer (foundryup
) with:
curl -L https://foundry.paradigm.xyz | bash
Now that you've installed the foundryup
binary,
anytime you need to get the latest forge
or cast
binaries,
you can run foundryup
.
So, simply execute:
foundryup
Foundry is installed! 🎉
Install all the packages from root directory. Compatible node version >=16.0.0
.
yarn install
Packages installed! 🎉
Setup
forge install
current version of git submodules used in the repository:
openzeppelin/openzeppelin-contracts@ce0068c
transmissions11/solmate@bff24e8
to confirm the installed versions you can run:
git submodule status
Building
foundry:
forge build
hardhat:
npx hardhat compile
Testing
forge test -vvvv
Devnet deployment
First, modify the .env with
NETWORK_TYPE=DEVNET
SEED_AMOUNT=1000000000000000000000
To start a local node with a local block explorer first install ethernal. Only sign up is required.
[email protected] ETHERNAL_PASSWORD=yourpwd npx hardhat node
Note: make sure to set the resetOnStart
parameter of ethernal
in the hardhat config file to your workspace name set in ethernal after sign up.
To start a localhost hardhat node without a block explorer just run:
npm run deploy:devnet
This creates a localhost hardhat node with mining interval 10 seconds. This also does the following:
- Deploys the contracts to the following addresses:
{
"Tss": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
"MockERC20": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
}
- Sends stake amount and whitelists the first 10 accounts on localhost hardhat network and creates a fixed number of requests for the bridge nodes to fulfill.
Once this is complete, run the following command on a new terminal tab:
npm run adminScript:devnet
- Runs the adminScript, which is required to be run on the 1st dynasty only. It allows the admin to call
confirmSigner()
so that theactiveSet
andsignerAddress
for the dynasty can be confirmed. Note: The adminScript will continue to run in the background until the nodes running from bridge-node attest a signer address. Please continue with bridge-node set up and let the script continue running.
After this is done, you can run devnet nodes on the bridge-node(for documentation, refer bridge-node repo.)
Linting
forge fmt
Coverage
forge coverage
Snapshot
forge snapshot
- Create a copy of local environment
.env
from.env.example
by runningyarn cp-example-env
and set the environment variables accordingly. - Run hardhat node (
yarn deploy
) - This will run
scripts/deploy.sh
which will deploy the contracts usingnpx hardhat --network $NETWORK deploy
Whispering Turais Bridge: 0x284Ff064B465C5477582C0713eDd627533cD3838 MockERC20: 0x3270C19B4e05a15DE2f02c1c3BFD779DAcb7B270
- Fork repository from here and follow the installation steps.
- To make contributions see our contribution guideline