Hey everyone,
I often have this error while deploying an upgradeable contract via Infura:
Invalid deployment with address 0x... and 0x...
Environment
hardhat 2.0.6:
@nomiclabs/hardhat-ethers 2.0.1
@openzeppelin/contracts-upgradeable@ 3.3.0
@openzeppelin/hardhat-upgrades 1.4.3
Details
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 null
.
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();