This is my example code deployed on myaccount
#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>
#include <eosiolib/currency.hpp>
using namespace eosio;
class exampleSendToken : public eosio::contract
{
public:
using contract::contract;
exampleSendToken(account_name caller) : contract(caller) {}
/// @abi action
void send()
{
action(permission_level{_self, N(active)}, N(eosio.token), N(transfer),
currency::transfer{.from=_self, .to=N(myotheraccount), .quantity=asset(1), .memo="sent by contract"}).send();
}
};
EOSIO_ABI( exampleSendToken, (send))
I used this line to give [email protected] the permissions to use active and initiate the transfer.
cleos set account permission myaccount active '{"threshold": 1,"keys": [{"key": "EOS7Qcpqm8....3T9amgDJu8v","weight": 1}], "accounts": [{"permission":{"actor":"myaccount","permission":"eosio.code"},"weight":1}]}' owner -p myaccount@owner
When I call cleos --print-response push action myaccount send [] -p myaccount
the returned error is
Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: unable to find key
pending console output:
The both accounts exist and the full returned response asks for a key that I have in my wallet
"required_keys": [
"EOS7Qcpqm8....3T9amgDJu8v"
What is the problem here?