From 0217033c463f6b7c7abced3f439778a5bb1a10f2 Mon Sep 17 00:00:00 2001 From: Quentin Gaultier Date: Mon, 24 Apr 2017 11:03:30 +0200 Subject: [PATCH] fix contract 8 --- 8_fix_HeadOrTail.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/8_fix_HeadOrTail.sol b/8_fix_HeadOrTail.sol index b3495de..8c436fe 100644 --- a/8_fix_HeadOrTail.sol +++ b/8_fix_HeadOrTail.sol @@ -18,6 +18,7 @@ contract HeadOrTail { chosen=true; lastChoiceHead=_chooseHead; + lastParty=msg.sender; } @@ -25,11 +26,11 @@ contract HeadOrTail { require(chosen); require(msg.value == 1 ether); + chosen=false; + if (_guessHead == lastChoiceHead) msg.sender.transfer(2 ether); else lastParty.transfer(2 ether); - - chosen=false; } }