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

**URL:** <https://forum.openzeppelin.com/t/struggling-with-verification-using-nomicfoundation-hardhat-verify-getting-some-strange-error/37448>\
**Category:** Smart Contracts\
**Tags:** etherscan-verify\
**Created:** [August 12, 2023, 4:42pm UTC](https://forum.openzeppelin.com/t/struggling-with-verification-using-nomicfoundation-hardhat-verify-getting-some-strange-error/37448 "2023-08-12T16:42:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![soulstamp](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@soulstamp](https://forum.openzeppelin.com/u/soulstamp)\
**Post date:** [August 12, 2023, 4:42pm UTC](https://forum.openzeppelin.com/t/struggling-with-verification-using-nomicfoundation-hardhat-verify-getting-some-strange-error/37448/1 "2023-08-12T16:42:24Z")

</div>

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 [etherscan.io](https://etherscan.io/).

Any clues?

---

<div class="post-metadata">

**Author:** ![soulstamp](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@soulstamp](https://forum.openzeppelin.com/u/soulstamp)\
**Post date:** [August 12, 2023, 4:43pm UTC](https://forum.openzeppelin.com/t/struggling-with-verification-using-nomicfoundation-hardhat-verify-getting-some-strange-error/37448/2 "2023-08-12T16:43:30Z")

</div>

My hardhat.config.js:

require("dotenv").config();  
require("@nomicfoundation/hardhat-verify");

/\*\* @type import('hardhat/config').HardhatUserConfig \*/  
module.exports = {  
solidity: "0.8.19",  
networks: {  
mainnet: {  
url: "[https://mainnet.infura.io/v3/(key)](https://mainnet.infura.io/v3/(key))",  
accounts: [process.env.PRIVATE\_KEY]  
}  
},  
etherscan: {

```
apiKey: "myAPIkey"

```

}  
}
