1

Is it possible to have a web server listen or know when a transfer has been made on a particular ERC20 Token Contract?

From what I researched, we are not able to make a HTTP request inside the contract's transfer method.

Is there some way for an external web server to "watch" the blockchain for when those custom tokens are transferred?

Thanks

  • This is possible using javascript web3js and events – Badr Bellaj Aug 17 '17 at 9:31
  • Are you able to explain more? Any examples? – keweli Aug 17 '17 at 9:38
0

As you can see in the token tutorial, at the end of the transfer method the following code is executed:

/* Notify anyone listening that this transfer took place */
Transfer(msg.sender, _to, _value);

This emits an Event.

You can 'listen' for emitted Events using web3.js for example.

  • If this answer helped you, please mark it as correct. – Thomas Clowes Aug 17 '17 at 13:32

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.