Skip to content

Commit

Permalink
Featurize "confidential-hook"
Browse files Browse the repository at this point in the history
  • Loading branch information
joncinque committed Jan 10, 2024
1 parent 0055451 commit dc28301
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion token/program-2022/Cargo.toml
Expand Up @@ -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"
Expand Down
@@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit dc28301

Please sign in to comment.