Install yarn
npm install --global yarn
Download Foundry
curl -L https://foundry.paradigm.xyz | bash
Then after reloading PATH, to install it run:
./scripts/foundry-up.sh
If you see a warning about libusb, install it by running:
brew install libusb
Clone the repo, then:
yarn
To compile the smart contracts located in ./contracts
:
forge build
Compiled contracts will be output to the ./out
folder
To run the solidity unit tests:
forge test
You can add verbosity to the tests by adding -vvvv
(1-4 levels) to the command
To start a local ethereum blockchain:
anvil
It will generate a set of 10 public/private keys with 10k ether each. Save one of these private keys for deployment
below.
It starts listening on http://127.0.0.1:8545
If you want to interact with anvil via a front end, you will need to add the local network to Metamask
with ChainID=1337
To start a local base blockchain and river blockchain run
./scripts/bc-all-start.sh
To deploy our contracts to your local base and river instances
- duplicate
.env.localhost
file in the contracts folder of the project and rename it to.env
(this is excluded from git via .gitignore) - run
export RIVER_ENV="local_multi"
from your terminal - you will then run
./scripts/deploy-contracts.sh
to deploy the entire suite of contracts to your local base-anvil and river-anvil chains.
To deploy a single diamond base contract to your local anvil instance
from within the contracts/
folder you can run make deploy-base-anvil contract=Deploy[Contract] type=diamonds
you will replace
the [Contract]
part with the contract you want to deploy, you can see all the contracts available for deployment
in this part of the project.
To deploy a facet base contract to your local anvil instance
from within the contracts/
folder you can run make deploy-base-anvil contract=Deploy[Facet] type=facets
you will
replace the [Facet]
part with the contract you want to deploy, you can see all the facets available for deployment
in this part of the project.
To deploy our contracts to a live network
from within the contracts/
folder you can run make deploy-base-sepolia contract=Deploy[Facet] type=facets context=[context]
you will
replace the [Facet]
part with the contract you want to deploy, you can see all the facets available for deployment
in this part of the project.