I am transferring custom token using our Smart contract by invoking Token program and pass transfer parameters in it.
there is 50M token balance in source and 20M token balance in destination Token account.
Now i m facing problem that , if send 0 Amount token transaction will be successfully complete but if i transfer 1 token it show Insufficient Balance.
Error:-
‘Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]’,
‘Program log: Instruction: Transfer’,
‘Program log: Error: insufficient funds’,
‘Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2263 of 198155 compute units’,
‘Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA failed: custom program error: 0x1’,
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Token_TokenInstruction token_transfer;
token_transfer.transfer.amount= AMOUNT;
token_transfer.tag=Token_TokenInstruction_Transfer;
AccountMeta transfer_metas[]={
/*Pubkey //Writable //Singer*/
{&from_Wallet.pubkey(), true, false},
{&to_Wallet.pubkey(), true, false},
{&Owner_Wallet.pubkey(), true, true},
{&Owner_Wallet.pubkey(), true, true}
};
/*
token program key
from key
to_Wallet
Owner_wallet
Owner_wallet
*/
const Instruction token_transfer_inst(Fame_Token.owner(),transfer_metas,token_transfer);
if (invoke(token_transfer_inst, accounts) != SUCCESS) {
log("ERROR: Could not allocate space.");
sol_panic();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
i need help in this issue.