A repo for working with and building daos

Overview

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.

Comments
  • Get proposal id with events

    Get proposal id with events

    • Get proposal id with events to avoid problems when using RPC node does not support debug_traceTransaction
    • Import ERC20Votes in GovernorContract for build
    opened by Techget 3
  • Met problem about `debug_traceTransaction` for RPC endpoint when `TransactionReceipt.return_value` is used.

    Met problem about `debug_traceTransaction` for RPC endpoint when `TransactionReceipt.return_value` is used.

    Dear developer,

    Context: Recently, I tried to use this implementation and deploy it to Polygon(Mumbai) with Infura as the node provider and Brownie.

    Related doc for brownie TransactionReceipt.return_value

    Problem: Received error message as

    RPCRequestError: Accessing `TransactionReceipt.return_value` on a confirmed transaction requires the `debug_traceTransaction` RPC endpoint, but the node client does not support it or has not made it available.
    

    Question:

    • Do you have some ideas about the workaround we can use in this case?
    • Do you consider to implement a version where it records the latest proposal_id as a state so that we can query the Governor contract instead?

    Thanks

    opened by Techget 2
  • deploy_and_run.py lacks a

    deploy_and_run.py lacks a "mint" call before delegating votes.

    When calling def deploy_governor(): we initially deploy the governance token, then the script calls governance_token.delegate(account, {"from": account}), but we have not called any mint function before; what occurs next is you voting with no weight.

    Here is the event I was getting when voting:

    OrderedDict([('voter', '0x66aB6D9362d4F35596279692F0251Db635165871'), ('proposalId', 89032801670644786090896159984413409335377199854927541874931809450777628720361), ('support', 1), ('weight', 0), ('reason', 'Cuz I lika do da cha cha')])

    Same event after including a mint function:

    OrderedDict([('voter', '0x66aB6D9362d4F35596279692F0251Db635165871'), ('proposalId', 25225749521061997514179783119955564126875735072184429625011844126970089268040), ('support', 1), ('weight', 1), ('reason', 'Cuz I lika do da cha cha')])

    opened by henryf10h 1
  • FIX: TimelockController, operation is not ready

    FIX: TimelockController, operation is not ready

    Hey, @PatrickAlphaC

    I've run into the same issue as you do during live of "code a dao, python version".

    So far the problem reproducing when trying to use ganache local chain, which in brownie of version 1.16.4 set as development network with this config,

    Ganache-CLI
        id: development
        cmd: ganache-cli
        cmd_settings: {'accounts': 10, 'evm_version': 'istanbul', 'gas_limit': 12000000, 'mnemonic': 'brownie', 'port': 8545}
        host: http://127.0.0.1
    

    Here's a patch which fixes timelockcontroller revert with simple delay between queue and execute trx

    BTW, thanks for your outstanding efforts at democratization of blockchain development,

    best of luck!

    opened by eatsleepraverepeat 1
  • the deploy script fails on type error

    the deploy script fails on type error

    Followed instruction, got bug

    brownie run scripts/governance_standard/deploy_and_run.py
    Brownie v1.19.0 - Python development framework for Ethereum
    
    New compatible solc version available: 0.8.14
    Compiling contracts...
      Solc version: 0.8.14
      Optimizer: Enabled  Runs: 200
      EVM Version: Istanbul
    CompilerError: solc returned the following errors:
    
    TypeError: Data locations of parameters have to be the same when overriding non-external functions, but they differ.
      --> /Users/tinytaplife/.brownie/packages/OpenZeppelin/[email protected]/contracts/governance/Governor.sol:92:5:
       |
    92 |     function hashProposal(
       |     ^ (Relevant source part starts here and spans across multiple lines).
    Note: Overridden function is here:
      --> /Users/tinytaplife/.brownie/packages/OpenZeppelin/[email protected]/contracts/governance/IGovernor.sol:91:5:
       |
    91 |     function hashProposal(
       |     ^ (Relevant source part starts here and spans across multiple lines).
    
    opened by aniche 3
Releases(0.0.1)
Owner
Brownie Mixes
Premade templates for use with Brownie
Brownie Mixes
kawadi is a versatile tool that used as a form of weapon and is used to cut, shape and split wood.

kawadi kawadi (કવાડિ in Gujarati) (Axe in English) is a versatile tool that used as a form of weapon and is used to cut, shape and split wood. kawadi

Jay Vala 2 Jan 10, 2022
NFT-Generator is the best way to generate thousands of NFTs quick and easily with Python.

NFT-Generator is the best way to generate thousands of NFTs quick and easily with Python. Just add your files, set your configuration and run the scri

78 Dec 27, 2022
A library from RCTI+ to handle RabbitMQ tasks (connect, send, receive, etc) in Python.

Introduction A library from RCTI+ to handle RabbitMQ tasks (connect, send, receive, etc) in Python. Requirements Python =3.7.3 Pika ==1.2.0 Aio-pika

Dali Kewara 1 Feb 05, 2022
A python tool give n number of inputs and parallelly you will get a output by separetely

http-status-finder Hello Everyone!! This is kavisurya, In this tool you can give n number of inputs and parallelly you will get a output by separetely

KAVISURYA V 3 Dec 05, 2021
Run async workflows using pytest-fixtures-style dependency injection

Run async workflows using pytest-fixtures-style dependency injection

Simon Willison 26 Jun 26, 2022
Analyze metadata of your Python project.

Analyze metadata of your Python projects Setup: Clone repo py-m venv venv (venv) pip install -r requirements.txt specify the folders which you want to

Pedro Monteiro de Carvalho e Silva Prado 1 Nov 10, 2021
✨ Un bot Twitter totalement fait en Python par moi, et en français.

Twitter Bot ❗ Un bot Twitter totalement fait en Python par moi, et en français. Il faut remplacer auth = tweepy.OAuthHandler(consumer_key, consumer_se

MrGabin 3 Jun 06, 2021
Script for generating Hearthstone card spoilers & checklists

This is a script for generating text spoilers and set checklists for Hearthstone. Installation & Running Python 3.6 or higher is required. Copy/clone

John T. Wodder II 1 Oct 11, 2022
ULID implementation for Python

What is this? This is a port of the original JavaScript ULID implementation to Python. A ULID is a universally unique lexicographically sortable ident

Martin Domke 158 Jan 04, 2023
A simple dork generator written in python that outputs dorks with the domain extensions you enter

Dork Gen A simple dork generator written in python that outputs dorks with the domain extensions you enter in a ".txt file". Usage The code is pretty

Z3NToX 4 Oct 30, 2022
一款不需要买代理来减少扫网站目录被封概率的扫描器,适用于中小规格字典。

PoorScanner使用说明书 -工具在不同环境下可能不怎么稳定,如果有什么问题恳请大家反馈。说明书有什么错误的地方也大家欢迎指正。 更新记录 2021.8.23 修复了云函数主程序 gitee上传文件接口写错了的BUG(之前把自己的上传地址写死进去了,没从配置文件里读) 更新了说明书 PoorS

14 Aug 02, 2022
PyGMT - A Python interface for the Generic Mapping Tools

PyGMT A Python interface for the Generic Mapping Tools Documentation (development version) | Contact | Try Online Why PyGMT? A beautiful map is worth

The Generic Mapping Tools (GMT) 564 Dec 28, 2022
A collection of tools for biomedical research assay analysis in Python.

waltlabtools A collection of tools for biomedical research assay analysis in Python. Key Features Analysis for assays such as digital ELISA, including

Tyler Dougan 1 Apr 18, 2022
✨ Un générateur de mot de passe aléatoire totalement fait en Python par moi, et en français.

Password Generator ❗ Un générateur de mot de passe aléatoire totalement fait en Python par moi, et en français. 🔮 Grâce a une au module random et str

MrGabin 3 Jul 29, 2021
Just some scripts to export vector tiles to geojson.

Vector tiles to GeoJSON Nowadays modern web maps are usually based on vector tiles. The great thing about vector tiles is, that they are not just imag

Lilith Wittmann 77 Jul 26, 2022
HeadHunter parser

HHparser Description Program for finding work at HeadHunter service Features Find job Parse vacancies Dependencies python pip geckodriver firefox Inst

memphisboy 1 Oct 30, 2021
Animation retargeting tool for Autodesk Maya. Retargets mocap to a custom rig with a few clicks.

Animation Retargeting Tool for Maya A tool for transferring animation data and mocap from a skeleton to a custom rig in Autodesk Maya. Installation: A

Joaen 63 Jan 06, 2023
About Library for extract infomation from thai personal identity card.

ThaiPersonalCardExtract Library for extract infomation from thai personal identity card. imprement from easyocr and tesseract New Feature v1.3.2 🎁 In

ggafiled 26 Nov 15, 2022
A collection of common regular expressions bundled with an easy to use interface.

CommonRegex Find all times, dates, links, phone numbers, emails, ip addresses, prices, hex colors, and credit card numbers in a string. We did the har

Madison May 1.5k Dec 31, 2022
Password generator

Password generator technologies used What is? It is Password generator How to Download? Download on releases Clone repo git clone https://github.com/m

Miek 1 Nov 02, 2021