I'm in the process of verifying my contract on Etherscan. Etherscan asks for ABI-encoded constructor arguments during the verification process, though I was a bit silly and don't quite know what they are.

This is simplified reason why: deployer.deploy(Contract, Date.now()/1000|0 + 36000)

I set the constructor argument to be a function of the current time, though I'm not quite sure when exact time was in seconds. At the moment, I currently have the truffle-generated artifact with me.

How can I get access to the constructor when the contract was deployed? Is there something in the truffle artifact file that could help? Because I know the rough time of when I launched the program, could I potentially brute force contracts to find the same bytecode?

Any help would be greatly appreciated.

1 Answer 1


From a simple inspection truffle's artifacts do not include the constructor parameters. But it does include the contract's bytecode.

If you inspect the transaction that created the contract you will see the bytecode is incorporated as part of the transaction data with some extra bytes at the end, those extra bytes are the construction parameters encoded with ethereum abi.

For example the AugurToken contract https://etherscan.io/address/0xe94327d07fc17907b4db788e5adf2ed424addff6#code in the "Contract Creation Code" if you scroll to the end you will see the same content that is in "Constructor Arguments"


For example the contract https://etherscan.io/address/0x50ce4b73320ee36e307c1551207fd8008f4f38eb#code was create at https://etherscan.io/tx/0xd7a4f8958704be82903ce9bd44a3770e110776bd20ddea672d43bc92d17b4977.

If you compare both the byte code in the code section and the data in the transaction the extra bytes are the parameters send to the constructor

  • If I'm not wrong, I think that the abi-encoded constructor arguments only show up in the bytecode on Etherscan once someone's verified it. Commented Feb 5, 2018 at 18:06
  • For instance, this is my contract and I can't find any of my constructor arguments within it (even hex encoded). etherscan.io/address/… Commented Feb 5, 2018 at 18:06
  • @NagaganeshJaladanki You are correct the bytecode+params is present in the transaction that created the contract. Check input data in etherscan.io/tx/….
    – Ismael
    Commented Feb 5, 2018 at 19:39

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.