You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's no JSON-RPC for this, so I guess we should make a binary search using getCode. It would work like this:
Get the current block number
Start a binary search getting the code of the contract between 1 and the current block number
If there's no code in 1 but there is in block number, look at blockNumber/2, repeat.
Once the block number of the deploy is obtained, get all the transactions of that block, get the recipt, check the contractAddress and see if it matches the given address.
Use the tx to also obtain the address that deployed it
Notice that this will only work in ganache and in archive nodes.
The text was updated successfully, but these errors were encountered:
There's no JSON-RPC for this, so I guess we should make a binary search using
getCode
. It would work like this:blockNumber/2
, repeat.contractAddress
and see if it matches the given address.Notice that this will only work in ganache and in archive nodes.
The text was updated successfully, but these errors were encountered: