Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OwnershipTransferred event to Ownable contract and its derivatives #424

Merged

Conversation

eugene-babichenko
Copy link
Contributor

Me and my team consider this feature very useful at least for debugging purposes, but we also believe it will give more transparency for library users. OwnershipTransferred event is being fired each time an ownership transfer really takes place (i.e. in Ownable.transferOwnership, Claimable.claimOwnership and DelayedClaimable. Claimable.claimOwnership).

@frangio
Copy link
Contributor

frangio commented Sep 5, 2017

Great contribution @eugene-babichenko! Definitely agree on the transparency aspect.

I'm wondering if the event should also log the previous owner. Technically the information would be available in the previously emitted events, but I think it would be good if each event was self-contained.

@eugene-babichenko
Copy link
Contributor Author

@frangio added this field to the event, check it out, please.

@@ -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.

@eugene-babichenko
Copy link
Contributor Author

Fixed that

@frangio
Copy link
Contributor

frangio commented Sep 7, 2017

Thanks!

@frangio frangio merged commit 84be318 into OpenZeppelin:master Sep 7, 2017
ProphetDaniel pushed a commit to classicdelta/Smart-Contracts that referenced this pull request Mar 9, 2018
…wnership-event

Add OwnershipTransferred event to Ownable contract and its derivatives
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants