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
Update documentation to mention _disableInitializer() #574
Comments
Closed by #575 |
when adding the following to a upgradeable contract, it cannot be compiled by hardhat; Can you look into this? I got compilation error DeclarationError: Undeclared identifier. It seems compiler is not recognizing the function _disableInitializers().
|
@taochen2001 Which version of |
Just checked, it is "version": "4.5.2". Shall I upgrade to v4.6.0? By the way, in the current 4.5.2 version, even if I imported the ReentrancyGuardUpgradeable.sol in my contract, nonReentrant modifier won't be recognized by the compiler (using Hardhat); not sure if this is a bug or not. |
Now i upgraded to V4.6.0, but got the following error during compiling: contracts/Token.sol:12: Contract |
It is now working after adding: |
the solution provided by @taochen2001 is the only one? seems like a workaround.
|
Update https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract to mention that when using Contracts v4.6.0 or later, the constructor should call
_disableInitializers()
The text was updated successfully, but these errors were encountered: