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?
Asked
Active
Viewed 1,474 times
1 Answers
-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
-
okay thankyou, but we need to check the creation block number with the help of just contract address , will it work for that? – Kavita Joshi Jun 05 '22 at 02:47
-
@KavitaJoshi yeah, you can use method 2 or 3 – Jacopo Mosconi Jun 05 '22 at 18:51