Skip to content

Instantly share code, notes, and snippets.

@0mkara
Created January 22, 2019 17:12
Show Gist options
  • Save 0mkara/7cb2d6fe20255fadbfbb542ac5176c73 to your computer and use it in GitHub Desktop.
Save 0mkara/7cb2d6fe20255fadbfbb542ac5176c73 to your computer and use it in GitHub Desktop.
Mortal library
pragma solidity ^0.5.0;
contract Mortal {
/* Define variable owner of the type address */
address payable owner;
/* This function is executed at initialization and sets the owner of the contract */
function mortal() public { owner = msg.sender; }
/* Function to recover the funds on the contract */
function kill() public { if (msg.sender == owner) selfdestruct(owner); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment