9

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?

3
  • What exactly do you mean by verifying it ? Being sure this is really the contract you deployed ?
    – n1cK
    May 12, 2017 at 12:01
  • 1
    @NikitaFuchs something like this: etherscan.io/… May 12, 2017 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.
    – n1cK
    May 13, 2017 at 13:06

3 Answers 3

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.

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

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

Thank you

2
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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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