Giter Club home page Giter Club logo

governoralpha-with-proof-of-voting-nft's Introduction

【GovernorAlpha with Proof of Voting NFT】

【Introduction of the GovernorAlpha with Proof of Voting NFT】

  • This is the smart contract that incentivize voters (of compound) by using the proof of voting NFTs.
    • Once a token holder (of COMP) execute voting, that token holder receive a NFT as a proof of voting.
    • As a incentive to keep engaging in voting, token holders who has voting NFTs can receive rewards regularly.

  • This smart contract try to solve current disadvantage of on-chain voting that:
    • Token holders (of COMP) need to pay GasFee⛽️ for every voting. (In case token holders vote by themself)
    • Small share holders (of COMP) has less voting power than large share holders.
      • By distributing rewards via this smart contract like above, all token holders (of COMP) can get benefit to engage in voting even if they are small share holders (of COMP).


 


【Workflow】

  • Workflow
    • ① Create a proposal (from voters to the GovernorAlphaWithProofOfVotingNFT contract).
    • ② Create a proposal (from the GovernorAlphaWithProofOfVotingNFT contract to the GovernorAlpha contract).
      => Workflow of ① and ② above are execute via the GovernorAlphaWithProofOfVotingNFT contract in a single transaction.
    • ③ Cast a vote (from voters to the GovernorAlphaWithProofOfVotingNFT contract).
    • ④ Cast a vote (from the GovernorAlphaWithProofOfVotingNFT contract to the GovernorAlpha contract).
      => Workflow of ③ and ④ above are execute via the GovernorAlphaWithProofOfVotingNFT contract in a single transaction.
    • ⑤ Create a new proof of voting NFT .
    • ⑥ Mint a proof of voting NFT.
    • ⑦ Transfer a proof of voting NFT to voter who is voted.
    • ⑧ Distribute reward tokens (COMP) based on number of a proof of voting NFTs .

  • Diagram of workflow: 【Decentralized Governance Hack🌍Compound】GovernorAlpha with Proof of Voting NFT

 


【Remarks】

  • Versions:
    • Solidity (Solc): v0.5.16
    • Hardhat: v2.6.1
    • ether.js: v5.4.6
    • web3.js: v1.5.2
    • @openzeppelin/contracts: v2.5.1

 


【Setup】

① Install modules

  • Install npm modules in the root directory
npm install

② Compile contracts

npm run compile

 


【Unit test】

  • Scenario test
npm run test:Scenario.test.js

 


【Demo】


 


【References】



governoralpha-with-proof-of-voting-nft's People

Contributors

masaun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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