I'd like to make custom token program which just proxies all transaction to TOKEN_PROGRAM. I've made custom TOKEN_PROGRAM and ASSOCIATIED_TOKEN_PROGRAM, and what I'm trying to achieve is to make that token_program to invoke existing TOKEN_PROGRAM.

For instance, When I try to invoke token program for transfer, It just simply invokes existing TOKEN_PROGRAM to transfer.

This is what I tried:

                let account_info_iter = &mut accounts.iter();

                let source_account_info = next_account_info(account_info_iter)?;
                let test1 = source_account_info.clone();
                let destination_account_info = next_account_info(account_info_iter)?;
                let test2 = destination_account_info.clone();
                let authority_info = next_account_info(account_info_iter)?;
                let transfer_tokens_instruction = transfer(
                let required_accounts_for_transfer = [

But it just simply don't work. How do I invoke token program? is there any source I can see?

  • please update the question to elaborate what "simply don't work". surely there's an error message of some kind
    – trent.sol
    Commented Aug 18, 2022 at 6:39

2 Answers 2


Use the anchor_spl crate.

This source code uses that crate to accomplish exactly what I believe you're trying to do, hope it helps you:



check this detailed and very helpful article on Cross Program Invocation.


  • this is effectively a url-only answer. improve it by discussing the content of the link sufficiently to answer the the question
    – trent.sol
    Commented Aug 18, 2022 at 6:27

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.