diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst index 8f58f339d..f71f1e23c 100644 --- a/docs/solidity-by-example.rst +++ b/docs/solidity-by-example.rst @@ -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;