From 4a46154516378180796917c062ccc780404ddcc3 Mon Sep 17 00:00:00 2001 From: Benjamin Bollen Date: Sat, 4 Nov 2017 17:02:22 +0530 Subject: [PATCH] contracts: make Owner transfership explicitly not ownerless [ch120] --- contracts/Owned.sol | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/contracts/Owned.sol b/contracts/Owned.sol index 6696c6e..e7ff510 100644 --- a/contracts/Owned.sol +++ b/contracts/Owned.sol @@ -39,6 +39,8 @@ contract Owned { function initiateOwnershipTransfer(address _proposedOwner) public onlyOwner returns (bool) { + require(_proposedOwner != address(0)); + proposedOwner = _proposedOwner; OwnershipTransferInitiated(_proposedOwner); @@ -57,6 +59,14 @@ contract Owned { return true; } + + + function cancelOwnershipTransfer() public onlyOwner returns (bool) { + if (proposedOwner == address(0)) return false; + + proposedOwner = address(0); + return true; + } }