Skip to content

Latest commit

 

History

History
74 lines (56 loc) · 2.66 KB

File metadata and controls

74 lines (56 loc) · 2.66 KB

DAO-implementation

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.
  1. On-Chain Governance: by using Smart Contracts.
  2. 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.

Dependencies and Set-Up

  • 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

How to compile

yarn hardhat compile

How to deploy

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.

How to run

  • 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.

Resources