Git Product home page Git Product logo

dao-bonus's Introduction

DAO Bonus for the EthGlobal DaoHack Hackathon

The idea

The idea of this project is to reward teams that manage portfolios for a fund manager. For example, Team 1 is in charge of a portfolio of certain assets, Team 2 is in charge of a portfolio of other assets, etc.. At regular interval, the performance fo each team is measured by getting the overall performance of each portfolio via Covalent and calculating its growth rate. The best team gets rewarded an NFT with carries streams from Superfluid.

Each team has a specific target growth to reach. For e.g. Team 1 is in charge of mature/well-established assets. The growth rate needed for Team 1 to get and the NFT is 5%.

Once all calculation are done, we can imagine a certain duration where those performances are reviewed (e.g. via reportings).

Once performances have been reviewed, if a team has outperformed the current NFT holder, a proposal is created to vote for the transfer of the NFT that another team. If the vote passes, then the Bonus NFT ownership changes to the best performing team which will receive the flow from the NFT via Superluid.

DISCLAIMER: Unfortunetly, I could not inter-connect all pieces together in time, so only isolated pieces can work: It is possible to get the performance from the data from Covalent and you can also do proposal/queueing/voting but it is not yet connected to Superfluid. For now, instead of doing the change of ownership of the NFT from one team to the other, Timelock only store the address of the winning team in a separate contract.

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

Installation

  1. Clone this repo:
git clone https://github.com/stephanBV/dao-bonus
cd dao-bonus
  1. Install dependencies
yarn

or

npm i 

If you want to deploy to a testnet: 4. 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

Usage

  1. Get the teams performances
node scripts/FindGoodPortfolios.js

For simplicity, all previous performances are also hard typed. For this example, the current NFT holder is Team 1. If we see that for e.g. Team 2 has performed better and should get the NFT with the Superfluid stream, we continue with the proposal below.

  1. Setup local blockchain
yarn hardhat node
  1. Propose a new address to be added to our Bonus contract For this example, you can find all parameters in helper-hardhat-config.ts where you can change the value of NEW_STORE_VALUE with the Team address.

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.

License

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

(back to top)

dao-bonus's People

Contributors

stephabauva avatar patrickalphac avatar

Watchers

James Cloos avatar  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.