Search code examples
solanasolana-cli

Is there any way to change the authority of a Solana Token?


I created a Solana token with a test wallet/account. Now I want to transfer authority to another account and delete the test one. Is there any way to do that?


Solution

  • You can do that through spl-token authorize on the CLI, or the SetAuthority() instruction

    Note that it is an antipattern to transfer the ownership of an Associated Token Account.

    In that case, the best practice is to create an associated token account for the recipient's wallet, transfer the tokens, and then close the first account.