Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Internal native asset transfers #5173

Open
1 of 2 tasks
spennyp opened this issue Jan 29, 2024 · 7 comments
Open
1 of 2 tasks

[Feature] Internal native asset transfers #5173

spennyp opened this issue Jan 29, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@spennyp
Copy link

spennyp commented Jan 29, 2024

Description

Currently, there is no way to track internal native asset (ex. ETH) transfers inside of an event handler.

This is because internal transactions are not tracked. This is problematic for figuring out the correct flow of assets during an event.

Specifically, we ran into this issue when creating the 0x community subgraphs. Since internal native asset transfers cannot be tracked, it is not possible to index and assemble full 0x trades in a subgraph using the graph-node without call handlers (which are not supported everywhere).

Ideally, there would be an array of internal transactions as part of the transaction class, where each one would at least have the native asset amount that was transferred. I.e can access these in an event handler like: event.transaction.internalTransfers

For example, you can see internal transactions for a transaction in etherscan:
Screenshot 2024-01-29 at 15 51 20

Could use a feature flag to turn this on like the receipts flag is used today, so internal transactions are off by default speeding up indexing.

This was originally mentioned here (#297) in 2018, and was planned as part of "phase 2" but was never implemented.

Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.

No response

Some information to help us out

  • Tick this box if you plan on implementing this feature yourself.
  • I have searched the issue tracker to make sure this issue is not a duplicate.
@spennyp spennyp added the enhancement New feature or request label Jan 29, 2024
@idan-orbs
Copy link

I'm facing the same challenge.
I building a subgraph that tracks token swap on a certain dex on Polygon, and when the swap involves the native asset MATIC, I can't parse it from the event logs.

@70nyIT
Copy link

70nyIT commented Feb 29, 2024

interesting to see how it's hard to track these transfers while with Smart Accounts being a reality, these type of transfers will be more and more needed to create great UX. Didn't check but ... hasn't been created an EIP to propose a sort of event-like emitted when internal transfers with value > 0 happens?

@azf20
Copy link
Contributor

azf20 commented Mar 12, 2024

I'm not aware of an EIP for that @70nyIT, but indeed I think that could be an interesting addition to the client
I think the original request would also require tracing so it might also not be available everywhere @spennyp?

@70nyIT
Copy link

70nyIT commented Mar 12, 2024

Yes, we need tracing (this is why such an EIP could be a huge benefit to have this feature without relying on Archive Nodes). Or at least, this is the only way I've found so far to access those info.

@70nyIT
Copy link

70nyIT commented May 27, 2024

@azf20 in case you missed it - there's an EIP to solve this problem proposed by Vitalik https://ethereum-magicians.org/t/eip-7708-eth-transfers-emit-a-log/20034/10

@stewart-lore
Copy link

This is the last thing I need to fully adopt the graph for all my on chain data needs. I currently have an custom aka complicated solution for indexing native asset transfers for smart contract accounts. I would really appreciate this feature!

@70nyIT
Copy link

70nyIT commented Jun 12, 2024

just curious, what's your flow @stewart-lore ? debug trace each block or a different approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants