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 event Initialized() to Initializable #3195

Closed
wants to merge 2 commits into from

Conversation

kevupton
Copy link
Contributor

@kevupton kevupton commented Feb 16, 2022

Copied over from OpenZeppelin/openzeppelin-contracts-upgradeable#148


Added an event for an initializable contract. To allow for easy identification of when a contract has been initialized.

Suggestion for tracking when a contract has been initialized.

This is helpful in cases like when using TheGraph when we want to do some action on initialize. Such as reading the data and saving it. As some of the data may not be available on construct for example.

Could potentially use event Initialized(address sender); with the sender as well. However, thought it might be better to just keep it simple.

Not sure if there are any negative side effects of this.

PR Checklist

  • Tests
  • Documentation
  • Changelog entry

@Amxx Amxx requested a review from frangio February 17, 2022 11:15
@frangio
Copy link
Contributor

frangio commented Feb 17, 2022

Thanks for the suggestion @kevupton. This may make sense, I'm just not fully convinced yet.

This is helpful in cases like when using TheGraph when we want to do some action on initialize. Such as reading the data and saving it. As some of the data may not be available on construct for example.

Generally the initializer is called during construction of the proxy, or at least in the same transaction, so I'm not fully convinced by this motivation. @Amxx What are your thoughts on this?

One concern that I have is how this will interact with #2901: we will likely have a reinitializer(n) modifier, so we may want this event to reflect that with an extra uint argument.

@Amxx
Copy link
Collaborator

Amxx commented Mar 25, 2022

Bumping up this now that we have the reinitializer mechanism.

@Amxx
Copy link
Collaborator

Amxx commented Mar 30, 2022

Implemented in #3294

@Amxx Amxx closed this Mar 30, 2022
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.

3 participants