For example, if Alice sends a transfer from the eosio.token contract to my smart contract, how do I listen to see if she has actually sent me a transfer from the eosio.token contract and get the data from the action?

1 Answer 1


Ah nevermind. There is an example in the tic-tac-toe contract https://github.com/EOSIO/eos/blob/master/contracts/tic_tac_toe/tic_tac_toe.cpp

You can use the apply method to listen to an incoming action but you must declare extern "C" beforehand.

//tic-tac-toe contract example    
extern "C" {
  void apply( uint64_t receiver, uint64_t code, uint64_t action ) {
    //logic goes in here
  • 1
    If you rephrase this as an actual answer with full explanation, it would probably be worthy of an upvote.
    – ToniWidmo
    Commented Jul 2, 2018 at 14:55
  • Where? I don't see that contract resolving your question.
    – Tyrick
    Commented Aug 9, 2018 at 17:08

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.