Lido DAO Aragon omnibus voting scripts.
- This project uses Brownie development framework. Learn more about Brownie.
- Poetry dependency and packaging manager is used to bootstrap environment and keep the repo sane.
- Python >= 3.10, <3.11
- Pip >= 20.0
- Node >= 16.0
- yarn >= 1.22
Use the following command to install poetry:
pip install --user poetry==1.5.0alternatively, you could proceed with pipx:
pipx install poetry==1.5.0Ensure that poetry bin path is added to your $PATH env variable.
Usually it's $HOME/.local/bin for most Unix-like systems.
This is a workaround related brownie deps pyyaml issue eth-brownie/brownie#1701
poetry run pip install "cython<3.0" pyyaml==5.4.1 --no-build-isolationpoetry installSimply run the following command from the project's directory
yarnpoetry run brownie networks import network-config.yaml True📝 While previous steps needed only once to init the environment from scratch, the current step is used regularly to activate the environment every time you need it.
poetry shellBy default, you should start composing new scripts and test using forked networks. You have two forked networks to work with:
mainnet-forkgoerli-fork
To start new voting on the live networks you could proceed with:
mainnetgoerli
Note: you can't run tests on the live networks.
In a typical weekly omnibus workflow, you need only mainnet-fork and
mainnet networks. In case of large test campaign on Lido upgrades,
it also could be useful to go with goerli and goerli-fork testnets first.
Despite the chosen network you always need to set the following var:
export WEB3_INFURA_PROJECT_ID=<infura_api_key>To start a new vote please provide the DEPLOYER brownie account name (wallet):
export DEPLOYER=<brownie_wallet_name>To run tests with a contract name resolution guided by the Etherscan you should provide the etherscan API token:
export ETHERSCAN_TOKEN=<etherscan_api_key>To upload Markdown vote description for a new vote to IPFS you should provide the web3.storage API token:
export WEB3_STORAGE_TOKEN=<web3_storage_api_key>See here to learn more Markdown description
To skip events decoding while testing set the following var:
export OMNIBUS_BYPASS_EVENTS_DECODING=1To run tests with already started vote provide its id:
export OMNIBUS_VOTE_IDS=156To use local ABIs for events decoding use:
export ENV_PARSE_EVENTS_FROM_LOCAL_ABI=1To make default report for acceptance and regression tests after voting execution set:
export REPORT_AFTER_VOTE=1Directory contains state based tests. This tests run every time when tests suite started, if there are any voting scripts or upgrade scripts they will be applied before.
Directory contains scenario tests. This tests run every time when tests suite started, if there are any voting scripts or upgrade scripts they will be applied before.
Directory contains snapshot-scenario tests. This tests run only if there are any upgrade scripts.
Tests for current voting
To run all the test on mainnet-fork execute
brownie testYou can pass network name explicitly with --network {network-name} brownie
command-line argument.
To reveal a full test output pass the -s flag
See here to learn more about tests
- To forcibly bypass etherscan contract and event names decoding set the
OMNIBUS_BYPASS_EVENTS_DECODINGenvironment variable to1. It could be useful in case of etherscan downtimes or usage of some unverified contracts (especially, on the Görli Testnet). - To re-use the already created
vote_idyou can pass theOMNIBUS_VOTE_IDSenvironment variable (e.g.OMNIBUS_VOTE_IDS=104). - To re-use multiple created votes list the ids comma-separated (e.g.
OMNIBUS_VOTE_IDS=104,105) - To force the large CI runner usage, please name your branch with the
large-vote_prefix.
Please, use the shared pre-commit hooks to maintain code style:
poetry run pre-commit installPlease move your outdated scripts into archive/scripts and outdated tests into
archive/tests directories.
If you have encountered Invalid hashes errors while trying to run previous command, please remove poetry's cache:
- GNU/Linux
rm -rf ~/.cache/pypoetry/cache/
rm -rf ~/.cache/pypoetry/artifacts/- MAC OS:
rm -rf ~/Library/Caches/pypoetry/cache
rm -rf ~/Library/Caches/pypoetry/artifacts