I'm newbie about smart contract so maybe my question might sound simple for experts.
I'm working for integrating the OZ Upgrade plugin into my contract used for study purposes
Following the documentation I was able to integrate it.
There is only one impediment and I cannot find an answer online.
My pre-upgraded contract (old contract) was able to receive eth balance during the deployment process. (payable ctor)
Using upgraded contract I'm not able to pass the information automatically as I did before.
Any suggestions ?
Code to reproduce
Old Contract
....omissis...
const myContractFactory = await hre.ethers.getContractFactory("MyContract");
const myContract= await myContractFactory .deploy({
//after deploy my contract balance is 0.001 eth
value: hre.ethers.utils.parseEther("0.001"),
});
...omissis...
Upgraded Contract using OZ Proxy
....omissis...
let balance = hre.ethers.utils.parseEther("0.0001");
const myContractFactory = await hre.ethers.getContractFactory("MyContract");
const myContract = await upgrades.deployProxy(myContractFactory,
{
//it doesn't work
value: balance,
initializer: "setup"
});
...omissis...
I tried passing information in many other ways without finding a working solution
Environment
Hardhat local