From 24029e83eade1e78db7df6ff857f81b7297b71b1 Mon Sep 17 00:00:00 2001 From: Don Johnson Date: Tue, 16 Jun 2020 17:45:13 -0500 Subject: [PATCH] 0.5.0 updates for VAR and Return Value Selection --- tutorial-20/Assignments.sol | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tutorial-20/Assignments.sol b/tutorial-20/Assignments.sol index 5dfd9a8..7a31f83 100644 --- a/tutorial-20/Assignments.sol +++ b/tutorial-20/Assignments.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.0; +pragma solidity ^0.5.0; contract Assignments { function returnFirstValue(uint a, uint b) returns (uint) { @@ -9,15 +9,15 @@ contract Assignments { return returnFirstValue({b:4, a:8}); } - function returnAllValues(uint a, uint b, uint c) returns (uint, uint, uint) { + function returnAllValues(uint a, uint b, uint c) public returns (uint, uint, uint) { return (a,b,c); } function callerAll() public returns (uint, uint, uint) { - var(x,y,z) = returnAllValues(4,5,6); + (uint x, uint y, uint z) = returnAllValues(4,5,6); (x,y) = (y,x); - (x,) = returnAllValues(5,10,15); - (,z) = returnAllValues(10,20,30); + (x,,) = returnAllValues(5,10,15); + (,,z) = returnAllValues(10,20,30); return (x,y,z); } -} \ No newline at end of file +}