0

I have an application which should work as an exchange. Customers have their own Ethereum addresses on my Geth server, and they might receive ERC20 Tokens on them. I need to fetch the incoming transaction data for multiple accounts.
I've used eth_getLogs() like this:

eth_getLogs(
   '0x9589a2',
   'latest',
   '0xdac17f958d2ee523a2206206994597c13d831ec7',
   [null, null, '0x000000000000000000000000825F80D4c229f56bf1275C9592223a9d921329E2']
);

Now, I have some questions:

  1. What are the 1st and 2nd parameters in array for? I found this sample code and used it, but unfortunately I couldn't find the appropriate document for it.
  2. I added some 0000... before address regarding to the example I found. It works now, but what is the exact value here and what is its correct format?
  3. And the main question: How can I do searches at once on multiple accounts for each ERC20 Token?
  • 1. fromBlock and toBlock – goodvibration Apr 20 at 7:42
  • 2. Apparently, a 64-character long hexadecimal string prefixed with 0x – goodvibration Apr 20 at 7:45
  • @goodvibration, I meant 2 null value before hex strnig in question #1. [null, null, '0x000000000000000000000000825F80D4c229f56bf1275C9592223a9d921329E2'] – Mohammad Saberi Apr 20 at 8:16
0

You can listen for Transfer events for all tokens. Then build your own database of all transfers you are interested in. Then match those transfers to your exchange user balances.

Poll for the events scan them again a few blocks back.

Here is some Python code: https://github.com/TokenMarketNet/sto/blob/master/sto/ethereum/scanner.py#L153

| improve this answer | |

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.