Skip to content

brownie-mix/dao-mix

Repository files navigation

DAO Mix

About

How to DAO

This repo is meant to give you all the knowledge you need to start a DAO and do governance. Since what's the point of a DAO if you can't make any decisions! There are 2 main kinds of doing governance.

Feature On-Chain Governance Hybrid Governance
Gas Costs More Expensive Cheaper
Components Just the blockchain An oracle or trusted multisig

A typical on-chain governance structure might look like:

  • ERC20 based voting happens on a project like Tally, but could hypothetically be done by users manually calling the vote functions.
  • Anyone can execute a proposal once it has passed Examples Compound

On-chain governance can be much more expensive, but involves fewer parts, and the tooling is still being developed.

A typical hybrid governance with an oracle might look like:

  • ERC20 based voting happens on a project like Snapshot
  • An oracle like Chainlink is used to retreive and execute the answers in a decentralized manner.

A typical hybrid governance with a trusted multisig might looks like:

Hybrid governance is much cheaper, just as secure, but the tooling is still being developed.

Tools:

No Code Tools

The following have tools to help you start a DAO without having to deploy contracts yourself.

(back to top)

Getting Started

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • Python
  • brownie
    python3 -m pip install --user pipx
    python3 -m pipx ensurepath
    # restart terminal
    pipx install eth-brownie

If you want to test and run locally:

Installation

  1. Clone this repo:
    git clone https://github.com/brownie-mix/dao-mix
    cd dao-mix
    
  2. Install hardhat
    yarn add hardhat

If you want to deploy to a testnet: 3. Add a .env file with the same contents of .env.example, but replaced with your variables.

  1. DO NOT PUSH YOUR PRIVATE_KEY TO GITHUB
  2. Add dotenv: .env to your brownie-config.yaml

Usage

On-Chain Governance Example

We have just 1 script in the scripts folder at the moment. This will take you through the whole process of governance.

  1. We will deploy an ERC20 token that we will use to govern our DAO.
  2. We will deploy a Timelock contract that we will use to give a buffer between executing proposals.
    1. Note: The timelock is the contract that will handle all the money, ownerships, etc
  3. We will deploy our Governence contract
    1. Note: The Governance contract is in charge of proposals and such, but the Timelock executes!
  4. We will deploy a simple Box contract, which will be owned by our governance process! (aka, our timelock contract).
  5. We will propose a new value to be added to our Box contract.
  6. We will then vote on that proposal.
  7. We will then queue the proposal to be executed.
  8. Then, we will execute it!
brownie run scripts/governance_standard/deploy_and_run.py

Or, to a testnet

brownie run scripts/governance_standard/deploy_and_run.py --network kovan

You can also use the Openzeppelin contract wizard to get other contracts to work with variations of this governance contract.

Off-Chain governance Example

This sectoin is still being developed.

Deploy your ERC20 and make proposals in snapshot.

(back to top)

Roadmap

  • [] Add Upgradeability examples with the UUPS proxy pattern
  • [] Add Chainlink Oracle Integration with Snapsafe example

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Brownie - @BrownieEth Patrick Collins - @patrickalphac

(back to top)

Acknowledgments

(back to top)

You can check out the openzeppelin javascript tests for a full suite of an example of what is possible.