Final Term/Project Questions

Questions about FinalTerm

Questions about FinalTerm

di GIUSEPPE BISICCHIA -
Numero di risposte: 6

Good evening,

I have some questions regarding the implementation of the final term's smart contract:

  • What happens if there is a parity between yaySouls and naySouls? I assumed that in order to be confirmed a mayor needs the majority + 1, so in the event of a tie, the nos win
  • Although not useful, is a voter allowed to vote with 0 souls? Is it left to our choice?
  • I noticed that in cast_envelope it is not checked whether the voter has already voted or not, this, on the one hand, allows the voter to change his vote but on the other hand, causes an increase in voting_condition.envelopes_casted and therefore it could happen that the quorum is reached but in reality, only one voter voted, who only changed his vote several times. It's correct? I added a further control thus avoiding that a voter can vote more than once (and therefore not even allowing the modification of the vote).

Thank you.

In riposta a GIUSEPPE BISICCHIA

Ri: Questions about FinalTerm

di ANDREA LISI -
Hi Giuseppe,
- What happens if there is a parity between yaySouls and naySouls? I assumed that in order to be confirmed a mayor needs the majority + 1, so in the event of a tie, the nos win
Right. You can choose how to handle this case.

- Although not useful, is a voter allowed to vote with 0 souls? Is it left to our choice?
Well, it would help reaching the quorum. But, as wrote in the text, that mechanic is easily exploitable, and it is there to simplify the testing (that I imaged to be more flexible than a time constraint for the purpose of the final term). In my opinion, you can put soul > 0 to avoid to manage these cases.

- I noticed that in cast_envelope it is not checked whether the voter has already voted or not, this, on the one hand, allows the voter to change his vote but on the other hand, causes an increase in voting_condition.envelopes_casted and therefore it could happen that the quorum is reached but in reality, only one voter voted, who only changed his vote several times. It's correct? I added a further control thus avoiding that a voter can vote more than once (and therefore not even allowing the modification of the vote).
Thank you! This was completely a mistake! I did not consider it because in Ethereum can you easily vote with multiple accounts with no cost. But I did not think that voting with the same account would override the vote, but would also increase the counter.

Thank you for these observations! I will consider to update the text of the contract and the final term.
In riposta a ANDREA LISI

Ri: Questions about FinalTerm

di GIUSEPPE BISICCHIA -
Thank you so much for the replies and clarifications!
In riposta a GIUSEPPE BISICCHIA

Ri: Questions about FinalTerm

di ANDREA LISI -
Hi, a small fix to my answer:

*- Although not useful, is a voter allowed to vote with 0 souls? Is it left to our choice?*
I would change my answer with "Yes, because you cannot know until you open the envelope, because the vote data is secret (an hash).".
So, you can consider an envelope with 0 soul.
Of course this would exploit the contract (increase the quorum) but, as written in the text, that condition is a representative one and not, let's say, "production ready".