I have account1 and account2. account1 has a contract with an action called update():

void mycontract::update(){
  table_t t(get_self(),scope);
  auto r = t.find(index);
  if (r == t.end()) t.emplace(get_self(),[&](auto& a){a.x=1});
  else t.modify(r,same_payer,[&](auto& a){a.x=2});

account1 keys look like so:

owner  : EOS...
active : EOS...

account2 keys look like so:

owner  : EOS...
active : EOS...

I try to call update() with permissions of account2@active. I have tried this from EOSStudio and eosjs, but each time I get back an error:

missing authority of account1

Does it have something to do with adding account permission to account1@active instead of adding key permission? I tried commenting out the table update and this did nothing as well.

Edit: Answer is that I was declaring permission account2@active. I should have been declaring account1@active and been using account2@active key

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.