2

I was trying to find the creation block number using contract address , is there is a way to find creation block number when a contract address is deployed using web3.py?

Thijs van der Heijden
  • 1,147
  • 1
  • 10
  • 25

1 Answers1

-1

well, there are 2 things you can do with ** web3.py ** and one thing you can do with etherscan (or any other explorer from the etherscan group)

1) web3:

You will need not only the address but also the hash of the creation transaction, so you can do web3.eth.getTransactionReceipt(*hash*) The resulting object will contain a blockNumber.

2) web3:

This will take a lot of time and effort, but you can create a script that will check every transaction from block 0 (or a block that you are sure is before your contract creation block) and check all the data within each transaction to find the correct block

3) etherscan:

you can call etherscan API - see "get transaction list" at etherscan.io/apis#accounts

Jacopo Mosconi
  • 972
  • 8
  • 22