Skip to content

Commit

Permalink
Merge pull request #424 from eugene-babichenko/transfer-ownership-event
Browse files Browse the repository at this point in the history
Add OwnershipTransferred event to Ownable contract and its derivatives
  • Loading branch information
frangio authored Sep 7, 2017
2 parents fdc8fba + 5035718 commit 84be318
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions contracts/ownership/Claimable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ contract Claimable is Ownable {
* @dev Allows the pendingOwner address to finalize the transfer.
*/
function claimOwnership() onlyPendingOwner {
OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = 0x0;
}
Expand Down
1 change: 1 addition & 0 deletions contracts/ownership/DelayedClaimable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ contract DelayedClaimable is Claimable {
*/
function claimOwnership() onlyPendingOwner {
require((block.number <= end) && (block.number >= start));
OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = 0x0;
end = 0;
Expand Down
4 changes: 4 additions & 0 deletions contracts/ownership/Ownable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ contract Ownable {
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
* account.
Expand All @@ -34,6 +37,7 @@ contract Ownable {
*/
function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}

Expand Down

0 comments on commit 84be318

Please # to comment.