1

I'm able to deploy this same contract to the Mumbai testnet and verify it and everything works fine. So I know that my script is working correctly.

However each time I try to deploy to Polygon mainnet, which is just another network configured in my hardhat.config, all I get is the same success console.log message with an address, but on polygonscan it is just an empty EOA address with no bytecode, and no actual transaction went out of the deployer address.

And I was able to properly deploy other contracts (that are not proxies) to the Polygon mainnet without any problems.

Question:

So it seems that it is deployed somewhere else than I expect, but why it happens? Where is it get deployed and how to fix this?

Already tried:

  1. Couple of different mainnet links, including the public one, and private one from Alchemy

Here is my hardhat config:

require("@nomicfoundation/hardhat-toolbox");
require("@nomicfoundation/hardhat-verify");
require('@openzeppelin/hardhat-upgrades');
require("dotenv").config({ path: ".env" });


/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
  solidity: {
    version: "0.8.24",
    settings: {
      optimizer: {
        enabled: true,
        runs: 200,
      },
      viaIR: true,
    },
  },
  networks: {
    mumbai: {
      url: process.env.MUMBAI_RPC,
      accounts: [process.env.PRIVATE_KEY_TEST],
    },
    polygon: {
      url: process.env.POLYGON_RPC,
      accounts: [process.env.PRIVATE_KEY_PROD],
    }
  },
  etherscan: {
    apiKey: process.env.ETHERSCAN_API_KEY
  },
  sourcify: {
    enabled: true
  },
};

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.