Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -35,6 +38,7 @@ contract Ownable {
function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0));
owner = newOwner;
OwnershipTransferred(owner, newOwner);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing to log the previous owner because it's updated in the previous line. The event should be emitted first, and then the state variable updated.

}

}