With OpenZeppelin's upgradeable
deployProxy for deploying of proxy contracts, are calls to the
initialize() function called as a separately transactions (ie, contract creation and calling
initialize are 2 separate transactions) or called internally within a single transaction (ie, both contract creation and
initialize are called together in a single transaction, like something could be done by having both actions in a
create function of a factory contract)?
If it the contract creation and
initialize function were done as 2 separate transactions, wouldn't the calling of
initialize() risk getting front-run? Sure, it probably isn't a big deal since the contract is brand new and the front runner isn't going to get much from it, but it means we wasted deploying that proxy contract too.
If the contract creation and
initialize function were done together within one single transaction, how is this done in
deployProxy() without going through a factory contract to create the contract and call
initialize all in a single transaction?