All our smart contract reside in this project.
If you exclusively want to work on the contracts, you don't need to setup the whole project. Follow only the instructions below to setup the contracts locally.
-
Ensure that you have:
- Foundry (install forge)
-
Check your foundry installation
$ forge --help
$ anvil --help
- Clone the repository with submodules `git clone --recurse-submodules
- Build the image with
docker build -f Dockerfile -t credbull-contracts .
- SSH into the container with
docker run --entrypoint "/bin/sh" -it credbull-contracts
- You can then run
forge
andanvil
commands as usual
forge build
forge test
Pre-requisite: install genhtml
yarn coverage
Update each submodules to latest commit recorded
# run from project root dir
git submodule update --init --recursive
Reset the checked out commit for each submodule
cd packages/contracts/lib/<SUBMODULE>
git reset --hard HEAD