After Aave upgradeability exploit I’ve been using a constructor in implementation contract to initialize it while it’s being deployed (in one transaction). The reasoning behind that was: the proxy will never call a constructor anyway, so leaving it I considered safe, but the logic itself will be initialized, so no such things as Aave had can happen to it.
Recently I was trying to automate my deployments with OZ-Upgrade plugins.
But it doesn’t like my constructor, saying this:
Error: Contract is not upgrade safe: Contract has a constructor
My constructor looks like this:
constructor() {
initialize(address(1), address(1), "1", "1");
}
Is it really not safe? If yes - why?
Also I haven’t noticed any mentions about having to pre-initialize logic contracts in the docs - but leaving them unitialized with anyone could call initialize is a potential security issue. Or I’m missing something?