2

I encountered an error while attempting to change the mint authority. Currently, the mint authority is the same as my token address. I intend to change it to null or according to the wallet address. However, when I ran the script, I received a "signature verification failed" error.

TokenAddress: FS32hKLJVEN9NoaGvS4NpumuwcrDkmJ5Mt5CYyiXfdxj Authority: FS32hKLJVEN9NoaGvS4NpumuwcrDkmJ5Mt5CYyiXfdxj

 const transactionSignature = await setAuthority(
        connection,   //connection
        userWallet,   // wallet Address
        mintPubkey,   //tokenMintAddress
        mintPubkey, // current authority
        AuthorityType.MintTokens,
        null //new authority
    )

1 Answer 1

3

The current authority has to be included as a signer.

You're specifying that the mintPubkey is also the current mint authority on the mint account. This means you would need to have the keypair that was used to create the mint account and include it as a signer.

If the mint address is a PDA, then you would need to add an instruction to your program invoking the setAuthority instruction via a CPI and sign using the PDA.

2
  • Hi John, Thanks for reply. The mint authority is the token address. As you mentioned, the mint authority should act as the signer. However, I created the token address as a keypair, and I don't have their keypair. Is there a way to acquire this or any function that can be used as a signer?"
    – Maidi
    Jan 3 at 10:12
  • If you don't have the access to the keypair anymore, then there is nothing that can be done unfortunately. Look around to see if it's stored in your filesystem or in some logs somewhere, because otherwise it isn't possible to recover.
    – Jon C
    Jan 10 at 0:04

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.