Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AztecProtocol/aztec-packages
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c5af4234e187dafb7b06bee55bcc335e286011fc
Choose a base ref
..
head repository: AztecProtocol/aztec-packages
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 587fc939007ea49b8eb9069e2dc857d4704556ae
Choose a head ref
56 changes: 0 additions & 56 deletions barretenberg/.github/workflows/nix.yml

This file was deleted.

4 changes: 2 additions & 2 deletions barretenberg/.gitrepo
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/AztecProtocol/barretenberg
branch = master
commit = 491aa9d0f86d0b19b05d0805bfe3dbcccb249472
parent = a60c70dca1d920ad88511f77be3ad186afab7bdb
commit = 8b5ad73c5eff8daf734bda54acfbc28f97e73c0f
parent = 73106008f464328935997028ca18698965b579a5
method = merge
cmdver = 0.4.6
43 changes: 0 additions & 43 deletions barretenberg/flake.lock

This file was deleted.

94 changes: 0 additions & 94 deletions barretenberg/flake.nix

This file was deleted.

48 changes: 0 additions & 48 deletions barretenberg/wasi-sdk.nix

This file was deleted.

4 changes: 2 additions & 2 deletions build-system/.gitrepo
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/AztecProtocol/build-system
branch = master
commit = b600bcc8c1092a1a98baea21690ce7982ab4f8a4
parent = a60c70dca1d920ad88511f77be3ad186afab7bdb
commit = 0d80b542a6f6df6f2da1981c4b07c5f5ee7211e6
parent = 73106008f464328935997028ca18698965b579a5
method = merge
cmdver = 0.4.6
4 changes: 2 additions & 2 deletions docs/.gitrepo
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/AztecProtocol/docs
branch = main
commit = 15c08e47cb80ef264381769bb07798b41c7447a8
parent = a60c70dca1d920ad88511f77be3ad186afab7bdb
commit = be29bffd773ca2b6be59856f5922027616ef292f
parent = 73106008f464328935997028ca18698965b579a5
method = merge
cmdver = 0.4.6
4 changes: 2 additions & 2 deletions yarn-project/aztec-nr/.gitrepo
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/AztecProtocol/aztec-nr
branch = master
commit = 417e069591ac37f3696ff42a660dd57fc43e504f
commit = d4660483c75176ad5bc1b79cd90d6f75b10b9305
method = merge
cmdver = 0.4.6
parent = a60c70dca1d920ad88511f77be3ad186afab7bdb
parent = 73106008f464328935997028ca18698965b579a5
2 changes: 0 additions & 2 deletions yarn-project/boxes/token/.gitignore
Original file line number Diff line number Diff line change
@@ -22,5 +22,3 @@ dist-ssr
*.njsproj
*.sln
*.sw?

src/contracts/target
Original file line number Diff line number Diff line change
@@ -76,13 +76,8 @@ impl BalanceSet {
let mut addend_note = TokenNote::new(addend, self.owner);

// docs:start:insert
self.set.insert(&mut addend_note);
self.set.insert(&mut addend_note, true);
// docs:end:insert

addend_note.emit_encrypted(
self.context.private.unwrap(),
self.set.storage_slot
);
}

pub fn sub(self: Self, subtrahend: SafeU120) {
23 changes: 11 additions & 12 deletions yarn-project/boxes/token/src/contracts/src/types/token_note.nr
Original file line number Diff line number Diff line change
@@ -84,25 +84,18 @@ impl TokenNote {
self.header = header;
}


pub fn emit_encrypted(
self: &mut Self,
context: &mut PrivateContext,
storage_slot: Field,
) {
// Broadcasts the note as an encrypted log on L1.
pub fn broadcast(self, context: &mut PrivateContext, slot: Field) {
// We only bother inserting the note if non-empty to save funds on gas.
if !self.amount.is_zero() {
// docs:start:encrypted
let application_contract_address = (*context).this_address();
let encryption_pub_key = get_public_key(self.owner.address);
let encrypted_data = (*self).serialize();

emit_encrypted_log(
context,
application_contract_address,
storage_slot,
(*context).this_address(),
slot,
encryption_pub_key,
encrypted_data,
self.serialize(),
);
// docs:end:encrypted
}
@@ -133,11 +126,17 @@ fn set_header(note: &mut TokenNote, header: NoteHeader) {
note.set_header(header)
}

// Broadcasts the note as an encrypted log on L1.
fn broadcast(context: &mut PrivateContext, slot: Field, note: TokenNote) {
note.broadcast(context, slot);
}

global TokenNoteMethods = NoteInterface {
deserialize,
serialize,
compute_note_hash,
compute_nullifier,
get_header,
set_header,
broadcast,
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
// docs:start:token_types_all
use dep::std::hash::pedersen;
use dep::aztec::note::{
note_header::NoteHeader,
note_interface::NoteInterface,
utils::compute_siloed_note_hash,
use dep::aztec::{
note::{
note_header::NoteHeader,
note_interface::NoteInterface,
utils::compute_siloed_note_hash,
},
hash::compute_secret_hash,
context::PrivateContext,
};
use dep::aztec::hash::{compute_secret_hash};

global TRANSPARENT_NOTE_LEN: Field = 2;

@@ -112,12 +115,17 @@ fn set_header(note: &mut TransparentNote, header: NoteHeader) {
note.set_header(header)
}

fn broadcast(context: &mut PrivateContext, slot: Field, note: TransparentNote) {
assert(false, "TransparentNote does not support broadcast");
}

global TransparentNoteMethods = NoteInterface {
deserialize,
serialize,
compute_note_hash,
compute_nullifier,
get_header,
set_header,
broadcast,
};
// docs:end:token_types_all