I adapted the hello contract, expanding with require_auth()
and added an additional account oliver
that should be able to execute the action hashin
on behalf of the contract owner doctest1
. I adjusted the permission within the account doctest1
.
When I try to push action hashin
, I get an error:
cleos push action doctest1 hashin '["oliver"]' -p oliver@activeError 3090004: Missing required authority Ensure that you have the related authority inside your transaction!; If you are currently using 'cleos push action' command, try to add the relevant authority using -p option. Error Details: missing authority of active pending console output:
my contract looks like this:
#include "../include/doctest1.hpp" ACTION doctest1::hi(name nm) { print_f("Name : %\n", nm); } ACTION doctest1::check(name nm) { print_f("Name : %\n", nm); eosio::check(nm == "doctest1"_n, "check name not equal to `doctest1`"); } ACTION doctest1::hashin(std::string h) { require_auth(_self); print_f("my hash: %", h.c_str()); } EOSIO_DISPATCH(doctest1, (hi)(check)(hashin))
doctest1 account permission:
cleos get account -j doctest1 { "account_name": "doctest1", "head_block_num": 1923524, "head_block_time": "2019-03-15T13:12:15.000", "privileged": false, "last_code_update": "2019-03-15T09:33:07.500", "created": "2019-03-14T15:00:38.000", "ram_quota": -1, "net_weight": -1, "cpu_weight": -1, "net_limit": { "used": -1, "available": -1, "max": -1 }, "cpu_limit": { "used": -1, "available": -1, "max": -1 }, "ram_usage": 61719, "permissions": [{ "perm_name": "active", "parent": "owner", "required_auth": { "threshold": 2, "keys": [{ "key": "EOS6nZrpo4hurCZX88njkM5R2i8dmvjerSMfsMoEhK7yBHApqQSDR", "weight": 2 },{ "key": "EOS7pP22kEX2fmgthMeJLT2uz4nwnw6Zu33qC2Pd6w1p4wnYUswyc", "weight": 2 } ], "accounts": [{ "permission": { "actor": "oliver", "permission": "active" }, "weight": 2 } ], "waits": [] } },{ "perm_name": "owner", "parent": "", "required_auth": { "threshold": 1, "keys": [{ "key": "EOS6nZrpo4hurCZX88njkM5R2i8dmvjerSMfsMoEhK7yBHApqQSDR", "weight": 1 } ], "accounts": [], "waits": [] } } ], "total_resources": null, "self_delegated_bandwidth": null, "refund_request": null, "voter_info": null }
What do I need to adjust so doctest1
account can serve as a group of accounts (growing with accounts that need to execute hashin)?