0

So I am asking this question because I recently learnt about what is called "Internal Transactions". I was actually reading the answer here and from this I understand that a transaction between EOA_A and a smart contract can trigger transfers of token from the EOA_A that sent the transaction to another EOA_B, but this transfer of token between EOA_A to EOA_B is not recorded on the blockchain.

My question now is, if one is interested in tracking and be alerted by all activities on an account, how will one do this? For example if I want to be notified when tokens are transfered to EOA_B? Given the fact that the token transfer from EOA_A to EOA_B does not show up in any transaction how can I be notified?

Based on my knowledge, one way could be to listen to Transfer events on smart contracts. But follow up questions:

  1. As far as I understand it is possible for a smart contract to implement the transfer methods without emitting the Transfer event. Not good practice but nothing stopping this from happening, which makes me think this approach of listening to the Transfer event might not be fool proof.

  2. The transfer method and Transfer events are standardized part of ERc20 token. But I can imagine that there are other methods and operations peculiar to certain smart contracts, not standardized but that will also lead to token transfer from one EOA to another. So that means an approach of listening to just the Transfer event will miss these kinds of token movement.

So again the question, how can one track all events', especially token and eth transfers in and out of an EOA given the technical drawbacks I listed below?

Are there some knowledge about the workings of Ethereum that I do not know about that could make this possible?

2 Answers 2

1

First of all, the fact that internal transactions will not appear on the blockchain does not mean that the transaction cannot be found on the blockchain, but that the transaction cannot be directly located, but in fact it still exists on the blockchain. Because internal transactions are not "transactions" in essence, but internal message calls of a "transaction". Although internal message calls cannot be queried directly, they can be located by finding the "transaction" to which the internal transaction belongs.

Secondly, all standard ERC20s have Transfer events. For ETH transfers, trace_transaction can be used or Transfer events can be tracked for WETH to obtain transfer tracking. For details, please refer to: https://ethereum.stackexchange.com/a/165756/128269

Finally, for non-standard ERC20, it is necessary to analyze specific issues and see what kind of events are defined for transfer behavior. If no event is issued, specific transaction calls can also be tracked through the contract ABI to find out whether a transfer has occurred.

1
  • There is no such thing as internal transaction. It is a made up concept by proprietary blockchain explorer Etherscan, and not part of the standard Ethereum. Commented Sep 6 at 12:19
0

According to the ERC-20 Token Standard, every token transfer should emit a Transfer event. If a token behaves differently, it is not ERC-20 compliant and would likely not be integrated by others.

The other point you raise is that there could be another functions besides transfer and transferFrom that can transfer token balances between two accounts. Technically, this contract should be ERC-20 compliant, but it is obviously very dangerous to use. I am not aware of any such examples in the wild.

In general, you should always follow a token checklist when integrating any token with your contract to ensure that it does not exhibit unexpected behavior.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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