This is a Decentralized Autonomous Organization (DAO) workshop that focuses on applications using an ERC20 governance token with 100% on-chain voting by Chainlink Hackathon 2022.
- Governance: There are 2 types of governance in DAOS.
- On-Chain Governance: by using Smart Contracts.
- Off-Chain Governance: Database (IPFS) + Oracles (Chainlink).
We are implementing 1. 100% On-Chain Governance.
The workshop followed to complete this repo is this one. The repo that we are going to implement is like this one.
- Start hardhat project:
yarn hardhat
npm init -y
npm install --save-dev hardhat
- Install dependencies:
yarn add --dev hardhat @openzeppelin/contracts typescript typechain ts-node @typechain/ethers-v5 @typechain/hardhat @types/chai @types/node hardhat-deploy @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers ethers
yarn hardhat compile
We are using the Hardhat Blockchain development network. We are not using testnets in this case.
Insert the following imports inside hardhat.config.ts:
import "@typechain/hardhat"
import "hardhat-deploy"
import "@nomiclabs/hardhat-ethers"
yarn hardhat deploy
¡¡NOTICE!!: In helpers.ts directory you will find very usefull functions to manage local enviroment such us moveBlocks
function.
One execute a proposal a proposal.json
is going to be generated with the information of the proposal.
- We are running in a local environment (local host - hardhat development network).
To do so:
yarn hardhat node
A local server is running now.
- Open a new terminal to run the scripts and execute:
yarn hardhat run scripts/propose.ts --network localhost
yarn hardhat run scripts/vote.ts --network localhost
yarn hardhat run scripts/queue-and-execute.ts --network localhost
or any other script you want to execute.
- Hackathon DAO governance demo: The repo that is going to be implement.
- Openzeppelin github.
- Openzeppelin access contracts.
- Openzeppeling Wizard: used for helping on creating a secure governance mechanism.