8

guys. I have created simple contract, migrated to testnet via truffle. It can be founded here. But I can't verify it. I double check:
1. name of contract
2. version of compiler (ver. 0.4.11 in etherscan and in solc inside truffle)
3. optimization is enabled as in truffle they are enabled
4. we have no construtor arguments or imports

I try migrating several times with my friend. No success. Any suggestions or help?

  • What exactly do you mean by verifying it ? Being sure this is really the contract you deployed ? – Nikita Fuchs May 12 '17 at 12:01
  • 1
    @NikitaFuchs something like this: etherscan.io/… – Averin Maxim May 12 '17 at 20:53
  • Etherscan is for the main net, if you migrated your contract to a testnet, etherscan won't be able to find it. – Nikita Fuchs May 13 '17 at 13:06
3

I was able to successfully verify the contract code you linked in a new deployment.

Are you sure the parameters and source code you used were identical to those you used in the verification tool?

For reference, here is the verification of the new deployment of your contract.

EDIT:

It might be that you are having the same problem as I am having now. It seems like the remix and truffle compilations produce different bytecodes for some reason.

  • 1
    did you compile code in remix? Could you list parametrs, which you used during compiling and verification? – Averin Maxim May 14 '17 at 8:03
  • How do you deploy a contract that has multiple inheritances? – rstormsf Jul 1 '17 at 1:53
  • @AverinMaxim Months later and I think I am having the same problem you had. Edited my answer to reflect this. – Travis Jacobs Jul 5 '17 at 17:16
  • Also, to answer your question, I compiled your code in remix before. – Travis Jacobs Jul 5 '17 at 17:26
3

I've met same problem with contract verification at etherscan.io. https://etherscan.io/verifyContract2 - helped in my case.

Thank you

1

I created truffle-plugin-verify to automate Truffle contract verification on Etherscan.


  1. Install the plugin with npm
npm install truffle-plugin-verify
  1. Add the plugin to your truffle.js or truffle-config.js file
module.exports = {
  /* ... rest of truffle-config */

  plugins: [
    'truffle-plugin-verify'
  ]
}
  1. Generate an API Key on your Etherscan account (see the Etherscan website)
  2. Add your Etherscan API key to your truffle config
module.exports = {
  /* ... rest of truffle-config */

  api_keys: {
    etherscan: 'MY_API_KEY'
  }
}

After migrating your Deck contract to Rinkeby, you are able to verify it on Etherscan by running:

truffle run verify Deck --network rinkeby

More information can be found on the repository or in my article Automatically verify Truffle smart contracts on Etherscan.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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