Skip to content

Instantly share code, notes, and snippets.

@AyDeveloper
Created August 9, 2022 21:06
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 AyDeveloper/95da033626d379451ccb6f99842d23ac to your computer and use it in GitHub Desktop.
Save AyDeveloper/95da033626d379451ccb6f99842d23ac to your computer and use it in GitHub Desktop.
contract Owner {
address owner;
function setOwner() public {
owner = msg.sender;
}
}
contract Suicide is Owner {
function destroy() public {
if (msg.sender == owner) selfdestruct(payable(owner));
}
}
contract EndGame is Suicide {
function kill() public {
super.destroy(); // Calls kill() of mortal.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment