-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Description
🧐 Motivation
Ownable2StepUpgradeable inherits OwnableUpgradeable.
Ownable2StepUpgradeable has initializer __Ownable2Step_init()
OwnableUpgradeable has initializer __Ownable_init(address initialOwner)
Currently contracts that inherit Ownable2StepUpgradeable need to call __Ownable_init(address initialOwner) to set the initial owner. This is not obvious because users who are just inheriting Ownable2StepUpgradeable directly may not know about this transitive requirement.
This differs from the non-upgradeable scenario which was discussed in #4368 (comment), because contracts that extend the non-upgradeable Ownable2Step would fail compilation if they did not call the Ownable constructor.
Next steps
Consider whether the initializer of Ownable2StepUpgradeable should also initialize the owner. This would occur if Ownable2Step calls its parent constructor, however there are some drawbacks to multiple inheritance mentioned in comment #4368 (comment)