Strawberry-Pizza / ICO2.0

This repository has moved to https://github.com/decipherhub/ICO2.0
GNU General Public License v3.0
3 stars 3 forks source link

Why do we need revoke_list and index_party_list? #4

Open JhChoy opened 6 years ago

JhChoy commented 6 years ago
  1. revoke function I don't think it's necessary. We designed voters to make cancel and re-vote easily.

  2. index_party_list we can omit it by using address[] party_list instead of mapping(uint=>address) party_list

Also, we should separate functions of developers(or lockedTokens) and normal voters. Actually developers(and lockedTokens) can't vote via normal vote function because they are locked in one contract(VestingTokens.sol). Then, we can separate party_list to locked_party_list and public_party_list. This process doesn't need isDeveloper check process of _snapshot function. Above dividing process could reduce gas prices of _snapshot function

jw-pyo commented 6 years ago
  1. revoke function Yeah, revoke() is withholded because of necessity. Then, we make a getBack() function on vote contract instead of revoke().

  2. You mean mapping(address=>vote_receipt) party_dict? If we use only address[] party_list , we should bear a huge operation when deletion of some addresses. Because in the middle of account is eliminated, it is necessary to pull up all accounts behind eliminated account. But if we use mapping(address=>vote_receipt) party_dict, we don't need any additional operation(because we mask the boolean as false/true) and also get the personal information such as voting power.

And, I agree that separating party list into two groups.

JhChoy commented 6 years ago

Agree with that point. Sry for latest commit. Please check party_list I've changed it to address[]. And please do the splitting party_dict process together.