Thanks a lot for the Box.sol
example above!
this shows what’s required to move to upgradeable contracts with the OpenZeppelin themself:
- change imports (point to
@openzeppelin/contracts-ethereum-package
) for all contract imports - derive
Box
from bothInitializable
andownableUpgradeSafe
(in that order) - I guess this is to make bothBox
andOwnable
upgradeable - call base class
initialize
implementation functions - for which I have to look at the source (implementation) of the respective OpenZeppelin contract inherited (OwnableUpgradeSafe
in this case)
FWIW, I spent quite some time with the docs: I could find 1. there, but the infos 2. and 3. I didn’t find (only here in your answer).
With 3.: as a app developer using OZ contracts, am I supposed to read the implementation to figure out the right functions to call in the base class (inside initialize
). Eg in my case, with AccessControlUpgradeSafe
, I am supposed to call __Context_init_unchained
and __AccessControl_init_unchained
… I guess)
IOW: please add this information to the docs.