DemocracyEarth / old_dapp

Liquid democracy smart contract implementation
32 stars 13 forks source link

Implement basic vote() function #11

Closed medied closed 6 years ago

medied commented 6 years ago

Implementation must come with its respective tests in the corresponding test file

medied commented 6 years ago

Simple spec after a chat with @aecc, reflects what's in #13

Glossary

  1. Ballot - a instance of what is being voted on, starting with binary (yes/no) choice for simplicity
  2. Weight - represents the voting power of each voter
  3. Registered voter - when registered a voter has been assigned an initial weight of 1 and has been added to voters ledger

Initial Assumptions

  1. When a voter is first registered, she is assigned an initial weight of 1
  2. For every liquid democracy session, there is only one ballot that voters can vote on
  3. A voter cannot change her vote after she has voted
  4. No gas optimizations in this initial proof of concept

Functional Requirements

  1. Only registered voters can vote
  2. Voters cannot vote twice
  3. A voter can vote on a ballot with her corresponding voting weight
aecc commented 6 years ago

@medied looks good. I would add in the assumptions for the moment: "a voter cannot change her vote after it voted" This means that a delegation will potentially increment the representative weight, am I right?

medied commented 6 years ago

Yes good, updated now. Delegations should increment weight, agreed.