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?

Averin Maxim
  • 293
  • 4
  • 6
  • What exactly do you mean by verifying it ? Being sure this is really the contract you deployed ? – n1cK May 12 '17 at 12:01
  • 1
    @NikitaFuchs something like this: https://etherscan.io/verifyContract?a=0x26cf05a5829dd739d0c93be57d6aeea326ef8c0f – 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. – n1cK May 13 '17 at 13:06

3 Answers3

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.

Travis Jacobs
  • 1,535
  • 1
  • 13
  • 25
2

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

Thank you

Thedoorsalive
  • 151
  • 1
  • 5
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.

Rosco Kalis
  • 2,137
  • 2
  • 14
  • 26