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
- Host: GitHub
- URL: https://github.com/carlbarrdahl/conviction-voting
- Owner: carlbarrdahl
- Created: 2021-03-29T07:23:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-30T18:24:43.000Z (about 5 years ago)
- Last Synced: 2025-08-30T12:15:06.875Z (10 months ago)
- Topics: ceramic, dapp, idx, thegraphprotocol
- Language: JavaScript
- Homepage:
- Size: 727 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Decentralized Conviction Voting using Ceramic

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