Giter Club home page Giter Club logo

fevm-datadao-boilerplate's Introduction

FEVM DataDAO boilerplate

This has been updated to work with Wallaby FEVM network

Getting Started

It's recommended that you've gone through the hardhat getting started documentation before proceeding here.

Requirements

  • git
    • You'll know you did it right if you can run git --version and you see a response like git version x.x.x
  • Nodejs
    • You'll know you've installed nodejs right if you can run:
      • node --versionand get an ouput like: vx.x.x
  • Yarn instead of npm
    • You'll know you've installed yarn right if you can run:
      • yarn --version And get an output like: x.x.x
      • You might need to install it with npm

Important notice

This project uses v0.8 of the Zondax API Mocks. With more functions coming to the mock contracts, the contracts in this repo should be updated, too. See Packages used for more information.

Installation

  1. Clone this repo:
git clone https://github.com/mme022/datadao-boilerplate
cd datadao-boilerplate
  1. Install dependencies
yarn

or

npm i 

If you want to deploy to wallaby: 3. Add a .env file with the same contents of .env.example, but replaced with your variables. WARNING WARNING WARNING

DO NOT PUSH YOUR PRIVATE_KEY TO GITHUB

  1. Get the Deployer Address

Run this command:

yarn hardhat get-address

The f4address is the filecoin representation of your Ethereum address. This will be needed for the faucet in the next step.

The Ethereum address will be used otherwise.

5.Fund the Deployer Address

Go to the Wallaby faucet, and paste in the f4 address we copied in the previous step. This will send some wallaby testnet FIL to the account.

6.Deploy the Governance Contracts and the Filecoin Mock APIs

Type in the following command in the terminal:

yarn hardhat deploy --network wallaby

This will compile the contract and deploy it to the Wallaby network automatically!

Keep note of the deployed contract address for the next step.

If you just want to deploy the DAO structure, see the tags inside the deploy scripts.

Usage

On-Chain Governance Example

Here is the rundown of what the test suite does.

  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!

Additionally, you can do it all manually on your own local network like so:

  1. Setup local blockchain
yarn hardhat node
  1. Call a Market function defined in helper-hardhat-config.ts

In a second terminal (leave your blockchain running)

yarn hardhat run scripts/propose.ts --network localhost
  1. Vote on that proposal
yarn hardhat run scripts/vote.ts --network localhost
  1. Queue & Execute proposal!
yarn hardhat run scripts/queue-and-execute.ts --network localhost

You can also use the Openzeppelin contract wizard to get other contracts to work with variations of this governance contract.

(back to top)

Packages used

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

@mme022

(back to top)

Acknowledgments

(back to top)

fevm-datadao-boilerplate's People

Contributors

0xmme avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.