2

I'm looking to make a basic solana program with just some slight modifications from the spl token program.

Is there an example of importing the spl program and then adding a function?

1 Answer 1

1

SPL-Token is a program that is currently used as the token standard on Solana. In order to add additional functionality to the program, you have to either:

  1. Extend the token program and wrap the existing instructions with your program's instructions, adding additional functionality
  2. Use a new program to manage a PDA built off of the token account and add additional functionality(This is what Metaplex does with NFTs)

You can find an example of wrapping some of the existing SPL-Token instructions with another program in these program examples.

It all depends on the functionality you want to add.

There is an upcoming token22 standard that allows extensions to be added, but the functionality is still set to a few different extensions. The preferred way to add functionality is still listed in the 2 options above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.