diff --git a/yarn-project/noir-contracts/src/contracts/easy_private_token_contract/src/main.nr b/yarn-project/noir-contracts/src/contracts/easy_private_token_contract/src/main.nr index 8cb31d8e9350..b0e48aa156a2 100644 --- a/yarn-project/noir-contracts/src/contracts/easy_private_token_contract/src/main.nr +++ b/yarn-project/noir-contracts/src/contracts/easy_private_token_contract/src/main.nr @@ -14,7 +14,6 @@ contract EasyPrivateToken { abi, abi::PrivateContextInputs, context::PrivateContext, - log::emit_unencrypted_log, note::{ note_header::NoteHeader, utils as note_utils, diff --git a/yarn-project/noir-contracts/src/contracts/example_public_state_increment_BROKE/src/main.nr b/yarn-project/noir-contracts/src/contracts/example_public_state_increment_BROKE/src/main.nr index 0ec68fbb492f..719f664004ec 100644 --- a/yarn-project/noir-contracts/src/contracts/example_public_state_increment_BROKE/src/main.nr +++ b/yarn-project/noir-contracts/src/contracts/example_public_state_increment_BROKE/src/main.nr @@ -8,7 +8,6 @@ contract ExamplePublicStateIncrement { PrivateContext, PublicContext, }; - use dep::aztec::oracle::logs::emit_unencrypted_log; use dep::aztec::types::point::Point; use crate::storage::Storage; use dep::aztec::state_vars::{ diff --git a/yarn-project/noir-contracts/src/contracts/lending_contract/src/main.nr b/yarn-project/noir-contracts/src/contracts/lending_contract/src/main.nr index 516f2b094a1c..409e2300a5a8 100644 --- a/yarn-project/noir-contracts/src/contracts/lending_contract/src/main.nr +++ b/yarn-project/noir-contracts/src/contracts/lending_contract/src/main.nr @@ -12,7 +12,6 @@ contract Lending { PublicContext }; use dep::aztec::oracle::{ - logs::emit_unencrypted_log, create_nullifier::create_nullifier, }; use dep::aztec::public_call_stack_item::PublicCallStackItem; diff --git a/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/src/main.nr b/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/src/main.nr index e990a007bc11..ac4f337d18ba 100644 --- a/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/src/main.nr +++ b/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/src/main.nr @@ -16,7 +16,6 @@ contract PrivateTokenAirdrop { note_header::NoteHeader, utils as note_utils, }; - use dep::aztec::log::emit_unencrypted_log; use crate::storage::Storage; use crate::claim_note::{ClaimNote, ClaimNoteMethods}; diff --git a/yarn-project/noir-contracts/src/contracts/private_token_contract/src/main.nr b/yarn-project/noir-contracts/src/contracts/private_token_contract/src/main.nr index defd5c4df118..02809619a487 100644 --- a/yarn-project/noir-contracts/src/contracts/private_token_contract/src/main.nr +++ b/yarn-project/noir-contracts/src/contracts/private_token_contract/src/main.nr @@ -40,6 +40,7 @@ contract PrivateToken { send_note(&mut context, owner_balance, initial_supply, owner); // TODO(1757) Remove this for public release. + // Private functions must not emit unencrypted logs to avoid leaking any information. emit_unencrypted_log(&mut context, "Balance set in constructor"); } @@ -66,6 +67,7 @@ contract PrivateToken { send_note(&mut context, owner_balance, amount, owner); // TODO(1757) Remove this for public release. + // Private functions must not emit unencrypted logs to avoid leaking any information. emit_unencrypted_log(&mut context, "Coins minted"); // Return private circuit public inputs. All private functions need to return this as it is part of the input of the private kernel.. @@ -96,6 +98,7 @@ contract PrivateToken { send_note(&mut context, recipient_balance, amount, recipient); // TODO(1757) Remove this for public release. + // Private functions must not emit unencrypted logs to avoid leaking any information. emit_unencrypted_log(&mut context, "Coins transferred"); // Return private circuit public inputs. All private functions need to return this as it is part of the input of the private kernel.. diff --git a/yarn-project/noir-libs/noir-aztec/src/oracle/logs.nr b/yarn-project/noir-libs/noir-aztec/src/oracle/logs.nr index 49d9082b48df..956c614a419a 100644 --- a/yarn-project/noir-libs/noir-aztec/src/oracle/logs.nr +++ b/yarn-project/noir-libs/noir-aztec/src/oracle/logs.nr @@ -27,6 +27,7 @@ unconstrained fn emit_encrypted_log( #[oracle(emitUnencryptedLog)] fn emit_unencrypted_log_oracle(_message: T) -> Field {} +// WARNING: Do not use emit_unencrypted_log in private functions to avoid leaking any information. unconstrained fn emit_unencrypted_log(message: T) -> [Field; NUM_FIELDS_PER_SHA256] { // https://github.com/AztecProtocol/aztec-packages/issues/885 [emit_unencrypted_log_oracle(message), 0]