I'm inspecting a contract on etherscan, at the following URL:


At the bottom of the web-page, I see two sections:

  1. Contract Creation Code
  2. Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

The contents of the 2nd section is most certainly not equal to the last bytes in the 1st section.

So what exactly does it mean "the last bytes of the Contract Creation Code above"?

My ultimate goal is in fact to obtain the constructor arguments of some other contract.

However, when I inspect this contract on etherscan, the 2nd section does not appear at all.

So I was hoping I could somehow extract it from the 1st section, but I cannot figure out the relation between them (if any).

The other contract can be inspected on etherscan at the following URL:


Thank you!

1 Answer 1


The ABI standard defines how arguments are encoded and functions are accessed in function calls on smart contracts.

The ABI standard dictates that the the constructor arguments are put on the end of the contract creation code. If you look at the init field (etherscan calls it Input Data Field in the link below) of the contract creation transaction, you will see the data that etherscan has interpreted as the constructor arguments (it is the end of the Input Data Field):



So it seems that the field called "Contract Creation Code" on etherscan does not include the constructor arguments as the text would otherwise indicate.

Digging a little deeper into the contract creation code (the Input Data field from above) reveals that the constructor arguments begin at byte 6993 (0x1B51) of the init field. This value (1b51) also appears in the beginning of the input data field twice. I ran the binary code manually (the first 28 bytes of the init field) and found out that the bytes starting at 0x1b51 to the end of the init field are copied to memory (of the virtual machine). So the compiled code copies the constructor arguments from the init field to memory and accesses them from there in the further execution of the constructor.

You can also have a look at: How are the arguments of the constructor encoded in the contract creation transaction?

  • I compared between the contents of the 1st section and the input data of the contract-creation transaction, and it seems to be aligned with your answer (the two pieces of data are identical, with the exception of a suffix at the end of the latter). Thank you very much!!! Commented Jan 7, 2019 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.