You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Alexander Drygin 6464973b10
Merge pull request #7 from tornadocash/TC-74-proposal-architecture-docs
2 months ago
.github/workflows TC-95-coverage-to-CI 2 months ago
.vscode gov v2 refactored 7 months ago
contracts add correct upgrade link 7 months ago
resources add version 2 11 months ago
scripts add version 2 11 months ago
test add V3 tests 7 months ago
.editorconfig add version 2 11 months ago
.env.example make it identical to mainnet; fix CI 11 months ago
.eslintrc add version 2 11 months ago
.gitattributes initial 2 years ago
.gitignore v1/v2 tests 7 months ago
.nvmrc add version 2 11 months ago
.prettierignore TC-95-tests-coverage 2 months ago
.prettierrc initial 2 years ago
.solcover.js TC-95-tests-coverage 2 months ago
.solhint.json gov v2 refactored 7 months ago
LICENSE initial 2 years ago
README.md TC-93-proposal-repo-example 2 months ago
config.js add V3 tests 7 months ago
hardhat.config.js TC-95-tests-coverage 2 months ago
package.json TC-95-tests-coverage 2 months ago
yarn.lock TC-95-tests-coverage 2 months ago

README.md

Tornado governance build status Coverage Status

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:

  1. 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.
  2. 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:

  1. 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
  1. 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).
  2. Deploy proposal. The proposal must be smart contracts with verified code.
  3. 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