Skip to content

Instantly share code, notes, and snippets.

@talkol
Last active July 20, 2022 08:23
Show Gist options
  • Save talkol/e5168d499f45b934f18cef1692e2bdba to your computer and use it in GitHub Desktop.
Save talkol/e5168d499f45b934f18cef1692e2bdba to your computer and use it in GitHub Desktop.
  1. Simple web UI in JavaScript/TypeScript

    • Functional UI only, doens't need to look good design-wise or use any UI framework

    • One screen web app

    • Connect Metamask (wherever)

    • Shows one screen with the proposal question - hardcoded in the HTML

    • On this screen multiple choice with button "vote"

    • When click "vote" - offline JSON signature on:

      {
        "voter": "0xETH-addrss",
        "proposal": 38,
        "choice": 2,
        "date": 3127632 // unix timestamp
      }
      
    • HTTP POST of the signed JSON to (2)

  2. Heroku or glitch.com page (express+NodeJs template)

    • AJAX endpoint to receive a vote (via HTTP POST)
    • Stores the JSON vote file on disk in some directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment