68f5be64e2
Signed-off-by: AlienTornadosaurusHex <> |
||
---|---|---|
.github/workflows | ||
contracts | ||
diffs | ||
resources | ||
scripts | ||
test | ||
.editorconfig | ||
.env.example | ||
.eslintrc | ||
.gitattributes | ||
.gitignore | ||
.nvmrc | ||
.prettierignore | ||
.prettierrc | ||
.solcover.js | ||
.solhint.json | ||
config.js | ||
hardhat.config.js | ||
LICENSE | ||
package.json | ||
README.md | ||
yarn.lock |
Governance upgrade to patch exploit vulnerability
The contracts can be currently found here:
Inlined version of the RelayerRegistry
and TornadoStakingRewards
are also used. Check the diffs
folder to see how much they deviate from the relayer-registry
repository reconstruction.
For testing resistance against metamorphic contracts, we use the contracts provided by: https://github.com/0age/metamorphic.git
The rest of the Tornado Governance README follows below.
Tornado governance
Description
This repository holds all the tornado.cash governance upgrades and original governance contracts.
Documentation
All high-level documentation can be find here.
Code architecture
Tornado governance infrastructure consists of two types of repository:
- Governance repository (this one) - contains the original governance contracts and parts of proposals that upgrade governance itself via loopback proxy. So here you can compile the actual version of the governance contract.
- Proposal repository - a separate repository for each governance proposal. It contains the full codebase of a proposal.
Loopback proxy
Loopback proxy is a special type of proxy contract that is used to add the ability to upgrade the proxy itself. This way governance proposals can upgrade governance implementation.
Proposal creation manual
To create your custom governance proposal you need to:
- Create a proposal repository (for example):
- a proposal is executed from the governance contract using delegatecall of executeProposal() method
- as a proposal is executed using delegatecall, it should not store any storage variables - use constants and immutable variables instead
- If your proposal is upgrading governance itself, you need to create a pull request to the governance repository. PR should add folder with governance contract upgrade (separate folder in contracts folder - for example).
- Deploy proposal. The proposal must be smart contracts with verified code.
- Go to Tornado governance UI to start the proposal voting process.
Tests/Coverage
Setting up the repository:
git clone https://github.com/tornadocash/tornado-governance.git
yarn
cp .env.example .env
Please fill out .env according to the template provided in it. Please ensure that all of the example values are set to the correct addresses.
To run test scripts:
yarn test
To run tests coverage:
yarn coverage