Skip to content

Commit

Permalink
feat: no unencrypted logs in private functions
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Aug 24, 2023
1 parent ecf6df2 commit 440f1a2
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ contract EasyPrivateToken {
abi,
abi::PrivateContextInputs,
context::PrivateContext,
log::emit_unencrypted_log,
note::{
note_header::NoteHeader,
utils as note_utils,
Expand All @@ -39,8 +38,6 @@ contract EasyPrivateToken {

balances.at(owner).add(&mut context, initial_supply, owner);

emit_unencrypted_log(&mut context, "Balance set in constructor");

// Return private circuit public inputs. All private functions need to return this as it is part of the input of the private kernel.
context.finish()
}
Expand All @@ -60,8 +57,6 @@ contract EasyPrivateToken {

balances.at(owner).add(&mut context, amount, owner);

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..
context.finish()
}
Expand All @@ -83,8 +78,6 @@ contract EasyPrivateToken {
balances.at(sender).sub(&mut context, amount, sender);

balances.at(recipient).add(&mut context, amount, recipient);

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..
context.finish()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ contract Lending {
PrivateContext,
PublicContext
};
use dep::aztec::oracle::{logs::emit_unencrypted_log};
use dep::aztec::public_call_stack_item::PublicCallStackItem;
use crate::storage::{Storage, Asset};
use crate::safe_math::SafeU120;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ contract PrivateTokenAirdrop {
let owner_balance = storage.balances.at(owner);
if (initial_supply != 0) {
send_note(&mut context, owner_balance, initial_supply, owner);
emit_unencrypted_log(&mut context, "Balance set in constructor");
}

// Return private circuit public inputs. All private functions need to return this as it is part of the input of the private kernel.
Expand All @@ -60,7 +59,6 @@ contract PrivateTokenAirdrop {
// Insert new note to a set of user notes and emit the newly created encrypted note preimage via oracle call.
let owner_balance = storage.balances.at(owner);
send_note(&mut context, owner_balance, amount, owner);
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..
context.finish()
Expand All @@ -86,8 +84,6 @@ contract PrivateTokenAirdrop {
// Creates new note for the recipient.
let recipient_balance = storage.balances.at(recipient);
send_note(&mut context, recipient_balance, amount, recipient);

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..
context.finish()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ contract PrivateToken {
note_header::NoteHeader,
utils as note_utils,
};
use dep::aztec::log::emit_unencrypted_log;

// docs:start:storage-import
use crate::storage::Storage;
Expand All @@ -38,7 +37,6 @@ contract PrivateToken {
let owner_balance = storage.balances.at(owner);
if (initial_supply != 0) {
send_note(&mut context, owner_balance, initial_supply, owner);
emit_unencrypted_log(&mut context, "Balance set in constructor");
}

// Return private circuit public inputs. All private functions need to return this as it is part of the input of the private kernel.
Expand All @@ -62,7 +60,6 @@ contract PrivateToken {
// Insert new note to a set of user notes and emit the newly created encrypted note preimage via oracle call.
let owner_balance = storage.balances.at(owner);
send_note(&mut context, owner_balance, amount, owner);
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..
context.finish()
Expand Down Expand Up @@ -90,8 +87,6 @@ contract PrivateToken {
// Creates new note for the recipient.
let recipient_balance = storage.balances.at(recipient);
send_note(&mut context, recipient_balance, amount, recipient);

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..
context.finish()
Expand Down

0 comments on commit 440f1a2

Please sign in to comment.