An open API service indexing awesome lists of open source software.

https://github.com/carlbarrdahl/conviction-voting

Off-chaing Conviction Voting using Ceramic, IDX and TheGraph
https://github.com/carlbarrdahl/conviction-voting

ceramic dapp idx thegraphprotocol

Last synced: 4 months ago
JSON representation

Off-chaing Conviction Voting using Ceramic, IDX and TheGraph

Awesome Lists containing this project

README

          

# Decentralized Conviction Voting using Ceramic

![](ceramic_voting.png)

Inspired by:
https://blog.ceramic.network/trust-minimized-off-chain-conviction-voting

### Snapshot service

Node.js app deployed to Vercel with Github Actions to trigger function with cron job every x hours.

- Fetch all token holders using TheGraph
- Convert each holder address to DID
- Get convictions for DID with IDX
- Get proposals from convictions
- Calculate total conviction per proposal
- Calculate required convition per proposal
- Update state doc

* `npm run bootstrap` generates schemas and definitions used
* `npm run schema:ts` converts json-schema to Typescript types
* Server route `GET /config` returns snapshot did, definitions and schemas
* Server route `POST /snapshot` triggers an update for the ConvictionState (triggered from Github Actions cron job)
* Server route `POST /proposal` add a user-created proposal to the convcition state (so we don't have to wait for update trigger)

### Voting app

React app UI to create, list and vote for proposals.

- Call snapshot service for config (service did, definitions and schemas)
- Get conviction state for did and list proposals
- Sign in with Ethereum wallet (account address is used to map token balances)
- Create proposal
- Vote for proposals by allocation a fraction of tokens