indexed-finance / bounties

1 stars 1 forks source link

[$2000 DAI] Create off-chain polling website for NDX holders #1

Open d1ll0n opened 3 years ago

d1ll0n commented 3 years ago

Create off-chain polling website for NDX holders

Gitcoin link

Reward: $2000 in DAI

If you build this using a decentralized database solution (e.g. 3box or similar) which does not require a hosted server, the reward will be increased by an additional $500 DAI.

Summary

Create a clone of StrawPoll using React where votes are weighted by users' NDX balances.

There should be three primary pages:

Skills

How to measure balances

In order to measure the balance a user has in NDX in a manner that is not prone to manipulation, the website should query the user's balance from a specific Ethereum block. When a new poll is created, it should use a specific Ethereum block which is auto-filled using the latest Ethereum block or overridden by the user. The user's balance can then be queried to check what it was at the poll's starting block.

You can get this data by querying the Indexed governance subgraph for a user's balance and specifying in the query which block to check the balance for.

Indexed Governance Subgraph

The subgraph defines a TokenHolder struct which has a tokenBalance property - this is what we want. You can check the balance of a user for a block by querying:

{
  tokenHolder(
    id: {lower_case_user_address},
    block:{number: 11891558}
  ) {
    tokenBalance
  }
}

Additional reading Subgraph time-travel queries Subgraph query documentation

Poll Creation

Poll creation is where a user configures the settings for the new poll and specifies the question and choices.

If a user has not already connected their wallet, require them to do so before creating a poll.

The poll creation interface should have the following inputs:

Inspiration from StrawPoll image

Poll Interface

Every poll should have a unique ID which can be used to go to its interface.

The polling interface should:

Vote Interface

Inspiration from StrawPoll image

Results Interface

Inspiration from StrawPoll image

When the user submits their choice(s), require them to sign a typed message with the poll ID and their selection. Submit this data to a database, update the vote total and add the receipt (signature).

Inspiration

StrawPoll has an excellent user interface. Snapshot has most of the functionality we want for weighting votes by balance snapshots.

Questions

If you have any questions, you can join our Discord server and message a member of the team, or post a comment on this issue.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 2000.0 DAI (2000.0 USD @ $1.0/DAI) attached to it as part of the Indexed Finance fund.

gemasphi commented 3 years ago

Hey, can we still work on this, even though it's assigned? I emailed you regarding this bounty, I don't know if you've seen it.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 265 years, 8 months from now. Please review their action plans below:

1) gemasphi has started work.

Will start to work on this as soon as possible

Learn more on the Gitcoin Issue Details page.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 2000.0 DAI (2000.0 USD @ $1.0/DAI) attached to this issue has been cancelled by the bounty submitter