1

I am creating a Java Backend using Web3J and subscribing to replayPastAndFutureBlocksFlowable from block 1 to latest, and then all subsequent new blocks.

From this, I get all the transactions, which I save it in the DB.

The problem is that, there are ERC20 transactions as well. In the tx Object, the toAddress is a smart contract address. What I want is to extract the actual from and toAddress where the token was transferred, amount, symbol, etc and then store that in my Database.

Basically, all transactions : deposits, withdrawal, of all ETH tokens, and all ERC20 tokens in database for analytics.

I am able to work with ETH transactions, which is pretty simple, but there is literally no clue how to extract the ERC20 details from the transaction Object.

1 Answer 1

1

I think you need to extract the information that you said from data parameter of the ERC20 transaction. these parameters are in hex format. etherscan.io can decode it. I just found a link (https://medium.com/coinmonks/discovering-the-secrets-of-an-ethereum-transaction-64febb00935c) for extracting data from input parameters. I'm afraid to say it is in Python format, but I think Web3J has these functions too.

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.