2

This question will be very similar to this one, but I'm stuck and don't know what to do:

Token contract source code not verified

Anyways, my friend sent me 2 pieces of code, the actual contract code, which can be found here:

https://remix.ethereum.org/#optimize=true&version=soljson-v0.4.25+commit.59dbf8f1.js

And the interface:

https://github.com/ConsenSys/Tokens/blob/master/contracts/eip20/EIP20Interface.sol

Now I'm a coder and I understand that pasting just the first part of the code obviously wont work, so I deleted the import part and pasted in the interface. Then I ran the solidity-flattener over the code, and this is the output:

https://pastebin.com/xvtT3e1Z

However, the code isnt being verified on https://etherscan.io/verifyContract2 I get the following error:

https://puu.sh/BQMOg/fd3217d62e.png

What should I do, what am I doing wrong? The contract address is 0x3C403c5371113a7d3f91d4b9C9A88333Ca567e74, the compiler 0.4.21+commit.dfe3193c and contract name Victory.

Thank you for your help.

Ismael
  • 30,570
  • 21
  • 53
  • 96
Rok Dolinar
  • 121
  • 3
  • 1
    2) Constructor Arguments ABI-encoded (For contracts that accept constructor parameters):

    Did you supply the ABI code for the constructor arguments?

    – vhie Oct 26 '18 at 00:48
  • I did, still have the same problem. If I compare expected result and my generated bytecode, my bytecode is substantially shorter. – Rok Dolinar Oct 26 '18 at 08:34
  • Have you tried Optimization = No? – vhie Oct 26 '18 at 09:03
  • Yes, but the optimization must be Yes, because that's what my friend did when he created the contract. – Rok Dolinar Oct 26 '18 at 11:12
  • How were the contracts deployed? Did you try different versions of the compiler? You may also try setting optimization runs to 0. – Ismael Oct 26 '18 at 19:36
  • @RokDolinar I tried publishing a contract both with optimization enabled and disabled. I got the same error when I tried to publish the contract with Optimization = Yes when I deployed it with Optimization = No. You might want to review with your friend again if the optimization is indeed enabled upon deployment. This is just my opinion base on my tests. – vhie Oct 29 '18 at 03:03

1 Answers1

1

I successfully verified your contract in Etherscan and Blockscout: https://etherscan.io/address/0x3c403c5371113a7d3f91d4b9c9a88333ca567e74#code https://blockscout.com/eth/mainnet/address/0x3c403c5371113a7d3f91d4b9c9a88333ca567e74/contracts

I think the problem was with the wrong constructor arguments provided. But since Etherscan made the possibility to automatically auto-fill constructor arguments, verification process became easier.

Victor Baranov
  • 2,027
  • 1
  • 17
  • 31