Skip to content
Merged
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
fixed wrong call order in Ownable.transferOwnership
  • Loading branch information
eugene-babichenko committed Sep 7, 2017
commit 5035718e4bf5e052c17e97548e0c49ccc0e5c8ef
2 changes: 1 addition & 1 deletion contracts/ownership/Ownable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ 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.

owner = newOwner;
}

}