-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Allow the re-initialization of contracts #3232
Conversation
This is a sensitive piece of code. It needs comments explaining in depth what behavior it implements and why. We also need to develop and document the alternative to |
Should we add a |
|
How should this function behave? Should it check that the contract is not yet initialized? Should it be allowed to run within the scope of an initializer? Here are possible implementation
|
I think we want the second option: function _preventInitialize() internal virtual {
if (_setInitializeStep(type(uint8).max)) {
_initializing = false;
}
} The behavior that results is that after this function is called no more |
not, it will be incorrect to write
|
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thank you!
We use RC as it has a funcionality of `reinitializer` which supports upgrades of the contracts from OpenZeppelin/openzeppelin-contracts#3232 We need to revisit this before mainnet deployment and switch to a final package release if available.
Fixes #2901
PR Checklist