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

Enhancement: Auto-import ERC20 tokens after fork #56

Closed
jxom opened this issue Sep 14, 2023 · 0 comments · Fixed by #75
Closed

Enhancement: Auto-import ERC20 tokens after fork #56

jxom opened this issue Sep 14, 2023 · 0 comments · Fixed by #75
Labels
D: Intermediate Difficulty: Intermediate P: Medium Priority: Medium T: Enhancement Type: Enhancement

Comments

@jxom
Copy link
Member

jxom commented Sep 14, 2023

The Request

The ability for Rivet to automatically import ERC20 tokens that have been transferred to an account after the fork block number.

This feature is different from retrieving ERC20 tokens before the fork block number. This is more non-trivial (should we use an indexer? or should we paginate filter or log queries on the RPC Provider?). However, for after the fork, I believe Anvil has an indefinite block range for log queries (eth_getLogs), so we could probably just use that and filter against ERC20 Transfer events.

Problem

Currently, Rivet does not pick up new ERC20 tokens that have been transferred to an account.

Example: After a successful swap from USDC -> DAI on Uniswap, I would expect to see DAI in my ERC20 tokens list in Rivet, however I cannot see them at the moment.

Solution

As a user, if I receive some new ERC20 tokens, I would expect Rivet to automatically import those tokens so I can see them in the ERC20 token list.

Notes

We could probably use viem's getLogs with a block range of forkBlockNumber to "latest", and scope on the Transfer event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D: Intermediate Difficulty: Intermediate P: Medium Priority: Medium T: Enhancement Type: Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant