I’ve been using Ownable contract in my project, which is a relatively old version.
The Ownable has the initialize function that can set up the ownership only once. It is useful to call the initializer instead of constructor especially when I use an upgradable proxy contract. The proxy contract can recognize the ownership of the implementation by calling the initializer when linking the implementation address with its proxy. If the address of the owner is set by calling its constructor, the proxy contract cannot find the owner address after linking.
However, in the latest implementation which is 0.6.x, I found many of the contracts on libraries use a constructor instead of an initialize function. Is it recommended that we should use constructor? How can we avoid the problem that proxies cannot see the ownership value, which is saved on the implementation’s storage?