Divulged Contracts

The Doodle Voting Invite

The Doodle’s CastVote Choice

CastVote Parameters

  • the voter
  • the option the voter wants to cast a vote for
  • the ID of the DoodleInvite the voter has received

Making sure the vote is legitimate

  • in line 9 we ensure that the invite the voter has received was issued for the doodle the voter is trying to cast a vote on
  • in line 10, we check that the party exercising the CastVote choice is the one who received the invite. This check is defending against malicious parties hijacking the Doodle and voting on behalf of somebody they are not. Only if the controller party is able to produce an invite in their name is the vote allowed to go through.
  • in line 11 we make sure the invite provided by the voter was issued by the Doodle’s organizer. This defends against a situation where a voter with a valid invite for doodle A would try to use that to vote on a Doodle with the same name, but created by a different organizer.
  • in line 12 we check that the Doodle is open for voting
  • and finally in lines 13 and 14, we check that the controller is actually a registered voter and that the option they’re trying to cast a vote for is a valid one for this Doodle.

Using TextMap to keep count of the votes

--

--

--

Lead Architect at LiquidShare, building a cloud native, blockchain enabled, financial services SaaS platform.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Offchain Labs: How Arbitrum is transforming Ethereum Scalability

Candidate Report — Part 2

DAO: The future of the organization

Hello Hakka!

Community Call #5 Recap

Resonate: New kid on the block

BCGS #10 — Emblem Schedule

Crown Platform NFT Framework (Part 2)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Emil Kirschner

Emil Kirschner

Lead Architect at LiquidShare, building a cloud native, blockchain enabled, financial services SaaS platform.

More from Medium

Brief Introduction of BTTCPAD —

Cross AMA with OpenFabric, part 2

What is OpenPool?

Safe Liquidations for Decentralized Derivatives