0

I'm interested in checking whether a specific permissions has been passed to a method invocation (as opposed to active) and have read one can use the require_auth2 method but when I try it I get the following error:

error: use of undeclared identifier 'require_auth2'; did you mean 'eosio::internal_use_do_not_use::require_auth2'?

so clearly this is internal and not meant to be used. how do I accomplish my goal?

1 Answer 1

2

C++ API is wrapped differently.

inline void require_auth( const permission_level& level ) {
  internal_use_do_not_use::require_auth2( level.actor.value, level.permission.value );
}

// how to use
require_auth(permission_level("eosio"_n, "vote"_n));
2

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.