I need to write a simple function that would send tokens using a different account action. Exactly the same situation as in these questions: one and two
But I have to use not eosio.token contract but my custom contract < transfercontract > that is similar to eosio.token.
My transfer code for < maincontract > looks like:
std::vector<permission_level> p;
p.push_back(permission_level{from, "active"_n});
action(p, "<transfercontract>"_n, "transfer"_n, std::make_tuple(from, to, quantity, std::string("Deduction test"))).send();
I used the command for adding eosio.code to the active permissions like here:
cleos set account permission <maincontract> active '{"threshold" : 1, "keys" : [{"key": "EOSpublicKey", "weight": 1}], "accounts" : [{"permission":{"actor":"<maincontract>","permission":"eosio.code"},"weight":1}], "waits":[]}}' owner -p <maincontract>@owner
After that, I used my < maincontract > action with the following permissions:
cleos push action <maincontract> actionname '["from","to", "quantity"]' -p from
Actually, I've tried several different options for permissions, but nothing worked.
Please, help me resolve it.
I did not set the permissions correctly when performing a transaction? or incorrectly added additional permissions for the account?
UPDATE:
The execution:
cleos push action crowdfledger customaction '["forbanpirate","anotheraccount","1.000 TKN"]' -p forbanpirate
The crowdfledger contract tries to use <transferaccount >::transfer(forbanpirate, anotheraccount, 1.0000 TKN)
inside.
The error:
Error 3090003: Provided keys, permissions, and delays do not satisfy declared authorizations
Ensure that you have the related private keys inside your wallet and your wallet is unlocked.
Error Details:
transaction declares authority
'{"actor":"forbanpirate","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions
[{"actor":"crowdfledger","permission":"eosio.code"}], provided keys [], and a delay max limit of 3888000000 ms
pending console output:
cleos push action <maincontract> actionname '["from","to", "quantity"]' -p from
should they have a memo included in parameters?