I’ am compiling the contract with Hardhat and solidity version 0.8.0
I am deploying the contract with ethers under a hardhat task.
When i try to verify that contract. I get this error.
Error in plugin @nomiclabs/hardhat-etherscan: The bytecode retrieved could not have been generated by any of the selected compilers.
The expected version is 0.6.12.
The selected compiler version is: 0.8.0
Possible causes are:
- Wrong compiler version selected in hardhat config.
- The given address is wrong.
- The selected network (rinkeby) is wrong.
I’m not sure where it is getting this 0.6.12 from.
My complete code can be found here
npx hardhat compile
npx hardhat deploy
npx hardhat verify --network rinkeby 0x30F7220cA0b1072ef55144E355Ff7c2d9ff624B4 “argument 1 address”
The argument 1 is the address passed in the initializer.
It’s pretty much based on defender example.
To test it you will need an .env file with the folowing
MNEMONIC = a mnemonic
INFURA_ID = infura ID
ETHERSCAN = Etherscan API Key