Created
August 14, 2021 18:26
-
-
Save Davidegloh/795ed5b21148993a2fa52a2587c4a33d to your computer and use it in GitHub Desktop.
[ControlFlow-Solidity]#controlFlow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Control Flow (if, else) | |
pragma solidity 0.7.5; | |
contract HelloWorld { | |
// state variables | |
string message ; // message will have the value of _message | |
constructor(string memory _message){ | |
message = _message; | |
} | |
function hello() public view returns(string memory){ | |
if (msg.sender == 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4){ | |
return message; | |
} else { | |
return "wrong address"; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment