github.com/annchain/OG@v0.0.9/vm/vm_test/contracts/0.sol (about)

     1  contract Mortal {
     2      /* Define variable owner of the type address */
     3      address owner;
     4  
     5      /* This function is executed at initialization and sets the owner of the contract */
     6      function Mortal() { owner = msg.sender; }
     7  
     8      /* Function to recover the funds on the contract */
     9      function kill() { if (msg.sender == owner) selfdestruct(owner); }
    10  }
    11  
    12  contract Greeter is Mortal {
    13      /* Define variable greeting of the type string */
    14      string greeting;
    15  
    16      /* This runs when the contract is executed */
    17      function Greeter(string _greeting) public {
    18          greeting = _greeting;
    19      }
    20  
    21      /* Main function */
    22      function greet() constant returns (string) {
    23          return greeting;
    24      }
    25  }