Enhancement: Auto-import ERC20 tokens after fork #56
Labels
D: Intermediate
Difficulty: Intermediate
P: Medium
Priority: Medium
T: Enhancement
Type: Enhancement
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 ERC20Transfer
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 offorkBlockNumber
to"latest"
, and scope on theTransfer
event.The text was updated successfully, but these errors were encountered: