DemocracyEarth / dao

Minimal Quadratic Voting DAO.
MIT License
38 stars 16 forks source link

Polish, Test and Deploy a Quadratic Voting DAO #1

Closed santisiri closed 3 years ago

santisiri commented 4 years ago

Challenge Description

DemocracyDAO is a fork of the original MolochDAO v1 contract with two key modifications:

Our goal with this bounty is finishing the implementation, deploy and test this contract on the Ethereum mainnet.

Why Quadratic Voting?

In our research we have found that one of the outstanding properties of QV is that it allows for a constituency to prioritize a long tail of options. During our pilot implementation with the Colorado State House 🇺🇸in 2019 we used QV to help 41 legislators prioritize over 107 bills. Unlike other approaches like Participatory Budgeting (PB) where the outcome led to having "70% of the bills were part of a big blob with roughly the same amount of votes and no clear preference", QV allowed legislators get an organic distribution of votes over the entire list of proposals.

This emergent property of QV will help create better governance mechanisms for DAOs in general. At Democracy Earth we are aiming to implement a QV-Compatible Moloch DAO to get the Ethereum community to rank every DAO in the ecosystem. A DAO of DAOs able to rank the long tail of entities created in the ecosystem will help establish their trustworthiness and reputation.

If you want to learn more about QV and the first official pilot in the USA, we recommend the following links:

Technical Aspects

These are the main modifications that can be found on the code as it is right now when compared with a default MolochDAO v1:

Judging Criteria

The bounty will be awarded to the developer (or team) able to polish the current code and make a successful deploy of a demo QV DAO that is able to allow for:

Submission Requirements

A deployed QV DAO on the Ethereum mainnet ready to be tested and used and a Pull request with the final source code.

Submission Deadline

End of the GitcoinxChange Hackathon.

Requirements

This is for Solidity developers. Familiarity with MolochDAO code is a helpful plus.

Bonus Track

Additional materials about Quadratic Voting and how we will use it for the governance of our protocol can be found on this Twitter thread.

gitcoinbot commented 4 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 2.456 ETH (496.59 USD @ $202.19/ETH) attached to it as part of the DemocracyEarth fund.

gitcoinbot commented 4 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 1 year, 8 months ago. Please review their action plans below:

1) 18dew has started work.

I have writen a QV contract , These contract is non privacy preserving at this point will to do... 2) angelagilhotra has started work.

I've been reading about Quadratic Funding and RadicalxChange would love to put theory into practice through this bounty. 3) keviinfoes has started work.

I will perform the following steps:

  1. Evaluate the DemocracyDAO fork, mainly the Moloch.sol contract.
  2. Fix compile and potential other errors in the contracts.
  3. Make efficiency adjustments to the contract where needed.
  4. Write test specific for the quadratic vote testing, focussed on the judging criteria.
  5. Deploy to ropsten for testing.

The DemocracyDAO contract already has the logic for quadratic voting. The above steps perform the polish, test and deploy of the contract as requested in this challenge. 4) sanchitdawarsd has started work.

i have started working on qv solidity errors and deploy it to ropsten test network. 5) samarth30 has started work.

I have started working on the errors of the smart contract and will deploy it to the ropsten test network 6) moose-code has started work.

Okay, think I've got a solid design. Paragraphs spaces don't show in these comments (from previous experience), so excuse the one big paragraph. Spoke quite a bit to Santiago to better understand the system requirements and think I've got a good system in place that we can tweak slightly.

Going to outline a couple of the major design decisions: 1) Not using MolochDAO as this is bit of a fitting a square peg into a round hole. Its got some nice elements, but its quite different and we aren't really using this DAO for funding. 2) We split the logic into 2 main contracts. The deposits contract is non-upgradeable and provides guarantees to participants that they will always be able to withdraw their initial stake at some point in time. The dao voting logic contract is separate and upgradeable. This will allow admin some crucial modification ability as they monitor the behavior of the project.
3) We are using dai as the DAO currency. In order to incentivize DAO participation, dai is a nice currency we can use in some other defi applications. 4) So much of getting QV right is designing against sybil attacks to ensure the QV voting system cannot be gamed. We are initially planning on using a min join threshold before vote power kicks in to guard against sybil, i.e. if you need to say join the DAO with a minimum of 500 dai, and your 'vote credits' are only the excess of this figure.

