How to initialize value of minimal proxy contract(EIP1167 "constructor")?

The question is after deploying the clone contract (Openzeppelin clone

How should one initialize the values? If i understand correctly, Instead of constructor we must replace it with a function that initializes the value

Is there a way to create the contract & execute the function at the same time?

Or do i have to do it like this

address _clone = clone(contractToBeCloned);

Is there a better way?

I don't believe there is a better way, you clone the contract and then call your initialize(...) function
ContractToBeCloned(_cline).initialize(... your params ...);

(assuming you're also using @openzeppelin/contracts/proxy/utils/Initializable.sol )

The way the EIP 1167 clone deployment works prevents you from passing any other data.


Alternatively what people do is create an Factory Contract with a function to create the clone and then call their init function the same function call.