pragma solidity ^0.4.2; 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) suicide(owner); } } contract greeter is mortal { /* define variable greeting of the type string */ string greeting = "test123"; event Approval(string _g); function setGreeting(string _greeting) public { greeting = _greeting; } /* main function */ function greet() public constant returns (string) { return greeting; } function fire() public { emit Approval(greeting); } }