[Ethereum] How to verify a contract having constructor arguments

abiconstructorcontract-deploymentetherscanverify

This is a contract that requires an argument to be deployed.

The Contract Name is "Asset". The compiler used is "Compiler 0.4.16+commit.d7661dd9.Emscripten.clang" and Optimization was Disabled.

To validate it this is the tool used.

Other contracts with no constructor arguments were succesfully verified, but this one complains like this:

Error! Unable to verify source code
Missing Constructor Arguments for function Asset(address _SCIssuers)

It seems that the validator needs to know a ABI-encoded info about constructor arguments as stated here.

I tried to encode Method ID + first parameter, but had some difficulties. To deploy the contract I used:

Create("0x22bc795b5b8154fe619724e7cb1f4b931cd39c11")

So first parameter must be 0x22bc795b5b8154fe619724e7cb1f4b931cd39c11.

Problem is to find out the constructor method ID. The online IDE used to deploy doesn't tell me that information. How can I find it?

By the way, the constructor function is this one:

// Constructor
function Asset(address _SCIssuers) {
    SCIssuers = _SCIssuers;
}

Any help? Thx!

Refs.:

Best Answer

You need to correctly ABI-encode constructor arguments. You can easily do this with online tool https://abi.hashex.org. Just paste in abi to automatically parse constructor parameter types or add them manually.