This repository shows how to build a basic DAO (Decentralized autonomous organization). It includes tests that show how to create a proposal, how to give new users voting powers and tokens, as well as show have them vote and execute a proposal.
This repository is made using code from OpenZeppelin and Patrick Collin's DAO template.
This code also does on-chain governance ,however this repo has some additional flows such as issuing governance tokens to new users and granting them voting power.
This project uses Hardhat,If your new to Hardhat, I recommend you checkout their documentation.
- Clone this repo:
git clone https://github.com/pranavkirtani/Basic-Dao
cd basic-dao
- Install dependencies:
yarn
- Run Tests:
yarn hardhat test
- Check the accounts present
yarn hardhat accounts
The tests cover two scenarios
- A single participant with 100% of the vote share creating a proposal, voting on and executing the proposal.
- Adding another participant, issuing them new governance tokens, delegating voting power, creating a proposal and having both participants vote on it and then executing that proposal.
For an indepth understanding please refer my medium post , you can also share your queries on Twitter