Skip to content

Instantly share code, notes, and snippets.

@juntao
Created March 24, 2019 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juntao/cc1565b76949a6bbd8bfb15aa9e53dc8 to your computer and use it in GitHub Desktop.
Save juntao/cc1565b76949a6bbd8bfb15aa9e53dc8 to your computer and use it in GitHub Desktop.
pragma lity ^1.2.4;
contract Human {
address public owner;
modifier onlyOwner() {
assert(msg.sender == owner);
_;
}
constructor () public {
owner = msg.sender;
}
function greet() pure public returns (string) {
return "Hello world";
}
function terminate() external onlyOwner {
selfdestruct(owner);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment