- To keep packages isolated between
forge
andeth-brownie
, there should be TWO Python virtual envs to manage. In most cases, they will be worked on in isolation, but this is something to be careful of. TBD if it is better to unify these into the root virtual env.
Tests are run using Foundry:
- Activate Python environment to make Vyper available:
. ve-venv/bin/activate
- Run tests:
forge test --ffi -vv
Deploy scripts are run using Brownie:
- Replace Brownie contracts from the forge
./src
directory:$ make copy
- Enter
deploy
directory (cd deploy
) - Create and/or activate Python virtual env
- Create:
python3.9 -m venv ve-venv
- NOTE:
eth-brownie
will fail to install on versions >= 3.10. Theeth-ape
library appears to be its successor but is not yet mature enough to migrate all tooling (Nov 1, 2023). - Activate:
. ve-venv/bin/activate
- Dependencies (first run):
pip install --upgrade pip && pip install -r requirements.txt
- Create:
- Create an
.env
file with:INSTANCE_ID=primary
- Populate JSON configurations with contract and multisig addresses
- Mainnet:
./scripts/inputs/1/primary.json
- Polygon:
./scripts/inputs/137/primary.json
- Arbitrum:
./scripts/inputs/42161/primary.json
- Mainnet:
- Run deploy script:
brownie run scripts/mainnet/<script-name>.py --network mainnet
- NOTE: Some scripts depend on only
existing
(inputs) addresses, others depend onexisting
(inputs) anddeployed
(outputs) addresses. Outputs are set by other scripts. - Networks:
mainnet
,polygon-main
,arbitrum-main
- NOTE: Some scripts depend on only
To test the deployment, the Brownie scripts are run in conjunction with an anvil localnode using two terminal windows.
- Populate JSON configurations with contract and multisig addresses:
./scripts/inputs/31337/primary.json
- (Terminal 1) Fork network with anvil:
anvil --fork-rpc-url <url> --fork-block-number <num> --chain-id 31337
- (Terminal 2) Run brownie script using development privkey:
brownie run scripts/mainnet/0_deploy_vedfx.py
All scripts can be run using an Ethereum RPC with the block num 18415000
.
For different address configurations, change the chain id
to easily use separate config files.
For end-to-end testing of the sidechain contracts:
-
Replace Brownie contracts from the forge
./src
directory:$ make copy
-
Edit
./deploy/.env
with test wallet idDEPLOY_WALLET_ID=sepolia-dev
-
Change dir:
cd deploy
-
Activate Python virtual env:
source ve-venv/bin/activate
-
Deploy fake LPT script:
brownie run scripts/testnet/deploy_fake_lpt.py --network sepolia
- Validate contract manually on
https://sepolia.etherscan.io
- Validate contract manually on
-
Edit
scripts/testnet/deploy_child_chain_gauge.py
with LPT address -
Deploy test child chain gauge set script:
brownie run scripts/testnet/deploy_child_chain_gauge.py --network sepolia
Any contracts that failed to verify or must be verified manually (Vyper contracts) must be done on their respective block explorers (Etherscan, Polygonscan, Arbiscan). After deployment of any contract(s), new addresses are then to be added to the protocol addresses spreadsheet.