I'm having a hard time getting a contract verified on Etherscan.

I deployed the contract using Ethereum Wallet, I can effectively find it on Etherscan but when I copy-paste the exact same code to the verification, I get the error:

Sorry! The Compiled Contract ByteCode does NOT match with the Contract Creation Code for ...

Am I missing the point or something? How to correctly get a contract verified on etherscan?

2 Answers 2


Depending on your Ethereum Wallet version, the compiler version is different as well. For the latest ones, you should select this version on Etherscan : v0.2.1-2016-01-30


Since the answer to this post is old. I figured I'd give an updated, programmatic way to verify contracts on Etherscan using Truffle and Brownie.

For both Truffle and Brownie, you will need to make an account on Etherscan and obtain an API token. It's important that you add it as an enviroment varbiable in a .env file.

Using Brownie:
Your enviroment variable should look like:

export ETHERSCAN_TOKEN=0000000000000000000000000000000000

In your contract deployment script, add a verify source parameter and set it to true. It should look something like below.

def deploy_token():
    account = get_account() 
    token_contract = ERC20Token.deploy(
        {"from": account},

When you run your deployment script, your contract will be automatically verified, and you will see a verification message in your console.

Using Truffle:
You will need to download the dependency npm install truffle-plugin-verify. Then, add this to your truffle-config.js:

plugins: [

api_keys: {
  etherscan: process.env.ETHERSCAN_API_KEY

Note: This assumes you have already obtained your Etherscan token and added it to your .env file as an environment variable.

Once your contract is deployed to a network, run the command:
truffle run verify yourContract --network nameOfNetwork

Also, if anyone knows an easy way to verify contracts using Hardhat, please add an answer below. It would be nice to have all this info in one place.

I'm still learning this stuff too, so if someone has a more efficient way of verifying contracts, please let me know.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.