Hello! I noticed that people very often declare visibility of initialize function as public. And in examples of your documentation I found it too. Could you explain me whether it is really important and why? It seems that it also can be external.
Hi, welcome to the community!
Good question, cause when you use the proxy pattern, you need to initialize state manually rather than by
constructor() in the proxy contract, so you should use
public, and in the implementation contract, sometimes, you also need to call
initialize in another function, so in order to have better compatibility, it will use
And for more details about the proxy pattern, maybe you can have a look at the documentation: Writing Upgradeable Contracts - OpenZeppelin Docs