1

Hi I'm trying to verify a token deployed at 0x87ab739464881af0011052d4ca0b0d657e8c3b48 in tx 0xbaa8f3fe86a35d2e0b7ed16b24782743e7dfb1eb21cfbb12253d0a50ef2ff365. (Mainnet)

I compiled and deployed it with remix, options:

  • Compiler version:0.5.2+commit.1df8f40c.Emscripten.clang
  • Optimization: not enabled.

The contract source code is:

pragma solidity ^0.5.0;

import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20Capped.sol";
import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20Pausable.sol";
import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol";
import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol";

contract MTB19 is ERC20Pausable, ERC20Burnable, ERC20Capped, ERC20Detailed {

    constructor(uint256 cap, address prefund, uint256 amount) public ERC20Capped(cap) ERC20Detailed("MikeTangoBravo19", "MTB19", 18) {
        mint(prefund, amount);
    }

}

The constructor abi-encoded params are:

0000000000000000000000000000000000000000000003bfe5fd1c4b11cc0000000000000000000000000000d60b471bd8c62dc4d2f04493413c6cb73b7ce4640000000000000000000000000000000000000000000002cfe905a78b63800000

(The openzeppelin dependecy is the one published in github [commit: e287eab])

The bytecode generated by Remix and the Etherscan expected bytecode are equal but when I introduce the flattened code and all the data provided to etherscan verifier bytecodes are totally different. How can I do it so that, bytecodes are the same and it verifies my contract?

  • What's the compiler version for openzeppelin code? When you flaten the code, everything is compiled with the same version (0.5.2 in your case), which could yield a different binary. – goodvibration May 6 at 18:37
  • The pragma solidity of the openzeppelin code is 0.5.0 – Jordi Estapé Canal May 7 at 8:21
  • With ^ or without ^? – goodvibration May 7 at 8:29
  • With ^, like: pragma solidity ^0.5.0; – Jordi Estapé Canal May 7 at 8:43
  • Etherscan Helpdesk found the solution. It seems the flattened sol file I was using was not correctly generated. – Jordi Estapé Canal May 9 at 9:00

Your Answer

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

Browse other questions tagged or ask your own question.