Created
July 15, 2017 07:46
-
-
Save robertlie/39436b3073ac5f90ed9d047ca547cd6c to your computer and use it in GitHub Desktop.
we3api
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
pragma solidity ^0.4.0; | |
contract mortal { | |
/* Define variable owner of the type address*/ | |
address owner; | |
/* this function is executed at initialization and sets the owner of the contract */ | |
function mortal() { owner = msg.sender; } | |
/* Function to recover the funds on the contract */ | |
function kill() { if (msg.sender == owner) selfdestruct(owner); } | |
} | |
contract greeter is mortal { | |
/* define variable greeting of the type string */ | |
string greeting; | |
/* this runs when the contract is executed */ | |
function greeter(string _greeting) public { | |
greeting = _greeting; | |
} | |
/* main function */ | |
function greet() constant returns (string) { | |
return greeting; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment