Commit 84be318c by Francisco Giordano Committed by GitHub

Merge pull request #424 from eugene-babichenko/transfer-ownership-event

Add OwnershipTransferred event to Ownable contract and its derivatives
parents fdc8fbaa 5035718e
...@@ -32,6 +32,7 @@ contract Claimable is Ownable { ...@@ -32,6 +32,7 @@ contract Claimable is Ownable {
* @dev Allows the pendingOwner address to finalize the transfer. * @dev Allows the pendingOwner address to finalize the transfer.
*/ */
function claimOwnership() onlyPendingOwner { function claimOwnership() onlyPendingOwner {
OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner; owner = pendingOwner;
pendingOwner = 0x0; pendingOwner = 0x0;
} }
......
...@@ -33,6 +33,7 @@ contract DelayedClaimable is Claimable { ...@@ -33,6 +33,7 @@ contract DelayedClaimable is Claimable {
*/ */
function claimOwnership() onlyPendingOwner { function claimOwnership() onlyPendingOwner {
require((block.number <= end) && (block.number >= start)); require((block.number <= end) && (block.number >= start));
OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner; owner = pendingOwner;
pendingOwner = 0x0; pendingOwner = 0x0;
end = 0; end = 0;
......
...@@ -10,6 +10,9 @@ contract Ownable { ...@@ -10,6 +10,9 @@ contract Ownable {
address public owner; address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/** /**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender * @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account. * account.
...@@ -34,6 +37,7 @@ contract Ownable { ...@@ -34,6 +37,7 @@ contract Ownable {
*/ */
function transferOwnership(address newOwner) onlyOwner { function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0)); require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner; owner = newOwner;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment