diff --git a/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_event_emission.nr b/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_event_emission.nr index 7e725163749f..b3334c37c8fe 100644 --- a/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_event_emission.nr +++ b/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_event_emission.nr @@ -1,8 +1,7 @@ use crate::{ context::PrivateContext, event::event_interface::EventInterface, encrypted_logs::payload::compute_encrypted_event_log, keys::getters::get_current_public_keys, - oracle::logs_traits::LensForEncryptedEvent, - oracle::unsafe_rand::unsafe_rand + oracle::logs_traits::LensForEncryptedEvent, oracle::unsafe_rand::unsafe_rand }; use dep::protocol_types::{address::AztecAddress, point::Point, hash::sha256_to_field}; diff --git a/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_note_emission.nr b/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_note_emission.nr index 5a3be0007bb0..db51b1bb5bd4 100644 --- a/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_note_emission.nr +++ b/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_note_emission.nr @@ -1,7 +1,7 @@ use crate::{ context::PrivateContext, note::{note_emission::NoteEmission, note_interface::NoteInterface}, - keys::getters::get_current_public_keys, - encrypted_logs::payload::compute_encrypted_note_log, oracle::logs_traits::LensForEncryptedLog + keys::getters::get_current_public_keys, encrypted_logs::payload::compute_encrypted_note_log, + oracle::logs_traits::LensForEncryptedLog }; use dep::protocol_types::{ hash::sha256_to_field, address::AztecAddress, point::Point, abis::note_hash::NoteHash, diff --git a/noir-projects/aztec-nr/easy-private-state/src/easy_private_uint.nr b/noir-projects/aztec-nr/easy-private-state/src/easy_private_uint.nr index 666fbe0eca36..780dd75d46dd 100644 --- a/noir-projects/aztec-nr/easy-private-state/src/easy_private_uint.nr +++ b/noir-projects/aztec-nr/easy-private-state/src/easy_private_uint.nr @@ -2,7 +2,7 @@ use dep::aztec::{ context::PrivateContext, protocol_types::{address::AztecAddress}, note::note_getter_options::NoteGetterOptions, state_vars::PrivateSet, encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, - keys::getters::get_current_public_keys, + keys::getters::get_current_public_keys }; use dep::value_note::{filter::filter_notes_min_sum, value_note::ValueNote}; diff --git a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr index df7481804634..63d92871eef1 100644 --- a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr @@ -10,8 +10,7 @@ contract AppSubscription { SharedImmutable }, encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, - keys::getters::get_current_public_keys, - protocol_types::constants::MAX_FIELD_VALUE + keys::getters::get_current_public_keys, protocol_types::constants::MAX_FIELD_VALUE }; use authwit::{auth_witness::get_auth_witness, auth::assert_current_call_valid_authwit}; use token::Token; diff --git a/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr b/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr index ac590beb7e69..69e87d9cdafd 100644 --- a/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr +++ b/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr @@ -3,8 +3,9 @@ use dep::aztec::prelude::{AztecAddress, FunctionSelector, PrivateContext, NoteHe use dep::aztec::{ context::UnconstrainedContext, protocol_types::{traits::{ToField, Serialize, FromField}, constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL}, - encrypted_logs::encrypted_note_emission::encode_and_encrypt_note_with_keys, keys::getters::get_current_public_keys, - note::note_getter::view_notes, state_vars::PrivateSet, note::constants::MAX_NOTES_PER_PAGE + encrypted_logs::encrypted_note_emission::encode_and_encrypt_note_with_keys, + keys::getters::get_current_public_keys, note::note_getter::view_notes, state_vars::PrivateSet, + note::constants::MAX_NOTES_PER_PAGE }; use dep::value_note::{value_note::{ValueNote, VALUE_NOTE_LEN}}; diff --git a/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr b/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr index ca2ad7394534..1bb4a1c53979 100644 --- a/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr @@ -207,7 +207,7 @@ contract DocsExample { #[aztec(private)] fn insert_note(amount: u8, randomness: Field) { let sender_npk_m_hash = get_current_public_keys(&mut context, context.msg_sender()).npk_m.hash(); - + let mut note = CardNote::new(amount, randomness, sender_npk_m_hash); storage.set.insert(&mut note).emit(encode_and_encrypt_note(&mut context, context.msg_sender(), context.msg_sender())); } diff --git a/noir-projects/noir-contracts/contracts/pending_note_hashes_contract/src/main.nr b/noir-projects/noir-contracts/contracts/pending_note_hashes_contract/src/main.nr index 3f7e5a116d3c..da8e23d4b760 100644 --- a/noir-projects/noir-contracts/contracts/pending_note_hashes_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/pending_note_hashes_contract/src/main.nr @@ -334,7 +334,7 @@ contract PendingNoteHashes { let owner_npk_m_hash = owner_keys.npk_m.hash(); let owner_ivpk_m = owner_keys.ivpk_m; let outgoing_viewer_ovpk_m = get_current_public_keys(&mut context, outgoing_viewer).ovpk_m; - + let mut good_note = ValueNote::new(10, owner_npk_m_hash); // Insert good note with real log owner_balance.insert(&mut good_note).emit(encode_and_encrypt_note(&mut context, outgoing_viewer, owner)); diff --git a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr index 3e4d754c768d..c6c0c4b9a314 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr @@ -11,10 +11,7 @@ contract SchnorrAccount { entrypoint::{app::AppPayload, fee::FeePayload}, account::AccountActions, auth_witness::get_auth_witness, auth::{compute_authwit_nullifier, compute_authwit_message_hash} }; - use dep::aztec::{ - hash::compute_siloed_nullifier, - keys::getters::get_current_public_keys - }; + use dep::aztec::{hash::compute_siloed_nullifier, keys::getters::get_current_public_keys}; use dep::aztec::oracle::get_nullifier_membership_witness::get_low_nullifier_membership_witness; use crate::public_key_note::{PublicKeyNote, PUBLIC_KEY_NOTE_LEN}; diff --git a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr index 1831a2086036..8220c47beecb 100644 --- a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr @@ -65,7 +65,7 @@ contract Test { #[aztec(private)] fn get_master_incoming_viewing_public_key(address: AztecAddress) -> [Field; 2] { let ivpk_m = get_current_public_keys(&mut context, address).ivpk_m; - + [ivpk_m.x, ivpk_m.y] } diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_contract/src/main.nr index 9b22de8e46bc..3ad201cf241e 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/main.nr @@ -25,7 +25,7 @@ contract Token { }, encrypted_event_emission::{encode_and_encrypt_event, encode_and_encrypt_event_with_keys_unconstrained} }, - keys::getters::get_current_public_keys, + keys::getters::get_current_public_keys }; // docs:start:import_authwit @@ -335,7 +335,7 @@ contract Token { #[aztec(private)] fn transfer(to: AztecAddress, amount: Field) { let from = context.msg_sender(); - + let from_keys = get_current_public_keys(&mut context, from); let to_keys = get_current_public_keys(&mut context, to); @@ -355,15 +355,21 @@ contract Token { INITIAL_TRANSFER_CALL_MAX_NOTES ); - storage.balances.add(from, change).emit(encode_and_encrypt_note_with_keys_unconstrained(&mut context, from_keys.ivpk_m, from_keys.ovpk_m, from)); + storage.balances.add(from, change).emit( + encode_and_encrypt_note_with_keys_unconstrained(&mut context, from_keys.ivpk_m, from_keys.ovpk_m, from) + ); - storage.balances.add(to, amount).emit(encode_and_encrypt_note_with_keys_unconstrained(&mut context, from_keys.ivpk_m, to_keys.ivpk_m, to)); + storage.balances.add(to, amount).emit( + encode_and_encrypt_note_with_keys_unconstrained(&mut context, from_keys.ivpk_m, to_keys.ivpk_m, to) + ); // We don't constrain encryption of the note log in `transfer` (unlike in `transfer_from`) because the transfer // function is only designed to be used in situations where the event is not strictly necessary (e.g. payment to // another person where the payment is considered to be successful when the other party successfully decrypts a // note). - Transfer { from, to, amount: amount.to_field() }.emit(encode_and_encrypt_event_with_keys_unconstrained(&mut context, from_keys.ivpk_m, to_keys.ivpk_m, to)); + Transfer { from, to, amount: amount.to_field() }.emit( + encode_and_encrypt_event_with_keys_unconstrained(&mut context, from_keys.ivpk_m, to_keys.ivpk_m, to) + ); } // docs:end:transfer @@ -443,7 +449,7 @@ contract Token { assert(nonce == 0, "invalid nonce"); } // docs:end:assert_current_call_valid_authwit - + let from_keys = get_current_public_keys(&mut context, from); let to_keys = get_current_public_keys(&mut context, to); diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr b/noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr index 2c29b697143f..81bf1d4f4113 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr @@ -4,7 +4,7 @@ use dep::aztec::{ protocol_types::constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, note::{ note_getter::view_notes, note_getter_options::SortOrder, - note_emission::{NoteEmission, OuterNoteEmission}, + note_emission::{NoteEmission, OuterNoteEmission} }, keys::getters::get_current_public_keys }; diff --git a/noir-projects/noir-contracts/contracts/token_with_refunds_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_with_refunds_contract/src/main.nr index aeb582ad4806..e56d4f73623a 100644 --- a/noir-projects/noir-contracts/contracts/token_with_refunds_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_with_refunds_contract/src/main.nr @@ -331,7 +331,7 @@ contract TokenWithRefunds { #[aztec(private)] fn transfer(to: AztecAddress, amount: Field) { let from = context.msg_sender(); - + let from_keys = get_current_public_keys(&mut context, from); let to_keys = get_current_public_keys(&mut context, to); @@ -351,15 +351,21 @@ contract TokenWithRefunds { INITIAL_TRANSFER_CALL_MAX_NOTES ); - storage.balances.add(from, change).emit(encode_and_encrypt_note_with_keys_unconstrained(&mut context, from_keys.ovpk_m, from_keys.ivpk_m, from)); + storage.balances.add(from, change).emit( + encode_and_encrypt_note_with_keys_unconstrained(&mut context, from_keys.ovpk_m, from_keys.ivpk_m, from) + ); - storage.balances.add(to, amount).emit(encode_and_encrypt_note_with_keys_unconstrained(&mut context, from_keys.ovpk_m, to_keys.ivpk_m, to)); + storage.balances.add(to, amount).emit( + encode_and_encrypt_note_with_keys_unconstrained(&mut context, from_keys.ovpk_m, to_keys.ivpk_m, to) + ); // We don't constrain encryption of the note log in `transfer` (unlike in `transfer_from`) because the transfer // function is only designed to be used in situations where the event is not strictly necessary (e.g. payment to // another person where the payment is considered to be successful when the other party successfully decrypts a // note). - Transfer2 { from, to, amount: amount.to_field() }.emit(encode_and_encrypt_event_with_keys_unconstrained(&mut context, from_keys.ovpk_m, to_keys.ivpk_m, to)); + Transfer2 { from, to, amount: amount.to_field() }.emit( + encode_and_encrypt_event_with_keys_unconstrained(&mut context, from_keys.ovpk_m, to_keys.ivpk_m, to) + ); } // docs:end:transfer @@ -439,7 +445,7 @@ contract TokenWithRefunds { assert(nonce == 0, "invalid nonce"); } // docs:end:assert_current_call_valid_authwit - + let from_keys = get_current_public_keys(&mut context, from); let to_keys = get_current_public_keys(&mut context, to); @@ -545,7 +551,9 @@ contract TokenWithRefunds { U128::from_integer(funded_amount), INITIAL_TRANSFER_CALL_MAX_NOTES ); - storage.balances.add(user, change).emit(encode_and_encrypt_note_with_keys_unconstrained(&mut context, user_keys.ovpk_m, user_keys.ivpk_m, user)); + storage.balances.add(user, change).emit( + encode_and_encrypt_note_with_keys_unconstrained(&mut context, user_keys.ovpk_m, user_keys.ivpk_m, user) + ); // 4. We create the partial notes for the fee payer and the user. // --> Called "partial" because they don't have the amount set yet (that will be done in `complete_refund(...)`).