Hello guys, does anyone know of a way to programmatically get the deployed block number of a contract. I'm writing a script to fetch custom events from contract starting from the block number the contract was deployed. Scanning from block zero doesn't seems like a viable option.

Sep 28, 2021, 9:35 AM
In javascriot or solidity?
So if one side has 100x100 tokens and the other side is worth 10$ there are 1000 tokens
https://www.google.com/search?q=constant+product+in+amm&oq=constant+product+in+amm&aqs=chrome..69i57j0i512j0i22i30l3.8205j0j4&client=ms-android-verizon&sourceid=chrome-mobile&ie=UTF-8
I would suggest just doing research rather than reading uniswap code
Sep 28, 2021, 9:52 AM
really?
Sep 28, 2021, 9:52 AM
Its the token quantity
Sep 28, 2021, 9:52 AM
I found it very helpful
Sep 28, 2021, 9:52 AM
You cant tell even what a reserve is from the code
Yeah its the amount or quantity
Sep 28, 2021, 9:53 AM
what do you mean by this?
Sep 28, 2021, 9:55 AM
Its called constant product, i would just read about it in english
Sep 28, 2021, 9:56 AM
Ok thanks!
Sep 28, 2021, 9:58 AM
There are checks too i believe that give an error K and if either token doesnt equal its lastValue then it reverts out too
Sep 28, 2021, 10:02 AM
JavaScript
Sep 28, 2021, 10:10 AM
https://docs.ethers.io/v5/api/providers/provider/
There is a subscribe method too that lets you set a starting block number and get all the events since then ( i think)
Sorry i didnt read your question correctly, i dont know how to get the block number of a contracts origin, its gonna be its first tranaction or its first event though maybe
Sep 28, 2021, 10:18 AM
The problem is that I don't know the deployed block number of each custom contracts to be scanned.
Sep 28, 2021, 11:02 AM

© 2024 Draquery.com All rights reserved.