Git Product home page Git Product logo

rousseau-protocol's People

Contributors

0xjim avatar foodaka avatar josepbove avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rousseau-protocol's Issues

Create proposal status function

We need to create a status function that given a proposalId will return us the current status in which the proposal is and an enum to handle the return.

As the proposal has a uint256 which is the time that it was created by using the global variables we can see in which phase the proposal is:
If block.timestamp - proposal creation time < start vote time then phase = not started yet

After this "time checks" we will check if a vote period is over and we will use an internal function to reach the quorum to see if the function needs to be executed. In the case that the quorum is not reached we will return "Completed" otherwise we should return something like "Queue" or "Pending"

Create vote tracking

We need to know if a user already has voted on a certain proposal to avoid double votes!

Create execution function

We need an execution function that will check the proposal status function. If it's on pending execution (Queued/Pending check the enum) you will need to run the update internal function and change the status to Executed (you will need to modify the status function and probably add an execution flag)

Connect Add value modal

Scope

  • Add the add value modal so users can create a value and integrate it into the values list page
  • prepare the transaction to write to the chain
  • handle errors and mock the response in the client

Screenshot 2022-12-02 at 11 41 09

Connect propose change model and prepare transaction

Scope

  • prepare the propose change dialog when the user clicks propose change.
  • pull in all the data and prepare payload for transaction on change
  • handle errors and mock the response in the client
  • show a loading state when tx is processing

Screenshot 2022-12-02 at 11 44 36

Create global voting parameters

Create global parameters that will be set on the constructor:

  • eligibility of voters (set NFT collection)
  • proposal period (in hours)
  • voting period (in hours)
  • quorum ( collaboration with the quorum feature issue required)

Create quorum feature

We need to create a quorum system to decide if a proposal needs to be executed or not, keeping in mind that the eligibility for a vote is owning an NFT it should probably be a % of the active NFT's. Add onlyOwner functions to change the quorum settings.

Check here for more information about the NFT Collection and isActive() #1

Create proposal data structure

We need to create the data structure for storing proposals. One proposal should have the following properties:

  • Value (string)
  • Number of votes (mapping enum votetype -> uint256 number of votes)
  • Proposal start (uint256), it will be the block.timestamp

Create ERC721 collection with isActive()

NFT collection that has an isActive() check (like ENS registry check for resolution). Basically we need to be able to track the "active" owners of the NFT because there can be NFT holders that won't have rights to vote.

Either NFT minted individually (merkle drop) or sent from one minter address.

We don't have info on the metadata, exact needed features for the NFT yet. Maybe soulbound?

I recommend using solmate https://github.com/transmissions11/solmate

Create propose and vote functions

At this stage we should have the data structure for a proposal, an enum with the vote types and a ERC721 with a public function called isEligible and a bunch of internal functions to help you do this task. You need to create a propose function that will just create a proposal data structure and save it, you will need to check that no active proposal exists for that array position that the sender is trying to replace (you can create an internal function to do this check for you). You will also need to create the voting function which will just count the votes inside of the proposal datastructure, get in touch with the "Create voting tracking" issue for a validation if somebody has voted.

Create a mapping to store the strings with internal functions to do the CRUD

CRUD functions:

addProposal() method

  • call & pass new string (e.g., ‘always be shipping’)
  • enter voting period of pre-determined X hours
  • voters vote yes/no/abstain
  • if quorum reached, then decision made
  • if quorum not reached, then automatic no

removeProposal()

  • call & pass uint index of the value to remove (9 ⇒ ‘one release at a time’)
  • enter voting period to remove of pre-determined X hours
  • voters vote yes/no/abstain (to remove)
  • if quorum reached, then decision made
  • if quorum not reached, then automatic no remove (status quo)

replaceProposal()

  • call & pass uint index of the value to remove
  • also pass new string (e.g., ‘some ghosts left behind’)
  • enter voting period of pre-determined X hours
  • voters vote yes/no/abstain
  • if quorum reached, then decision made
  • if quorum not reached, then automatic no

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.