Clones.sol to create new clones of a reference project, what is the most gas-efficient way to initialise the new contract?
I see that the deprecated
deployMinimal method from
ProxyFactory.sol used to allow a caller to pass
_data into the method, which seemed to then create the "clone" in what appears to be a very gas efficient way.
I am now using the
clone method from
Clones.sol, which leaves me apparently with only the following sort of option:
address newOxCartAddress = Clones.clone(referenceOxCartAddress); // Create clone IOxCart oxCart = IOxCart(newOxCartAddress); // Load the cloned contract oxCart.initialize(address(this)); // Call the initialize function on clone
I can't help but feel as if this isn't ideal from a gas-consumption perspective, is there a better approach?