Seed Vote — Web3

A seed vote dapp on villagers' phones: wallets, networks, stuck votes, reorgs, logs and signatures. 14 levels, right in the browser.

What the levels ask

  1. Monday morning, Pilih Benih opens. Three members open the page: Grandma Marni only wants to see the poster and refuses any wallet window she did not ask for, Mrs. Sari connected yesterday, and Mrs. Yanti has a new phone. Fill how the page asks the wallet when it opens and when Connect is tapped, so no window opens by itself, Mrs. Sari is signed in straight away, and Mrs. Yanti connects from the button.
  2. Mr. Harun taps Connect, then refuses in his wallet: he wants to ask Mrs. Yanti first. Fifteen minutes later he taps again and approves. Mrs. Lastri approves straight away. Fill the catch so that after Mr. Harun refuses, his screen calmly says Not now. Tap Connect when you are ready. with the Connect button, and both end up signed in.
  3. At Mrs. Yanti's house one phone has two accounts in its wallet. Mrs. Yanti signs in and votes Mentik Wangi, then hands the phone to Mr. Harun. He switches to his own account in the wallet app and votes Rojolele. Fill what the page listens to from the wallet, so Mr. Harun's vote is recorded under his account, and the screen he taps names the same person as the account that signs.
  4. Mrs. Lastri's wallet is still on Rantai Latihan BPP, the training chain from last month's workshop. Mr. Tono's wallet is newly installed and knows only its default network, Ethereum: it has never heard of Rantai Benih Sukamaju. Fill the step before the vote is sent, so both votes reach Rantai Benih.
  5. Tuesday's trial vote closes at 10:00. Mrs. Ijah votes at 09:59:10 and Mrs. Sari at 09:59:50, just before the next block. Fill what the page does after the wallet returns the hash, so the screen says Your vote is in only when the chain really recorded it.
  6. On Wednesday morning Mr. Seno imitates a busy morning: every block's base fee goes up to 30 gwei. Mrs. Ijah's wallet, in Saver mode, has just sent her vote with a max fee below that, and the vote waits for an hour. Mrs. Ijah taps Vote again. Fill what the page does when a vote is still queued, so Mrs. Ijah's vote gets in without waiting any longer.
  7. On Wednesday afternoon two votes are stuck in Saver mode. Mrs. Lastri presses Speed up in her wallet app, and Grandpa Rimba presses Cancel: he wants to talk it over with Mr. Tono first. Both replace the transaction from the wallet, so the hash the page holds will never be mined. Fill how the page waits, so Mrs. Lastri's screen says her vote is in, and Grandpa Rimba's does not.
  8. Thursday's trial session closes at 11:00, and the morning is busy until 11:00. Mrs. Sari's vote is stuck from 08:58, then at 09:28 the laptop loses power: when it comes back, its node's queue is empty. The neighbourhood head's vote is sent after that and gets stuck too. The page stops waiting after an hour (300 blocks). Fill what the page does then, so both votes get in before closing.
  9. The seed chain now has two nodes: the Rumah Benih laptop and a mini PC at the village hall. At Thursday's 12:00 closing rehearsal the village wifi drops just after Mrs. Lastri votes. The laptop takes her vote; at the hall, Mr. Tono closes voting early and Mrs. Lastri's vote only lands after that. Once reconnected, the hall's longer branch wins. Fill how many confirmations to wait for and what to do after, so no screen ever says final for a vote that is not recorded.
  10. On Friday morning the screen on the Rumah Benih wall opens the count board for the first time, read from the Voted events since the contract was deployed on Monday. That is more than 2,500 blocks, the Rumah Benih RPC gateway answers getLogs for at most 1,000 blocks per request, and two members changed their vote during the week. Fill how the board reads and what it keeps, so the count for each variety matches what the contract holds.
  11. Friday noon: the 12:00 closing rehearsal, with the board on since morning. The board tells final votes apart from those still waiting. The village wifi drops again: on the laptop's branch Mrs. Ijah's vote gets in, on the hall's branch Mr. Tono closes first and Mrs. Ijah's vote reverts. The hall's branch wins. Fill what the board throws away on each new block and how deep a vote must be to count as final, so the final count never goes down and ends equal to the contract.
  12. On Friday afternoon there is a meeting, and its attendance list is signed with the wallet: no transaction, no fee. The Rumah Benih server hands out a one-time code and checks an EIP-712 signature of SignIn { member, code, validUntil } with viem. Grandma Marni only signs what she can read; Grandpa Rimba signs anything. Fill how the page asks for the signature, so both are marked present and nobody is asked to sign a string of hex.

And more, 14 levels in all.