Add OwnershipTransferred event to Ownable contract and its derivatives#424
Merged
frangio merged 4 commits intoSep 7, 2017
Merged
Conversation
… instance actually changed
Contributor
|
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. |
Contributor
Author
|
@frangio added this field to the event, check it out, please. |
frangio
reviewed
Sep 6, 2017
| function transferOwnership(address newOwner) onlyOwner { | ||
| require(newOwner != address(0)); | ||
| owner = newOwner; | ||
| OwnershipTransferred(owner, newOwner); |
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
|
Fixed that |
Contributor
|
Thanks! |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
OwnershipTransferredevent is being fired each time an ownership transfer really takes place (i.e. inOwnable.transferOwnership,Claimable.claimOwnershipandDelayedClaimable. Claimable.claimOwnership).