1

I have developed a simple transfer hook program that I will be using as a token extension for a mint account I own. In the future, I will need to remove this token extension. The only method I currently know is using the spl-token CLI:

spl-token set-transfer-hook <mint_address> --disable

This command sets the programId of the transfer hook extension to None. However, this solution is not sufficient for my use case because the tools I use (e.g., Raydium CPAMM) expect the transfer hook field to be completely absent.

As stated in the SPL Token Guide:

Extension data is written after the end of the Account in Token, which is the byte at index 165.

To address this, I attempted to manipulate the data stored in the mint account. However, I encountered an issue: I couldn't update the data using the system program because the account is owned by the SPL 2022 Token Program. Additionally, I have not found any instructions within the SPL 2022 Token Program that allow for completely removing a token extension or directly manipulating the account data.

My Question: Is there a way to completely remove the transfer hook extension from the mint account, such that the field is entirely absent and not just disabled?

1 Answer 1

1

Once an extension is added to a mint, it's impossible to completely remove its data from the account.

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.