2

I'm writing a function in my contract that is supposed to run only if I receive a transfer notification from "eosio.token". The way I handle eosio.token transfer notification is similar to this (but not exactly, I changed the condition so that my function will be called ONLY when the "code" is "eosio.token"). My function is a public function but it is not defined in the ABI file.

My question is: Is it safe to assume a user has no way to call this function except through pushing a transfer action with "eosio.token"?

1 Answer 1

1

Contracts can't call each others' functions. Instead, they send actions to each other. All actions go through the apply function; it determines what's accessible.

2
  • Thank you very much, that makes sense! I think I can achieve what I want by making sure my function won't be called except when "code" is "eosio.token" and "action" is "transfer" within the "apply" function.
    – mochunhei
    Jul 1, 2018 at 12:24
  • Yes. That works. Jul 1, 2018 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.