Struggling with verification using @nomicfoundation hardhat-verify.. getting some strange error

Error in plugin @nomicfoundationhttps/hardhat-verify: The address provided as argument contains a contract, but its bytecode doesn't match any of your local contracts.

Possible causes are:

  • The artifact for that contract is outdated or missing. You can try compiling the project again with the --force flag before re-running the verification.

  • The contract's code changed after the deployment was executed. Sometimes this happens by changes in seemingly unrelated contracts.

  • The solidity compiler settings were modified after the deployment was executed (like the optimizer, target EVM, etc.)

  • The given address is wrong.

  • The selected network (mainnet) is wrong.

I don't understand how the bytecode wouldn't match up. I didn't change any code in my main .sol contract, but I did change code in the hardhat.config.js to accomodate the new plugin..

I tried to verify via flatten but got errors on

Any clues?

My hardhat.config.js:


/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.19",
networks: {
mainnet: {
url: "",
accounts: [process.env.PRIVATE_KEY]
etherscan: {

apiKey: "myAPIkey"