-
Notifications
You must be signed in to change notification settings - Fork 16
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
Use _disableInitializers() instead of constructor() intializer #127
Comments
Just to know if I understood:
Is that correct? I'm thinking we could ditch
|
Yes that's correct!
If you mean the "initialized version", 4.8 adds a function I don't think we should ditch |
|
I still see them as slightly separate concepts but I'm open to the suggestion. I think we should move to |
Separate because semver carries more meaning (patch, minor, major)? I think it may be easier to use semver for the whole package, and +1 to |
The difference I see is that the initialized version tracks the version of the contract "state" whereas |
OpenZeppelin Contracts 4.7 introduced reinitializers and with it
_disableInitializers()
which is now prefered instead of the patternconstructor() initializer
. Forta is using the latter, for example here:forta-contracts/contracts/components/staking/FortaStaking.sol
Line 122 in c21e283
There is no issue with keeping this as is, as long as we don't use reinitializers. Since they are a useful feature and we will likely use them in the future, we should try to switch to
_disableInitializers
ahead of time to avoid future issues.The text was updated successfully, but these errors were encountered: