How to deploy a proxy contract with msg.value?

Here is my code:

const WavePortalV2 = await ethers.getContractFactory("WavePortalV2");
  const instance = await upgrades.deployProxy(WavePortalV2, []{value: hre.ethers.utils.parseEther("0.1")});

Just trying to see how to deploy a contract using Initializable function (no arguments) but it is payable... how do I override this in the above instance? Please let me know if I should add more info, thanks!

Basically, is there a way to override the deploy function?

Hi, welcome! :wave:

I think it is ok, but maybe you should add , that is:

await upgrades.deployProxy(WavePortalV2, [], {value: hre.ethers.utils.parseEther("0.1")});

Sorry, I am not sure what do you mean, I think if a function has a key word virtual, then you can override this function.

Adding the comma doesn't work :frowning:

And yeah sorry, what I meant with ability to override is in the typical way where you are able to set your own gasLimit and in my case, me wanting to set msg.value with the proxy deployment

Yeah, I had a test, it did not work, so maybe we can use another way, that is deploying contracts at first and then calling your initializable function with {value: hre.ethers.utils.parseEther("0.1")}), I think it must work.

And I need to look at the source code to find out how to pass msg.value when deploy a contract.