raydium-io / raydium-cp-swap

Revamped constant product AMM - no Openbook ID requirement, Token22 support
Apache License 2.0
66 stars 45 forks source link

Support for disabled transfer hook extension #16

Open DavidCurca opened 2 months ago

DavidCurca commented 2 months ago

You can disable the transfer hook extension by setting its programId to None. This should cause any subsequent transfers to ignore it. However, the Raydium CPAMM implementation only checks for the existence of extensions other than the permitted ones, without considering that extensions with programId set to None are ignored by the SPL token program.

The relevant code can be found in the is_supported_mint method: Raydium CPAMM token.rs Line 176

Proposed Solution: Update the is_supported_mint method to account for extensions with programId set to None, aligning its behavior with the SPL token program's handling of such cases.