I want to verify and publish my solidity source code on Etherscan.io. My smart contract has an argument in it's constructor for which I need to fill a field in the form that takes Constructor Arguments in ABI-encoded format.
How will I convert my argument into ABI-encoded format?
Best Answer
An easy way to find the constructor arguments is:
Browse to your contract on Etherscan and click on the tx hash for its creation
On the top right, where it reads "Tools & utilities", click on the arrow to see more options and select "Parity Trace"
For the action pertaining the contract creation, click on "Show more" below to see the input/output
On the input textarea, scroll down to the end. The last portion of that string are your constructor arguments.
Search for "0029", whatever string at the end is after the 0029 is your constructor arguments.
For example, this is a contract I deployed a few weeks ago: https://etherscan.io/vmtrace?txhash=0x840a4c95de8287b39b4a104470c49ee1a78fee13ff790b85624e0f66d9d05be4&type=parity
Input is (shortened for the sake of space):
...0019909216919091179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061236557805160ff1916838001178555612392565b82800160010185558215612392579182015b82811115612392578251825591602001919060010190612377565b5061239e9291506123a2565b5090565b6123bc91905b8082111561239e57600081556001016123a8565b905600a165627a7a723058201c3fd67e0e5dae16f4d5818e4def156aa71b9a6925640af36a76c616a54e724c002900000000000000000000000006595656b93ce14834f0d22b7bbda4382d5ab51000000000000000000000000000000000000000000000000d8d726b7177a80000
My constructor argunments are whatever is after 0029:
00000000000000000000000006595656b93ce14834f0d22b7bbda4382d5ab51000000000000000000000000000000000000000000000000d8d726b7177a80000