I am gonna get account name of caller(wallet) in my action of smart contract. I used functions current_receiver(), get_sender(), get_first_receiver(). but I got contract`s account name and empty string.
1 Answer
To check/verify authorization of an account, pass the account-name as an argument to your ACTION and call require_auth(...) or has_auth(...).
void test::test(name user) {
check(has_auth(user), "User not authorized");
...
}
void test::test(name user) {
require_auth(user);
...
}