1
0
Go to file
AlienTornadosaurusHex 5f8942e085 update natspec
Signed-off-by: AlienTornadosaurusHex <>
2023-05-27 15:14:29 +00:00
.github/workflows Init 2023-05-21 20:02:21 +03:00
contracts update natspec 2023-05-27 15:14:29 +00:00
deploy staking address must be behind proxy 2023-05-27 15:01:23 +00:00
diffs scope require comment, natspec, update diffs (no change) 2023-05-23 21:41:03 +00:00
resources Init 2023-05-21 20:02:21 +03:00
scripts remove layout script 2023-05-22 18:35:44 +00:00
test staking address must be behind proxy 2023-05-27 15:01:23 +00:00
.editorconfig Init 2023-05-21 20:02:21 +03:00
.env.example staking address must be behind proxy 2023-05-27 15:01:23 +00:00
.eslintrc Init 2023-05-21 20:02:21 +03:00
.gitattributes Init 2023-05-21 20:02:21 +03:00
.gitignore Init 2023-05-21 20:02:21 +03:00
.nvmrc Init 2023-05-21 20:02:21 +03:00
.prettierignore manual deployment, optimization, formatting, need to update deploy script 2023-05-24 23:59:14 +00:00
.prettierrc manual deployment, optimization, formatting, need to update deploy script 2023-05-24 23:59:14 +00:00
.solcover.js Init 2023-05-21 20:02:21 +03:00
.solhint.json Init 2023-05-21 20:02:21 +03:00
config.js staking address must be behind proxy 2023-05-27 15:01:23 +00:00
hardhat.config.js Add all deploy scripts 2023-05-25 16:31:55 +00:00
LICENSE Init 2023-05-21 20:02:21 +03:00
package.json manual deployment, optimization, formatting, need to update deploy script 2023-05-24 23:59:14 +00:00
README.md update diffs to reflect deployed impls 2023-05-23 19:34:16 +00:00
yarn.lock Init 2023-05-21 20:02:21 +03:00

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 deployed contract implementations.

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 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