Merge pull request #5314 from berkerol/patch-1

DOCS: Add check for whether voter has right to vote
This commit is contained in:
chriseth
2018-10-26 11:42:34 +02:00
committed by GitHub
+1
View File
@@ -152,6 +152,7 @@ of votes.
/// to proposal `proposals[proposal].name`.
function vote(uint proposal) public {
Voter storage sender = voters[msg.sender];
require(sender.weight != 0, "Has no right to vote");
require(!sender.voted, "Already voted.");
sender.voted = true;
sender.vote = proposal;