Browse Source

killable and ownable

Manuel Araoz 9 years ago
parent
commit
694d1afe1e
2 changed files with 25 additions and 0 deletions
  1. 9 0
      contracts/Killable.sol
  2. 16 0
      contracts/Ownable.sol

+ 9 - 0
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);
+  }
+}

+ 16 - 0
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)
+			_
+	}
+}