graph-node icon indicating copy to clipboard operation
graph-node copied to clipboard

Check whether code is present at a given address

Open azf20 opened this issue 4 years ago • 3 comments

Do you want to request a feature or report a bug? Feature

What is the current behavior? Graph Node is not able to distinguish whether an Ethereum address is a contract, or a EOA

What is the desired behavior? Add a means to check whether code is present at a given address (via eth_getCode, docs here)

If code is present, it is a smart contract

Considerations: this will need to check for code at a particular block, as contracts can be destroyed. eth_getCode seems to support block number, not block hash which introduces determinism problems.

Discussed here

azf20 avatar Oct 23 '21 09:10 azf20

not block hash which introduces determinism problems

I don't follow. Why would picking a block number not give you a deterministic value for the code at a particular height?

silasdavis avatar Nov 06 '21 14:11 silasdavis

If there is a re-org, during indexing, the state for the same block height might change depending on which branch the subgraph is indexing

azf20 avatar Nov 06 '21 22:11 azf20

Any update about this issue? Or can I use another function to check where an address is an EOA?

noyyyy avatar Sep 07 '22 09:09 noyyyy