From 8a3d6b4b3f69186d2104f0c4f3c9eda7ffbf1d63 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 27 Nov 2014 00:26:56 +0100 Subject: [PATCH] Make use of msg.sender. --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index ddef710d4a..495b7796c9 100644 --- a/index.html +++ b/index.html @@ -49,7 +49,7 @@ Source code on the left, compiled code and AST on the right (or error).
contract Ballot { // Create a new ballot with $(_numProposals) different proposals. function Ballot(uint8 _numProposals) { - address sender = 0x123; // msg.sender + address sender = msg.sender; chairperson = sender; numProposals = _numProposals; } @@ -57,13 +57,13 @@ Source code on the left, compiled code and AST on the right (or error). // Give $(voter) the right to vote on this ballot. // May only be called by $(chairperson). function giveRightToVote(address voter) { - if (/*msg.sender != chairperson ||*/ voted[voter]) return; + if (msg.sender != chairperson || voted[voter]) return; voterWeight[voter] = 1; } // Delegate your vote to the voter $(to). function delegate(address to) { - address sender = 0x123; // msg.sender + address sender = msg.sender; if (voted[sender]) return; while (delegations[to] != address(0) && delegations[to] != sender) to = delegations[to]; @@ -76,7 +76,7 @@ Source code on the left, compiled code and AST on the right (or error). // Give a single vote to proposal $(proposal). function vote(uint8 proposal) { - address sender = 0x123; // msg.sender + address sender = msg.sender; if (voted[sender] || proposal >= numProposals) return; voted[sender] = true; votes[sender] = proposal;