I'm building a Smart Contract that transfers EOS from my contract account to end user accounts.
I can not seem to find up to date and correct syntax for transferring EOS using eosio.token from within my contract.
All the info I can find, generally, references something like:
void Mycontract::yourcontract_action(account_name from,
account_name to,
asset quantity,
string memo)
{
eosio::transaction txn{};
txn.actions.emplace_back(
eosio::permission_level(from, N(active)),
N(eosio.token),
N(transfer),
std::make_tuple(from, to, quantity, memo));
txn.send(eosio::string_to_name(memo.c_str()), from);
}
It is using old syntax and does not appear to function as intended when I try and mold this to my contract.