diff --git a/blockchain-workbench/application-and-smart-contract-samples/bazaar-item-listing/ethereum/BazaarItemListing.zip b/blockchain-workbench/application-and-smart-contract-samples/bazaar-item-listing/ethereum/BazaarItemListing.zip index af2e49749..dd7c671fe 100644 Binary files a/blockchain-workbench/application-and-smart-contract-samples/bazaar-item-listing/ethereum/BazaarItemListing.zip and b/blockchain-workbench/application-and-smart-contract-samples/bazaar-item-listing/ethereum/BazaarItemListing.zip differ diff --git a/blockchain-workbench/application-and-smart-contract-samples/ping-pong-game/ethereum/PingPongGame.sol b/blockchain-workbench/application-and-smart-contract-samples/ping-pong-game/ethereum/PingPongGame.sol index f9a79abd0..9203926d5 100644 --- a/blockchain-workbench/application-and-smart-contract-samples/ping-pong-game/ethereum/PingPongGame.sol +++ b/blockchain-workbench/application-and-smart-contract-samples/ping-pong-game/ethereum/PingPongGame.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.25; +pragma solidity >=0.4.25 <0.6.0; contract Starter { @@ -8,10 +8,10 @@ contract Starter string public PingPongGameName; address public GameStarter; - address public GamePlayer; + Player public GamePlayer; int public PingPongTimes; - constructor (string gameName) public{ + constructor (string memory gameName) public{ PingPongGameName = gameName; GameStarter = msg.sender; @@ -20,30 +20,28 @@ contract Starter State = StateType.GameProvisioned; } - function StartPingPong(int pingPongTimes) public + function StartPingPong(int pingPongTimes) public { PingPongTimes = pingPongTimes; - Player player = Player(GamePlayer); State = StateType.Pingponging; - player.Ping(pingPongTimes); + GamePlayer.Ping(pingPongTimes); } - function Pong(int currentPingPongTimes) public + function Pong(int currentPingPongTimes) public { - currentPingPongTimes = currentPingPongTimes - 1; + int remainingPingPongTimes = currentPingPongTimes - 1; - Player player = Player(GamePlayer); - if(currentPingPongTimes > 0) + if(remainingPingPongTimes > 0) { State = StateType.Pingponging; - player.Ping(currentPingPongTimes); + GamePlayer.Ping(remainingPingPongTimes); } else { State = StateType.GameFinished; - player.FinishGame(); + GamePlayer.FinishGame(); } } @@ -62,22 +60,22 @@ contract Player address public GameStarter; string public PingPongGameName; - constructor (string pingPongGameName) public { + constructor (string memory pingPongGameName) public { GameStarter = msg.sender; PingPongGameName = pingPongGameName; State = StateType.PingpongPlayerCreated; } - function Ping(int currentPingPongTimes) public + function Ping(int currentPingPongTimes) public { - currentPingPongTimes = currentPingPongTimes - 1; + int remainingPingPongTimes = currentPingPongTimes - 1; Starter starter = Starter(msg.sender); - if(currentPingPongTimes > 0) + if(remainingPingPongTimes > 0) { State = StateType.PingPonging; - starter.Pong(currentPingPongTimes); + starter.Pong(remainingPingPongTimes); } else { diff --git a/blockchain-workbench/application-and-smart-contract-samples/ping-pong-game/media/readme.md b/blockchain-workbench/application-and-smart-contract-samples/ping-pong-game/media/readme.md deleted file mode 100644 index 8b1378917..000000000 --- a/blockchain-workbench/application-and-smart-contract-samples/ping-pong-game/media/readme.md +++ /dev/null @@ -1 +0,0 @@ -