Error Deploying Upgradable Contract: deployment failed with error: The contract code couldn’t be stored, please check your gas limit

I deployed an Upgradeable proxy on Rinkeby and it all worked great.

Then when I deployed to mainnet, it ended up costing me $133, the transaction on Etherscan says it was “successful” but I get this error in the openzeppelin-cli:

“… deployment failed with error: The contract code couldn’t be stored, please check your gas limit”

So now, I don’t know if the contract is deployed and I certainly don’t want to try again at that price!

How do I recover what’s been deployed so far?

1 Like

Hi @mdcoon,

Welcome to the community forum.

I am sorry that you had this issue. Network congestion is unfortunately a problem.

[Update]
When we deploy an upgradeable contract three transactions need to occur:

  1. Deploy the implementation contract
  2. Deploy a ProxyAdmin
  3. Deploy the proxy and point to the implementation and run any function to initialize state.

When we upgrade a contract two transactions need to occur:

  1. Deploy the implementation contract
  2. Update the proxy to point to the new implementation contract and run any function to initialize the upgraded state.

Are you able to share the contract addresses on Etherscan so that I can take a look to see what state your upgrade deploy is in?

Thanks. I think the first step completed but the upgradeable proxy part failed. So I manually deployed an UpgradeableProxy instance with the appropriate constructor args and it’s working.

The proxy address is: 0xf383B4799D91B7A68B0F26ea44031A9733952578

It would be nice to get this setup in my OZ configuration so that I can interact and upgrade in the future. Which we already have a need to do. How do I set the appropriate hashes in the mainnet.json config file for the impl/proxy contracts?

1 Like

Also, the etherscan verification process never worked for Rinkeby. It just fails without a descriptive reason. It would be good to figure out why it fails. Any way to debug that?

1 Like

Hi @mdcoon,

Apologies, I misread your question and thought you were doing an upgrade.

So if I understand correctly you have:

Did you deploy a ProxyAdmin as well? Otherwise I assume that the admin is the deployer of the contract.
What Proxy Contract did you deploy?

Do you have a GitHub repository that you can share?

As for verification, if you can share a repository I can help verify the proxy and the implementation contract.

Hi @mdcoon,

Just following up to see if I can help?