DEV Community

Cover image for I Built a Token of Which I Have Full Control
Carlos Prada
Carlos Prada

Posted on

I Built a Token of Which I Have Full Control

What Is This About?

Recently I was doing the #100DaysOfSolana challenge and I created a token that has a permanent delegate account.

What is that, you might ask?

As the Solana Token Extensions paper describes it: "Allows specifying a permanent account delegate for a mint. This delegate has unlimited delegate privileges over any account for that mint, which means that it can burn or transfer any amount of tokens."

This means the account that is a permanent delegate has full control over that token (transfer and burn) without the approval of the owner's account.

Is It Hard to Create?

Nope. Here is how you can do it if you have the Solana CLI installed:

spl-token create-token --enable-permanent-delegate --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
Enter fullscreen mode Exit fullscreen mode
  • spl-token is part of the Solana CLI
  • create-token is the command that initiates the token creation
  • --enable-permanent-delegate is the flag that activates the Token Extension on the token
  • --program-id specifies the Token-2022 Program to create your token (if the flag is not passed, the token will be initiated with another token program that does not support extensions) That's it — your token is live. You can give it to people, seize it, or even burn it without any approval other than yours.

Pros

  • Good for companies that wish to have full control and must seize assets if legal infringements have been made.

Cons

  • The token is really not yours. Even if it is in your wallet, someone else can do whatever they want with it. And that's scary. ## How Can You Check If a Token Has a Permanent Delegate?

Go to the Solana Explorer and search the mint address of the token you want to look up. You will see a Token Extensions row at the bottom. If it says Permanent Delegate, your token is in your wallet — but it can also be transferred or burned by another account: the permanent delegate account.

As you can see in the picture below:

Solana Explorer Search Result

So next time you transact with tokens, don't forget to look for what extensions it has — it might be some useful information for you. Here is the Token-2022 Extension Guide if you want to do your own research.

See you soon for more posts about my developer journey!

Top comments (0)