When upgrading, get: "The contract code couldn't be stored, please check your gas limit"

Gas limit is defined in the network.js file

     mainnet: {
          provider: () => new HDWalletProvider(
            process.env.PRIVATE_KEY, 'https://mainnet.infura.io/v3/projectID'
          networkId: 1,

But I am receiving the error upon upgrading the contract.

1 Like

Hi @shakeib98,

I recommend testing the upgrade on a public testnet.
Assuming you did this, what was the gas used?

I also recommend looking at the testing concepts in this blog: