Getting the same error as @Skyge and @abcoathup from this thread
Did not fully understand by reading his comments how he solved it.
(already using contracts-upgradeable": "^4.1.0, so that should not be it I think):
Error in plugin @nomiclabs/hardhat-etherscan: The address provided as argument contains a contract, but its bytecode doesn't match any of your local contracts.
Possible causes are:
- Contract code changed after the deployment was executed. This includes code for seemingly unrelated contracts.
- A solidity file was added, moved, deleted or renamed after the deployment was executed. This includes files for seemingly unrelated contracts.
- Solidity compiler settings were modified after the deployment was executed (like the optimizer, target EVM, etc.).
- The given address is wrong.
- The selected network (bsctestnet) is wrong.
Environment
"@ethereum-waffle/provider": "^3.3.2",
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-etherscan": "^2.1.3",
"@nomiclabs/hardhat-ganache": "^2.0.0",
"@nomiclabs/hardhat-web3": "^2.0.0",
"@openzeppelin/contracts-upgradeable": "^4.1.0",
"@openzeppelin/hardhat-upgrades": "^1.8.2",
"@openzeppelin/test-helpers": "^0.5.11",
"chai": "^4.3.4",
"eth-sig-util": "^3.0.1",
"hardhat": "^2.3.3",
"hardhat-ganache": "^1.0.1",
"mocha": "^9.0.0"
},
"devDependencies": {
"hardhat-abi-exporter": "^2.2.1"
}