Last active
October 27, 2020 11:39
-
-
Save wissalHaji/3f439098d3ce3c76d1cc4432b6da550e to your computer and use it in GitHub Desktop.
Example for the msg.sender property
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity ^0.7.0; | |
contract HelloWorldContract { | |
string greeting; | |
address owner; | |
constructor() { | |
greeting = "hello world"; | |
owner = msg.sender; | |
} | |
function sayHello() external view returns(string memory) { | |
if(msg.sender == owner) | |
return "hello Daddy"; | |
else | |
return greeting; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment