Using Upgrade Plugin unable to deploy the proxy contract

I am trying to use the Upgrades Plugin to deploy proxy contract. I tried deploying the contracts on goerli testnet but all the contracts are not getting deployed in one go. The admin and implementation contracts are deployed but not the proxy.

At first, I faced a timed-out issue:
Error: Timed out waiting for implementation contract deployment to address 0x8A5908020053119b0151bDE43c11a28eb4ed9a7c with transaction 0x5a596d04532ef308adb8d5603477740309ae85de82e56ba439c33603f51f7749

So, I changed the deployProxy time option to a 150 seconds, so that it doesn't get timed out.

After that, I got this: Error: Contract at 0xE76FeA9668b07DDB086c75F4Fc01030C63069A1B doesn't look like an ERC 1967 proxy with a logic contract address

I checked on the etherscan too, I didn't find any proxy contract deployed. Can somebody help me out with this.

:1234: Code to reproduce

here is the code

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
    const {deployments, getNamedAccounts, ethers, upgrades} = hre;
    const {deploy} = deployments;
    const {sequencer} = await getNamedAccounts();

    const Inbox = await ethers.getContractFactory("SequencerInbox");
    const inbox = await upgrades.deployProxy(Inbox, [sequencer], {initializer: 'initialize', from : sequencer, timeout: 0});
    
    console.log("inbox Proxy:", inbox.address);
    console.log("inbox Implementation Address" ,await upgrades.erc1967.getImplementationAddress(inbox.address));
    console.log("inbox Admin Address" ,await upgrades.erc1967.getAdminAddress(inbox.address))    
  
}

:computer: Environment

I am using Upgrades Plugin on Hardhat (v2.11.2)

Can you someone from openzeppelin team help me out? @frangio

Your proxy was deployed on goerli at https://goerli.etherscan.io/address/0xE76FeA9668b07DDB086c75F4Fc01030C63069A1B and I was able to call await upgrades.erc1967.getImplementationAddress('0xE76FeA9668b07DDB086c75F4Fc01030C63069A1B') on it.

Make sure that you are using the proper network e.g. --network goerli when you run the Hardhat script.

I am using the correct network while running the script. But, the problem is, the proxy contract doesn't get deployed with the admin and implementation contracts. It might get deployed later but not in one go.

In your script, wait for the proxy deployment to be confirmed before you make use of the proxy further.

e.g.

...
const inbox = await upgrades.deployProxy(Inbox, [sequencer], {initializer: 'initialize', from : sequencer, timeout: 0});

await inbox.deployed();

console.log("inbox Proxy:", inbox.address);
console.log("inbox Implementation Address" ,await upgrades.erc1967.getImplementationAddress(inbox.address));
console.log("inbox Admin Address" ,await upgrades.erc1967.getAdminAddress(inbox.address))    
...

Ohh yeah! Thanks @ericglau That was so lame :sweat_smile:

1 Like