From 694d1afe1e6050d01b54f6c27e915e33a8630c99 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Tue, 9 Aug 2016 14:06:13 -0300 Subject: [PATCH] killable and ownable --- contracts/Killable.sol | 9 +++++++++ contracts/Ownable.sol | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 contracts/Killable.sol create mode 100644 contracts/Ownable.sol diff --git a/contracts/Killable.sol b/contracts/Killable.sol new file mode 100644 index 000000000..bf5598fff --- /dev/null +++ b/contracts/Killable.sol @@ -0,0 +1,9 @@ +/* + * Killable + * Base contract that can be killed by owner + */ +contract Killable is Ownable { + function kill() { + if (msg.sender == owner) suicide(owner); + } +} diff --git a/contracts/Ownable.sol b/contracts/Ownable.sol new file mode 100644 index 000000000..a4a5cfd89 --- /dev/null +++ b/contracts/Ownable.sol @@ -0,0 +1,16 @@ +/* + * Ownable + * Base contract with an owner + */ +contract Ownable { + address owner; + + function Ownable() { + owner = msg.sender; + } + + modifier onlyOwner() { + if (msg.sender == owner) + _ + } +}