Can anyone point me to example code for writing a smart contract that calls actions on other smart contracts? The general method of doing this is documented here but example code is not provided.
1 Answer
Check this example of delegate bandwith, it executes the transfer
action from the eosio.token
contract using the INLINE_ACTION_SENDER
to buy ram:
This is the code:
if( payer != N(eosio) ) {
INLINE_ACTION_SENDER(eosio::token, transfer)( N(eosio.token), {payer,N(active)},
{ payer, N(eosio), quant, std::string("buy ram") } );
}