2

void apply( uint64_t receiver, uint64_t code, uint64_t action )

What's the difference between receiver and action in eos contract?

1
  • Why not adopt the answer below?
    – smarteasy
    Commented Jun 16, 2018 at 3:34

2 Answers 2

4

This page in the official documentation should help answer this:

diagram

From a global view of an EOSIO blockchain, every node in the EOSIO network gets a copy of and runs every action in every contract. Some of the nodes are doing the actual work of the contract, while others are processing in order to prove the validity of the transaction blocks. It is, therefore, important that contracts be able to determine "who they are", or basically, under which context are they running. Context identification information is provided in the action context, as illustrated in the above diagram by receiver, code, action. receiver is the account that is currently processing the action. code is the account that authorized the contract. action is the ID of the currently running action.

2
  • 1
    The wiki is deprecated. Could you please add the answer here?
    – friedger
    Commented Jul 13, 2018 at 8:54
  • Updated the answer to fix URL and include content
    – confused00
    Commented Jul 17, 2018 at 7:12
2

Receiver is executing contract.
Code is namespace of action event.
Action is name of the function to execute.

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.