diff --git a/noir-projects/aztec-nr/aztec/src/prelude.nr b/noir-projects/aztec-nr/aztec/src/prelude.nr index 08177f65e7d..8a9809fa2b1 100644 --- a/noir-projects/aztec-nr/aztec/src/prelude.nr +++ b/noir-projects/aztec-nr/aztec/src/prelude.nr @@ -7,7 +7,7 @@ use crate::{ state_vars::{ map::Map, private_immutable::PrivateImmutable, private_mutable::PrivateMutable, public_immutable::PublicImmutable, public_mutable::PublicMutable, private_set::PrivateSet, - shared_immutable::SharedImmutable, storage::Storable + shared_immutable::SharedImmutable, shared_mutable::SharedMutable, storage::Storable }, log::emit_encrypted_log, context::{PrivateContext, PackedReturns, FunctionReturns}, note::{ diff --git a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr index c34e93a13cf..d5d232aa535 100644 --- a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr @@ -10,19 +10,17 @@ mod types; contract TokenBlacklist { // Libs - - use dep::aztec::protocol_types::{abis::function_selector::FunctionSelector, address::AztecAddress}; use dep::aztec::{ - note::{note_getter_options::NoteGetterOptions, note_header::NoteHeader}, - hash::compute_note_secret_hash, - state_vars::{Map, PublicMutable, PrivateSet, SharedMutable, SharedImmutable} + hash::poseidon2_hash, + prelude::{AztecAddress, FunctionSelector, Map, NoteGetterOptions, PrivateSet, PublicMutable, SharedMutable} }; - use dep::field_note::field_note::FieldNote; - use dep::authwit::{auth::{assert_current_call_valid_authwit, assert_current_call_valid_authwit_public}}; - use crate::types::{transparent_note::TransparentNote, token_note::TokenNote, balances_map::BalancesMap, roles::UserFlags}; + use crate::types::{ + transparent_note::{TransparentNote, GENERATOR_INDEX__TRANSPARENT_NOTE}, token_note::TokenNote, + balances_map::BalancesMap, roles::UserFlags + }; // Changing an address' roles has a certain block delay before it goes into effect. global CHANGE_ROLES_DELAY_BLOCKS = 5; @@ -154,7 +152,7 @@ contract TokenBlacklist { assert(!to_roles.is_blacklisted, "Blacklisted: Recipient"); let pending_shields = storage.pending_shields; - let secret_hash = compute_note_secret_hash(secret); + let secret_hash = poseidon2_hash([secret, GENERATOR_INDEX__TRANSPARENT_NOTE]); // Get 1 note (set_limit(1)) which has amount stored in field with index 0 (select(0, amount)) and secret_hash // stored in field with index 1 (select(1, secret_hash)). let mut options = NoteGetterOptions::new(); @@ -257,4 +255,4 @@ contract TokenBlacklist { unconstrained fn balance_of_public(owner: AztecAddress) -> pub Field { storage.public_balances.at(owner).read().to_field() } -} \ No newline at end of file +}