Merge pull request 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
commit c84003533f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;