New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provided configurability into the EVT voting rounds #32

Merged
merged 40 commits into from Sep 18, 2018

Conversation

Projects
None yet
5 participants
@nklipa13
Copy link
Collaborator

nklipa13 commented Aug 17, 2018

Possibility to change:

  • Number of candidates included in the vote
  • Number of winners in the vote
  • Criteria to win the vote (i.e. top 3, all tokens receiving over a certain number of votes)
  • Duration of vote
  • Amount for voting (you are not forced to vote with full balance)

Added method to return winners for proposalId based on criteria
Added tests

nklipa13 and others added some commits Aug 17, 2018

Add possiblity to have different criteria to win the vote, add possib…
…ility to vote with custom amount of votes, be able to have different number of winners in vote
Merge remote-tracking branch 'origin/master'
# Conflicts:
#	src/actions/tokenActions.js
mapping(address => address) public myDelegate;
mapping(address => bool) public isDelegate;

mapping(uint => mapping(address => bool)) public isVoted;

This comment has been minimized.

@plutoegg

plutoegg Sep 15, 2018

Contributor

Could rename isVoted to isVotedInRound for clarity

balance += DestructibleMiniMeToken(p.votingToken).balanceOf(user);
}

require(_amount <= balance);

This comment has been minimized.

@plutoegg

plutoegg Sep 15, 2018

Contributor

If using a partial amount here, the remainder will be wasted?

Since gaveVote will now return true, and we have the check above require(!gaveVote(msg.sender));

}

function unregisterAsDelegate() public {
require(myVotes[msg.sender].length == 0);

This comment has been minimized.

@plutoegg

plutoegg Sep 15, 2018

Contributor

So they cannot unregister while one person has chosen them as delegate? So anyone can block you from leaving by registering you as their delegate

This comment has been minimized.

@plutoegg

plutoegg Sep 15, 2018

Contributor

I think in this case we should allow them to undelegate, and also leave the myVotes array (so it is the user's responsibility to undelegate from the unresponsive user). As a solution in the vote(), is that we can then add a check to see if the user is a delegate using isDelegate before counting their myVotes. Their delegated votes should be skipped and not used if they have unregistered but not yet had their votes removed.


function undelegateVote() public {
// can't undelegate if I already gave vote in this round
require(!gaveVote(msg.sender));

This comment has been minimized.

@plutoegg

plutoegg Sep 15, 2018

Contributor

Actually, since we already check for gaveVote in the vote function, and the register function, and the delegateVote function , I think it is fine to allow them to undelegate in this round even if their delegate already voted for them

This comment has been minimized.

@nklipa13

nklipa13 Sep 16, 2018

Collaborator

If he undelegates, his delegate will be set to 0 and then method gaveVote will return false and he will be able to vote again


// transfer can use someone who didn't vote and doesn't have a set delegate
function onTransfer(address _from, address _to, uint _amount) public view returns(bool) {
return !gaveVote(_from);

This comment has been minimized.

@plutoegg

plutoegg Sep 15, 2018

Contributor

Comment says that onTransfer should also block if someone has a set delegate? This doesn't seem to be the case at the moment - Seems like someone could still transfer if they have set a delegate

nklipa13 and others added some commits Sep 16, 2018

@plutoegg plutoegg merged commit 028cd91 into ethfinex:master Sep 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment