I would like to send SYS token owned by the smart contract account to a third party account when anyone call a specific action. I have tried the following code but I am getting an error:
[[eosio::action]]
void sendtoalice() {
// make an inline transfer to alice
action transferAlice = action(
permission_level{get_self(),"active"_n},
"eosio.token"_n,
"transfer"_n,
std::make_tuple(get_self(), "alice", "0.0001 SYS", "")
);
transferAlice.send();
}
Error:
$ cleos push action mycontract sendtoalice '[]' -p bob@active
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":"mycontract","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [{"actor":"mycontract","permission":"eosio.code"}], provided keys [], and a delay max limit of 3888000000 ms
pending console output:
Any idea of what could be wrong?