1

Section 2.6 of the EOSIO developer docs https://developers.eos.io/welcome/latest/getting-started/smart-contract-development/adding-inline-actions describes how send an inline action. It all works fine but I can't see how the message argument is used in the action code. The code for action is as follows:

[[eosio::action]]
  void notify(name user, std::string msg) {
    require_auth(get_self());
    require_recipient(user);
  }

Can anyone explain how the msg parameter is used within this action/function?

1 Answer 1

1

The action constructor passes a data payload (including the message) to the action. To confirm, I used the read_action_data function to examine the data passed to the action. As expected, it does contain the message. Furthermore, the require_recipient call must make use of the 2nd element of the data tuple (the message string) when passing the receipt back to the recipient.

I'm therefore guessing that the msg parameter is passed in to the notify action/function in case I need to make use of it in the future.

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.