a list of Externally Owned Accounts and another of Contract Accounts. I am scanning every new block and i need to check if there are ERC721 transfers to one of my EOA accounts.
Does anyone know a way to do that? I am assuming that first i must determine if the transaction is related to an ERC20 or an ERC721 token transfer (checking event logs topics maybe? ERC20 2 indexed vs ERC721 3 indexed?)
Thanks :)
Listen for emitted Transfer events, filter out the eoa you want using 'to' from the event
Thank you for your reply, Grim. How do you usually distinguish ERC20 and ERC721 when you scan blocks/filter transactions?
Using the topic length
Hmm, so I was right about checking ERC20 -> 2 indexed, ERC721 -> 3 indexed. I found this solution but was in doubt if it was not a bad practice.. Thank you.
Well, that's like the best existing solution for detecting erc20 vs erc721 transfers offchain
Обсуждают сегодня