diff --git a/token/program-2022/Cargo.toml b/token/program-2022/Cargo.toml index e3a1f3d73bf..2ec395801e3 100644 --- a/token/program-2022/Cargo.toml +++ b/token/program-2022/Cargo.toml @@ -12,11 +12,13 @@ exclude = ["js/**"] no-entrypoint = [] test-sbf = [] serde-traits = ["dep:serde", "dep:serde_with", "dep:base64", "spl-pod/serde-traits"] -default = ["token-group", "zk-ops"] +default = ["confidential-hook", "token-group", "zk-ops"] # Remove this feature once the underlying syscalls are released on all networks zk-ops = [] # Remove this feature once the token group implementation has been audited token-group = [] +# Remove this feature once the confidential transfer hook has been audited +confidential-hook = [] [dependencies] arrayref = "0.3.7" diff --git a/token/program-2022/src/extension/confidential_transfer/processor.rs b/token/program-2022/src/extension/confidential_transfer/processor.rs index 853201cf06a..13e63bf5566 100644 --- a/token/program-2022/src/extension/confidential_transfer/processor.rs +++ b/token/program-2022/src/extension/confidential_transfer/processor.rs @@ -1,4 +1,6 @@ // Remove feature once zk ops syscalls are enabled on all networks +#[cfg(feature = "confidential-hook")] +use crate::extension::transfer_hook; #[cfg(feature = "zk-ops")] use { crate::extension::non_transferable::NonTransferable, @@ -16,7 +18,7 @@ use { }, memo_transfer::{check_previous_sibling_instruction_is_memo, memo_required}, transfer_fee::TransferFeeConfig, - transfer_hook, BaseStateWithExtensions, StateWithExtensions, StateWithExtensionsMut, + BaseStateWithExtensions, StateWithExtensions, StateWithExtensionsMut, }, instruction::{decode_instruction_data, decode_instruction_type}, processor::Processor, @@ -625,6 +627,7 @@ fn process_transfer( authority_info }; + #[cfg(feature = "confidential-hook")] if let Some(program_id) = transfer_hook::get_program_id(&mint) { // set transferring flags, scope the borrow to avoid double-borrow during CPI {