Skip to content

Commit 1e3c0ad

Browse files
author
Esau
committed
update to 2.0.3
1 parent 3a2de80 commit 1e3c0ad

File tree

18 files changed

+5889
-12519
lines changed

18 files changed

+5889
-12519
lines changed

note-send-proof/circuits/Nargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ type = "bin"
44
authors = [""]
55

66
[dependencies]
7-
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v0.87.9", directory = "noir-projects/aztec-nr/aztec" }
8-
uint_note = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v0.87.9", directory = "noir-projects/aztec-nr/uint-note" }
9-
poseidon = { tag = "v0.1.1", git = "https://github.com/noir-lang/poseidon" }
7+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v2.0.3", directory = "noir-projects/aztec-nr/aztec" }
8+
poseidon = { tag = "v0.1.1", git = "https://github.com/noir-lang/poseidon" }
9+
uint_note = { path = "../uint-note" }

note-send-proof/circuits/src/main.nr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use dep::aztec::protocol_types::{
66
use dep::aztec::note::note_interface::NoteHash;
77
use dep::poseidon;
88

9-
use uint_note::uint_note::UintNote;
9+
use dep::uint_note::uint_note::UintNote;
1010

1111
fn main(
1212
settled_note_hash: pub Field,
@@ -17,7 +17,7 @@ fn main(
1717
storage_slot: Field,
1818
note_nonce: Field,
1919
) {
20-
let note = UintNote { value, randomness, owner: AztecAddress::from_field(recipient) };
20+
let note = UintNote::new_with_randomness(value, AztecAddress::from_field(recipient), randomness);
2121
let note_hash = note.compute_note_hash(storage_slot);
2222

2323
let siloed_note_hash = poseidon::poseidon2::Poseidon2::hash([GENERATOR_INDEX__SILOED_NOTE_HASH as Field, contract_address, note_hash], 3);

note-send-proof/readme.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
This proves note hash delivery
2+
3+
Prerequisites:
4+
aztec-up @ 2.0.3
5+
6+
Steps:
7+
1. aztec-nargo compile in circuits/
8+
2. aztec-nargo compile in sample-contract
9+
3. aztec-postprocess-contract in sample-contract
10+
4. yarn codegen in scripts
11+
4. yarn copy-target in scripts
12+
5. aztec start --sandbox in terminal 2
13+
6. yarn start in scripts
14+
7. copy details outputted by step 6
15+
8. yarn dev in vite
16+
9. paste details copied in step 7 to the frontend started by step 8

note-send-proof/sample-contract/Nargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ compiler_version = ">=1.0.0"
55
type = "contract"
66

77
[dependencies]
8-
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v0.87.9", directory = "noir-projects/aztec-nr/aztec" }
9-
uint_note = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v0.87.9", directory = "noir-projects/aztec-nr/uint-note" }
8+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v2.0.3", directory = "noir-projects/aztec-nr/aztec" }
9+
uint_note = { path = "../uint-note" }

note-send-proof/sample-contract/src/main.nr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub contract GettingStarted {
1616
},
1717
};
1818

19-
use uint_note::uint_note::UintNote;
19+
use dep::uint_note::uint_note::UintNote;
2020

2121
#[storage]
2222
struct Storage<Context> {
@@ -38,8 +38,8 @@ pub contract GettingStarted {
3838
let note_owner = context.msg_sender();
3939
storage.user_private_state.at(note_owner)
4040
// randomness should actually be random, but is a workaround because we can't recover it now
41-
.insert(UintNote { value, owner: note_owner, randomness: 6969 })
42-
.emit(encode_and_encrypt_note_unconstrained(&mut context, note_owner, note_owner));
41+
.insert(UintNote::new_with_randomness(value, note_owner, 6969))
42+
.emit(encode_and_encrypt_note_unconstrained(&mut context, note_owner));
4343
}
4444

4545
#[public]
@@ -52,7 +52,7 @@ pub contract GettingStarted {
5252
let maybe_contract_owner = context.msg_sender();
5353

5454
storage.contract_private_state.initialize_or_replace(UintNote::new(value, maybe_contract_owner))
55-
.emit(encode_and_encrypt_note_unconstrained(&mut context, maybe_contract_owner, maybe_contract_owner));
55+
.emit(encode_and_encrypt_note_unconstrained(&mut context, maybe_contract_owner));
5656

5757
GettingStarted::at(context.this_address())._assert_is_owner(maybe_contract_owner).enqueue(&mut context);
5858
}

0 commit comments

Comments
 (0)