solana spl-token transfer fee "Error: Program(IncorrectProgramId)"

348 Views Asked by At

I want to create my own Solana token that takes %2 fee to all transactions and total supply should be 100k token. That's why i used spl-token cli for this spl-token create-token --transfer-fee 50 1000, however after executing this command i get an error like

Error: Program(IncorrectProgramId)

How can i fix this error or how can i create my own token with transaction fee.

1

There are 1 best solutions below

0
On

When creating a new token with transfer fees, you must specify the program id as the token-2022 program id of TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb, so instead, do:

spl-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb create-token --transfer-fee 50 1000