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 1


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") } );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.