mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12956 from nobutoba/fix-ballot-contract
Add a require statement to the Ballot contract
This commit is contained in:
commit
3e3e73e380
@ -109,6 +109,7 @@ of votes.
|
||||
function delegate(address to) external {
|
||||
// assigns reference
|
||||
Voter storage sender = voters[msg.sender];
|
||||
require(sender.weight != 0, "You have no right to vote");
|
||||
require(!sender.voted, "You already voted.");
|
||||
|
||||
require(to != msg.sender, "Self-delegation is disallowed.");
|
||||
|
Loading…
Reference in New Issue
Block a user