From 17cd3d52fab220062d7c2ef6de027e941eceb4d7 Mon Sep 17 00:00:00 2001 From: James Lockhart Date: Thu, 24 Oct 2019 19:28:03 +0100 Subject: [PATCH] Fixed tutorial 14 to work with the latest version of solidity --- tutorial-14/EtherTransfer.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorial-14/EtherTransfer.sol b/tutorial-14/EtherTransfer.sol index a61a92a..1d50789 100644 --- a/tutorial-14/EtherTransfer.sol +++ b/tutorial-14/EtherTransfer.sol @@ -1,7 +1,7 @@ -pragma solidity ^0.4.0; +pragma solidity ^0.5.0; contract EtherTransferTo { - function () public payable { + function () external payable { } function getBalance() public returns (uint) { @@ -13,7 +13,7 @@ contract EtherTransferFrom { EtherTransferTo private _instance; - function EtherTransferFrom() public { + constructor() public { // _instance = EtherTransferTo(address(this)); _instance = new EtherTransferTo(); } @@ -27,7 +27,7 @@ contract EtherTransferFrom { return _instance.getBalance(); } - function () public payable { + function () external payable { //msg.sender.send(msg.value); address(_instance).send(msg.value); }