- Yes, but to prevent frontrunning, the initialize function should be called in the same transaction as the proxy deployment. This occurs by default when you use
deployProxyfrom the Hardhat Upgrades plugin. _disableInitializers()is recommended. See What does `_disableInitializers();` function mean? for reasoning.