graph-node
graph-node copied to clipboard
Check whether code is present at a given address
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
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?
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
Any update about this issue? Or can I use another function to check where an address is an EOA?