From d1883d7e4bed38f14e7faf0794c61f486391e8c0 Mon Sep 17 00:00:00 2001 From: holgerd77 Date: Wed, 27 Sep 2017 12:20:47 +0200 Subject: [PATCH] Update example contract functions with default visibility (public) to avoid initial compiler warnings --- src/app/editor/example-contracts.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/editor/example-contracts.js b/src/app/editor/example-contracts.js index dd46caa84a..79af4c9803 100644 --- a/src/app/editor/example-contracts.js +++ b/src/app/editor/example-contracts.js @@ -18,7 +18,7 @@ contract Ballot { Proposal[] proposals; /// Create a new ballot with $(_numProposals) different proposals. - function Ballot(uint8 _numProposals) { + function Ballot(uint8 _numProposals) public { chairperson = msg.sender; voters[chairperson].weight = 1; proposals.length = _numProposals; @@ -26,13 +26,13 @@ contract Ballot { /// Give $(voter) the right to vote on this ballot. /// May only be called by $(chairperson). - function giveRightToVote(address voter) { + function giveRightToVote(address voter) public { if (msg.sender != chairperson || voters[voter].voted) return; voters[voter].weight = 1; } /// Delegate your vote to the voter $(to). - function delegate(address to) { + function delegate(address to) public { Voter storage sender = voters[msg.sender]; // assigns reference if (sender.voted) return; while (voters[to].delegate != address(0) && voters[to].delegate != msg.sender) @@ -48,7 +48,7 @@ contract Ballot { } /// Give a single vote to proposal $(proposal). - function vote(uint8 proposal) { + function vote(uint8 proposal) public { Voter storage sender = voters[msg.sender]; if (sender.voted || proposal >= proposals.length) return; sender.voted = true; @@ -56,7 +56,7 @@ contract Ballot { proposals[proposal].voteCount += sender.weight; } - function winningProposal() constant returns (uint8 _winningProposal) { + function winningProposal() public constant returns (uint8 _winningProposal) { uint256 winningVoteCount = 0; for (uint8 proposal = 0; proposal < proposals.length; proposal++) if (proposals[proposal].voteCount > winningVoteCount) {