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?
Asked
Active
Viewed 1,975 times
1 Answers
0
I found the answer myself- Its pretty simple infact:
- Search for all the transaction from 0 to LatestBlock
- Get transactions in each block and loop through transactions one by one.
- Get Transaction receipt in each transaction and check whether its deployment transaction ['to' = '0x0'] and if so, get contract address.
- If given contract address matched input address, hurray we found the deployed transaction.
ActionCures
- 71
- 2
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 Sep 28 '18 at 17:29