Skip to content

Instantly share code, notes, and snippets.

@recmo
Created April 5, 2017 11:38
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 recmo/19adb8be8f6f3f999ed2c3cdc094232c to your computer and use it in GitHub Desktop.
Save recmo/19adb8be8f6f3f999ed2c3cdc094232c to your computer and use it in GitHub Desktop.
contract Owned {
address public owner;
function Owned() {
owner = msg.sender;
}
modifier onlyOwner() {
if (msg.sender != owner) {
throw;
}
_;
}
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function terminate() public onlyOwner {
selfdestruct(owner);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment