For OwnableUpgradeable is it mandatory to call __Ownable_init ? If I'm the deployer do I still need to initialize with __Ownable_init? Or can I completely ignore it?
Code to reproduce
contract contractA is
OwnableUpgradeable,
PausableUpgradeable
{
__Pausable_init();
__Ownable_init(msg.sender); // Is this a must?
}
Yes, you should call __Ownable_init from your initializer function, and ensure your initializer function is called when deploying the proxy. Otherwise, the owner won't be set.
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
So why need to call the __Ownable_init function? Since you the deployer will be the owner of the deployed contract?
What happens if you did not call __Ownable_init function? Can I input _transferOwnership(_factory); in the initializer function and call it to transfer ownership??