I often have this error while deploying an upgradeable contract via Infura:
Invalid deployment with address 0x... and 0x...
The tx is actually sent and mined correctly but when the
waitAndValidateDeployment function of the
@openzeppelin/upgrades-core package checks the tx with
getTransactionByHash, the provider returns
If I put an
await sleep(5000) before that, I don’t have problems, so I guess the infura node I’m hitting doesn’t know about that tx yet.
I guess in that
while loop we could retry
N times even in this case, but I’m asking because I’m not sure it would be the right place to do it.
Does this happen to someone else?
Code to reproduce
const myContract = await ethers.getContractFactory("MyContract", signer); const proxy = await upgrades.deployProxy(myContract, [args]); await proxy.deployed();