2

It is possible to create a custom SPL-token and disabling the trade and send capabilities for the user (not for the SPL-token authority)? The idea is to create a token that can only be purchased and spent within our specific application and at the same time maintain all the benefits of an SPL-token. Is it possible to do this, or do you know any alternative that I can use?

Thanks in advance :)

2 Answers 2

1

If you want to manage the tokens entirely, you can go with the managed-token approach, which keeps the token frozen at all times, and must pass through your program, which thaws, does something (burn / transfer / etc), and re-freezes the account.

You can find the source code for a reference implementation at https://github.com/solana-labs/solana-program-library/tree/master/managed-token/program

0

I think it's only a way to build a new program, which will hold the SPL-token owned by the PDA derived from the program. You can add the specific instructions by your own business logic, like deposit/withdraw/send etc. For UX, furthermore, you'll be developing application-specific wallet to display the balance and drive the user's actions.

3
  • Thanks for the idea, but I need it to meet SPL-token standards so I can use it in other programs. Do you know if there is any way to modify the SPL-token source code?
    – cris.sol
    Commented Nov 30, 2022 at 13:07
  • Of course, you can modify the SPL-token program on your own. But one thing you should make sure is the program existing on chain. You must deploy the customized SPL-token program with new program id.
    – freezy.gem
    Commented Nov 30, 2022 at 16:06
  • And if I do that, the tokens created with my custom SPL-token will be compatible with programs that use SPL-token (for example with the anchor_spl::token library).
    – cris.sol
    Commented Nov 30, 2022 at 17:13

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.