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?