Am trying to write small application which will be able to find Contract deployment transaction with only input parameter - contract address. The application should be able to search entire net.,i,e say Rinkeby and should exactly find deployed transaction hash. This is applicable for any given contract address in rinkeby. I do not want to search with events or logs. Specifically am looking for how to find all the transactions with "0x0" as target programmatically?

1 Answer 1


I found the answer myself- Its pretty simple infact:

  1. Search for all the transaction from 0 to LatestBlock
  2. Get transactions in each block and loop through transactions one by one.
  3. Get Transaction receipt in each transaction and check whether its deployment transaction ['to' = '0x0'] and if so, get contract address.
  4. If given contract address matched input address, hurray we found the deployed transaction.
  • 1
    This will not work for contracts that were deployed by another contract.
    – Ismael
    Commented Sep 27, 2018 at 14:57
  • can you please explain in detail?I think "to" = 0x0 in the deployment txn, irrespective of whether external account or contract initiated the txn Commented Sep 28, 2018 at 17:05
  • 1
    A contract A can deploy a 'child' contract B with B child = new B(params); (in solidity). The child contract was created by an 'internal' transaction and it has no corresponding normal transaction with null 'to'.
    – Ismael
    Commented Sep 28, 2018 at 17:29

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.