There is lots more explain, but I will try give a brief system characterization.
The system works in iterations, with the length of an iteration being configurable (my suggestion is maybe quarterly). This allows us to define a point in time where previous votes have decayed and users will need to reassess their voting decisions and cast again. This designs against set it and forget it behavior. It also gives gives windows for users to enter and exit the DAO in a way that cannot be malicious and swing the vote. There are a lot more subtleties to it. It also provides a perfect point to distribute the interest generated from the DAO over the past quarter. I envision this interest should be sent to someone that has voted, as a means to encourage voting. I have successfully deployed and integrated Chainlink VRF on Kovan and Ropsten before, this would provide a verifiable source of randomness to chose one voter. These are just my opinion to incentivize voters at the moment. Lets move away from iterations and talk quick about proposals and users.

Proposals "i.e. will be other DAOs", can be submitted by anyone (to list their dao), but they require some stake in the system to stop spamming. This is configurable but lets say its 50 dai for now. They can either be in an active state where they are voted for, or, they may be withdrawn by the proposer, no longer allowing this dao to be voted for.

Users join the DAO at anytime with minimum threshold amount of dai (basic sybil defense). This dai gets lent out on the Aave protocol to generate some basic interest (useful to incentivize the voting prize). This is important as otherwise users are unlikely to lock up their funds in this dao to rank daos, unless they can have some basic motivation. Users can quadratic vote for a each of project once during an iteration. There are plenty of modifiers to safegaurd against attacks, and certain requirements to ensure the contract isn't vulnerable to flash loan votes etc.

I have finished writing the contracts to implement the above system. There are also 46 tests that ensure the system behaves exactly as designed. Buidler is awesome and the entire suite of tests run in only 22s. I have also created a code coverage report showing that 93% of the code in the smart contract has been covered by those tests.

It was a fun system to design and build, I look forward to chatting through some of the more subtle design aspects. 7) cirsteve has started work.

Steps to complete the tasks 1) fix errors so tests pass 2) add tests for quadratic voting and confirm the conract supports -- creating proposals with multiple candidates, allowing multiple accounts to vote on proposals, allowing votes on multiple proposals, and properly calculating QV share and election results 8) jday1235 has started work.

I intend to assess the current and past framework for any easy upgrades. Then, the voting system will be tweaked around to provide a more satisfactory voting platform, in line with the given guidelines. Much focus will be put into ensuring the QV aspects are robust, fair, and working as intended.

Learn more on the Gitcoin Issue Details page.

gitcoinbot commented 4 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 2.456 ETH (599.02 USD @ $243.9/ETH) has been submitted by:

  1. @keviinfoes
  2. @samarth30
  3. @moose-code

@santisiri please take a look at the submitted work:


gitcoinbot commented 4 years ago

Issue Status: 1. Open 2. Cancelled


The funding of 2.456 ETH (572.83 USD @ $233.24/ETH) attached to this issue has been cancelled by the bounty submitter

gitcoinbot commented 4 years ago

⚡️ A tip worth 1.96800 ETH (459.01 USD @ $233.24/ETH) has been granted to @moose-code for this issue from @santisiri. ⚡️

Nice work @moose-code! To redeem your tip, login to Gitcoin at https://gitcoin.co/explorer and select 'Claim Tip' from dropdown menu in the top right, or check your email for a link to the tip redemption page.

gitcoinbot commented 4 years ago

⚡️ A tip worth 0.49200 ETH (114.75 USD @ $233.24/ETH) has been granted to @keviinfoes for this issue from @santisiri. ⚡️

Nice work @keviinfoes! Your tip has automatically been deposited in the ETH address we have on file.