Sebastian Scholl
Sebastian Scholl

Reputation: 1105

Error: "Could not find token account XXXXXXXXXXXXXXXXXXXX" after using spl-token create-account

After following these steps, I receive the error "Error: "Could not find token account ___" when trying to mint or transfer tokens to a recipient.

  1. Creating keypairs:
solana-keygen new -o .sender
solana-keygen new -o .recipient
solana-keygen new -o .master
  1. Fund the account:
solana airdrop 1 <MASTER_ADDRESS>
  1. Creating token:
spl-token create-token --decimals 6 --fee-payer .master --mint-authority .master .master
  1. Create token account:
spl-token create-account <TOKEN_MINT_ADDRESS> .master --fee-payer .master --owner .sender
  1. Mint tokens to account:
spl-token mint <TOKEN_MINT_ADDRESS> 100 --mint-authority .master -- <SENDER_TOKEN_ACCOUNT_ADDRESS>

The error I then receive is:

Error: "Account <SENDER_TOKEN_ACCOUNT_ADDRESS> not found"

Meanwhile, after performing these steps, the following commands return the details below:

$ spl-token create-account <TOKEN_MINT_ADDRESS> .master --fee-payer .master --owner .sender
=> Creating account <SENDER_TOKEN_ACCOUNT_ADDRESS>
Error: "Error: Account already exists: <SENDER_TOKEN_ACCOUNT_ADDRESS>"

$ spl-token address --token <TOKEN_MINT_ADDRESS> --owner <SENDER_ADDRESS>  --verbose
=> Wallet address: <SENDER_ADDRESS>
Associated token address: <SENDER_TOKEN_ACCOUNT_ADDRESS>

So the system is consistently and properly deriving the correct address, though then when I attempt to make a transfer or read the balance it returns the not found error.

Can someone help me understand why this error is being received, and how I can correct it?

Upvotes: 0

Views: 4559

Answers (0)

Related Questions