0

Take this transaction as an example.
This single transaction contains 50 inner transactions.

If directly calling api, what we get is a very long raw hex in input field. This input actually contains the contract method info and the method params. And it seems that the contract method is actually a batch transfer, but the creator does not provide the full code.

Here comes the issue, if I need to monitor this token transfer by code, how can I deal with this kind of transfer? As everyone can create new contract, do I need to trace all contracts that deal with this kind of token?

0

You don't need to do anything special.

These type of bulk sending contracts will still emit the regular ERC20 standard Transfer event. All you need is a program that searches for these events in transaction logs, the same as you would for a single erc20 transfer tx.

Both parity and geth support a log filter, which can be accessed through web3 as well.

  • eth_getTransactionReceipt together with event and log is a great help – xuanzhui Jul 31 '18 at 15:17
0

You have couple of ways:

  1. Use truffle-contract to get contract code and subscribe to events (in your case - Transfer). Truffle-Contract automatically decode logs to readable format. Cons: you have to use Truffle infrastructure to compile code and get contract at address.

  2. Time ago I used code from truffle-contract that responsible for transaction log decoding. Unfortunately it was done for closed source project, but I definitely remember I reversed it from decodeLogs method, suppose you can try to do the same - extract this method with all dependencies and feed it with your raw transaction log data and get something readable.

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.