0

Is there a way to get the index (ordinal) of the current action that is being processed?

If you could access apply_context you could do get_action_id() but afaik that isn't exposed inside an action.

What I would like is to be able to know the contract that is being executed that I'm being notified of inside a notification handler like [[eosio::on_notify("*::transfer")]]

2 Answers 2

1

I don't think that this is possible atm.

Looking at the intrinsics_def.hpp in the cdt, there is no intrinsic to get the action_ordinal of an action called. Pretty sure this is the place where it would be found if there was such functionallity.

1
  • Maybe worth opening a issue.
    – cmadh
    Aug 20, 2022 at 16:07
0

To get the contract the notification originated from, you can use get_first_receiver() but I'd still like to know if it's possible to get the action ordinal, so, if anybody knows, please respond 😊

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.