new to blockchain.

I've got a good understanding of bitcoin and other similar tokens and how their confirmations and transactions look. But I'm still trying to figure out how Ethereum and ERC20 tokens like USDC, USDT work. I understand that USDT can also work on other blockchains like TRC20 or BSC. So I'm assuming I just need to listen to an Ethereum node and check for these tokens in there right?

Could somebody help me understand a bit more how this works? Specifically how to confirm transactions for ERC20 tokens?

  • Sorry, what do you mean with "confirm"? Sep 16 at 4:42
  • @LauriPeltonen sorry, left out the transactions part, updated. I'm trying to see how you can confirm that somebody has sent an ERC20 token to an address. i.e. USDT or USDC and how you can determine that they're from the USDC/USDT blockchain Sep 16 at 4:53

An ERC20 token is transferred by calling the token contract's transfer function (or approve + transferFrom). That modifies the contract's token balances and should emit a Transfer event.

Therefore, to monitor for token transfers, you should be monitoring the token contract for a Transfer event.

However, there are no guarantees that an ERC20 token contract actually emits the event, and that the event data would be accurate. Therefore the only certain way is to check token balances before and after a transaction.

The main problem with monitoring ERC20 token transfers is that it's rather straightforward to monitor transfers of one token contract, but if you want to monitor transfers of any token contract, you basically have to start analyzing transactions to see which of them include token transfers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.