How to freeze an SPL token?

4.4k Views Asked by At

so confused with the spl token docs here - https://spl.solana.com/token. Can someone tell me if it's possible, using the js lib - to create a spl token (specifying minter and freezer authorities), then mint some tokens to a token account and finally FREEZE the token itself so that no more can be created. But still allow the existing supply to be moved around from token account to token account etc

1

There are 1 best solutions below

1
On

It is possible. you may not need freeze. freezing is per accociated token account, not the actual token. the example is freeze some address who hold 100 x token so it cant add or transfer x token anywhere anymore.

You can cap the supply by disable mint, running command below (CLI):

spl-token authorize [base58 token address] mint --disable.

only the authorized user can do it (the token creator or dev itself). after mint disabled no more token can be created (minted) but still allow existing supply to be moved around.

It use same instruction to cap the supply like how NFT is capped at 1 supply and cant be minted anymore. check JS implementation on the docs, its quite well documented https://spl.solana.com/token#example-create-a-non-fungible-token