I notice that using clones to deploy is way cheaper than using "new" keyword. My use case is the following. I would like to deploy the following proxy:
ERC1967Proxy proxy = new ERC1967Proxy{
salt: uniqueName,
value: msg.value
}(
Template,
abi.encodeWithSelector(
Organizer(address(0)).initialize.selector,
Name,
myContractTemplate,
MarketPlaceV1,
MinterTemplate
)
);
Is it possible to achieve the previous by using Clones?
My guess is that I will need to deploy first the proxy to use its address as "implementation" parameter for the Clone()
function but my main concern is to pass value, args and methods within the deployment.
I can pass the salt with CloneDeterministic but Im dubious on the rest. Would love any guidance!