Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix calls to OwnershipTransferred
  • Loading branch information
eugene-babichenko committed Sep 6, 2017
commit 7a36a6c92a3f958521d9da1db25f02b55b0122ef
2 changes: 1 addition & 1 deletion contracts/ownership/Claimable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ contract Claimable is Ownable {
* @dev Allows the pendingOwner address to finalize the transfer.
*/
function claimOwnership() onlyPendingOwner {
OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = 0x0;
OwnershipTransferred(owner);
}
}
2 changes: 1 addition & 1 deletion contracts/ownership/DelayedClaimable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ contract DelayedClaimable is Claimable {
*/
function claimOwnership() onlyPendingOwner {
require((block.number <= end) && (block.number >= start));
OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = 0x0;
end = 0;
OwnershipTransferred(owner);
}

}
2 changes: 1 addition & 1 deletion contracts/ownership/Ownable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ contract Ownable {
function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0));
owner = newOwner;
OwnershipTransferred(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.

}

}