6

I'm trying to reverse engineer etherscan so I can make my own explorer. While I was checking Augur token transfers I found a transaction where both the to and from address where different from the token's smart contract address. How is this possible?

2

Contracts can call other contracts while they are executed. You can see the calls made by this contract in the Parity VM Trace. In particular, here is the call to the token contract:

"action": {
  "callType": "call",
  "from": "0x25dde46ec77a801ac887e7d1764b0c8913328348",
  "gas": "0x9ca0",
  "input": "0xa9059cbb0000000000000000000000009837cb670081ea411bfd26957f04a0da8663f9940000000000000000000000000000000000000000000000000000000000000001",
  "to": "0xe94327d07fc17907b4db788e5adf2ed424addff6",
  "value": "0x0"
},
  • Awesome! thanks. It is amazing etherscan has this much functionality. I wonder how it identified that transaction as a token transfer. – Juan Lopez Mar 13 '18 at 21:02
  • I absolutely agree! I'm pretty sure etherscan does this by listening to events. You can see here that your transaction triggered an event of the token contract. Therefore, all clients listening to events of the token contract were notified that a token transaction happened. – mafrasi2 Mar 13 '18 at 22:00
  • Yes indeed etherscan listens to Transfer() event. – abed Dec 15 '18 at 18:09

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.