From 7914113ac63e1bd03477aa5e916d3af456a34eff Mon Sep 17 00:00:00 2001 From: crStiv Date: Mon, 25 Nov 2024 21:57:27 +0100 Subject: [PATCH 01/11] grammar fix address_note.nr --- address-note/src/address_note.nr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/address-note/src/address_note.nr b/address-note/src/address_note.nr index bdaf172..a728f59 100644 --- a/address-note/src/address_note.nr +++ b/address-note/src/address_note.nr @@ -52,9 +52,9 @@ impl NullifiableNote for AddressNote { impl AddressNote { pub fn new(address: AztecAddress, owner: AztecAddress) -> Self { - // We use the randomness to preserve the privacy of the note recipient by preventing brute-forcing, so a + // We use randomness to preserve the privacy of the note recipient by preventing brute-forcing, so a // malicious sender could use non-random values to make the note less private. But they already know the full - // note pre-image anyway, and so the recipient already trusts them to not disclose this information. We can + // note pre-image anyway, so the recipient trusts them not to disclose this information. We can // therefore assume that the sender will cooperate in the random value generation. let randomness = unsafe { random() }; AddressNote { address, owner, randomness, header: NoteHeader::empty() } From 6693c5ebe9ae18f9bea61ec85150e38c7421f781 Mon Sep 17 00:00:00 2001 From: crStiv Date: Mon, 25 Nov 2024 22:34:37 +0100 Subject: [PATCH 02/11] grammar/typo auth.nr --- authwit/src/auth.nr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/authwit/src/auth.nr b/authwit/src/auth.nr index 3809f76..0eda134 100644 --- a/authwit/src/auth.nr +++ b/authwit/src/auth.nr @@ -10,7 +10,7 @@ use dep::aztec::protocol_types::{ }; /** - * Authenticaion witness helper library + * Authentication witness helper library * * Authentication Witness is a scheme for authenticating actions on Aztec, so users can allow third-parties * (e.g. protocols or other users) to execute an action on their behalf. @@ -75,7 +75,7 @@ use dep::aztec::protocol_types::{ * To ensure that the same "approval" cannot be used multiple times, we also compute a `nullifier` for the * authentication witness, and emit it from the `Token` contract (consumer). * - * Note that we can do this flow as we are in private were we can do oracle calls out from contracts. + * Note that we can do this flow as we are in private where we can do oracle calls out from contracts. * * * Person Contract Contract Contract @@ -186,7 +186,7 @@ use dep::aztec::protocol_types::{ * consumption is done in the same transaction, then we will be able to squash the updates (only final tx state diff is posted to DA), and now it is cheaper. * * Q: Why is the chain id and the version part of the message hash? - * A: The chain id and the version is part of the message hash to ensure that the message is only valid on a specific + * A: The chain id and the version are part of the message hash to ensure that the message is only valid on a specific * chain to avoid a case where the same message could be used across multiple chains. */ @@ -235,7 +235,7 @@ pub fn assert_inner_hash_valid_authwit( .unpack_into(); assert(result == IS_VALID_SELECTOR, "Message not authorized by account"); // Compute the nullifier, similar computation to the outer hash, but without the chain_id and version. - // Those should already be handled in the verification, so we just need something to nullify, that allow same inner_hash for multiple actors. + // Those should already be handled in the verification, so we just need something to nullify, that allows the same inner_hash for multiple actors. let nullifier = compute_authwit_nullifier(on_behalf_of, inner_hash); context.push_nullifier(nullifier); } @@ -294,8 +294,8 @@ pub unconstrained fn assert_inner_hash_valid_authwit_public( /** * Compute the `message_hash` from a function call to be used by an authentication witness * - * Useful for when you need a non-account contract to approve during execution. For example if you need a contract - * to make a call to nested contract, e.g., contract A wants to exit token T to L1 using bridge B, so it needs to allow + * Useful for when you need a non-account contract to approve during execution. For example, if you need a contract + * to make a call to a nested contract, e.g., contract A wants to exit token T to L1 using bridge B, so it needs to allow * B to transfer T on its behalf. * * @param caller The address of the contract that is calling the function, in the example above, this would be B From 2252325b41775810515505ba21566c3fe845302c Mon Sep 17 00:00:00 2001 From: crStiv Date: Mon, 25 Nov 2024 22:38:44 +0100 Subject: [PATCH 03/11] useless symbol cheatcodes.nr --- authwit/src/cheatcodes.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authwit/src/cheatcodes.nr b/authwit/src/cheatcodes.nr index 21347c5..c276c1c 100644 --- a/authwit/src/cheatcodes.nr +++ b/authwit/src/cheatcodes.nr @@ -47,7 +47,7 @@ where let inner_hash = compute_inner_authwit_hash([caller.to_field(), selector.to_field(), args_hash]); let message_hash = compute_authwit_message_hash(target, chain_id, version, inner_hash); - let mut context = PublicContext::new(|| panic(f"Provide args hash manually")); + let mut context = PublicContext::new(|| panic("Provide args hash manually")); context.args_hash = Option::some(args_hash); set_authorized(&mut context, message_hash, true); cheatcodes::set_contract_address(current_contract); From cc59d84de3d901ef6c7fa51e3b5a4dcfed019bce Mon Sep 17 00:00:00 2001 From: crStiv Date: Tue, 26 Nov 2024 00:10:10 +0100 Subject: [PATCH 04/11] typo mod.nr --- aztec/src/macros/functions/mod.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aztec/src/macros/functions/mod.nr b/aztec/src/macros/functions/mod.nr index 038fee0..df63cf1 100644 --- a/aztec/src/macros/functions/mod.nr +++ b/aztec/src/macros/functions/mod.nr @@ -52,7 +52,7 @@ comptime fn create_view_check(f: FunctionDefinition) -> Quoted { /// An initializer function is similar to a constructor: /// - it can only be called once /// - if there are multiple initializer functions, only one of them can be called -/// - no non-initializer functions can be called until an initializer has ben called (except `noinitcheck` functions) +/// - no non-initializer functions can be called until an initializer has been called (except `noinitcheck` functions) pub comptime fn initializer(_f: FunctionDefinition) { // Marker attribute } From f26e808325c88fb116a880958f9c47f2d26d7573 Mon Sep 17 00:00:00 2001 From: crStiv Date: Tue, 26 Nov 2024 00:14:27 +0100 Subject: [PATCH 05/11] typo mod.nr --- aztec/src/macros/storage/mod.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aztec/src/macros/storage/mod.nr b/aztec/src/macros/storage/mod.nr index c48fb8f..5b7f168 100644 --- a/aztec/src/macros/storage/mod.nr +++ b/aztec/src/macros/storage/mod.nr @@ -8,7 +8,7 @@ pub comptime mut global STORAGE_LAYOUT_NAME: UHashMap Quoted { // This macro performs three things: From 5671d661cee01b349c4aaec44becdcc0a951770c Mon Sep 17 00:00:00 2001 From: crStiv Date: Tue, 26 Nov 2024 00:15:39 +0100 Subject: [PATCH 06/11] typo utils.nr --- aztec/src/macros/utils.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aztec/src/macros/utils.nr b/aztec/src/macros/utils.nr index 2f516e9..fc2854b 100644 --- a/aztec/src/macros/utils.nr +++ b/aztec/src/macros/utils.nr @@ -147,7 +147,7 @@ trait AsStrQuote { } impl AsStrQuote for Quoted { - // Used to convert an arbirary quoted type into a quoted string, removing whitespace between tokens + // Used to convert an arbitrary quoted type into a quoted string, removing whitespace between tokens comptime fn as_str_quote(self) -> Quoted { let tokens = self.tokens(); let mut acc: [u8] = &[]; From a05c172df793bbda93a1ca201f79e71916554a3b Mon Sep 17 00:00:00 2001 From: crStiv Date: Tue, 26 Nov 2024 00:49:18 +0100 Subject: [PATCH 07/11] typos lifecycle.nr --- aztec/src/note/lifecycle.nr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aztec/src/note/lifecycle.nr b/aztec/src/note/lifecycle.nr index d07e61e..053de30 100644 --- a/aztec/src/note/lifecycle.nr +++ b/aztec/src/note/lifecycle.nr @@ -82,8 +82,8 @@ where } else { // A non-zero note hash counter implies that we're nullifying a pending note (i.e. one that has not yet been // persisted in the trees and is instead in the pending new note hashes array). In such a case we populate its - // hash with real value to inform the kernel which note we're nullifyng so that it can either squash both - // the note and the nullifier if it's an inner note hash, or check that the it matches a pending note if it's + // hash with real value to inform the kernel which note we're nullifying so that it can either squash both + // the note and the nullifier if it's an inner note hash, or check that it matches a pending note if it's // a siloed note hash. note_hash_for_nullify }; From be93d18e58910bcb24bb1039a3ad20a0830a2cf9 Mon Sep 17 00:00:00 2001 From: crStiv Date: Tue, 26 Nov 2024 01:05:26 +0100 Subject: [PATCH 08/11] Update test.nr --- .../state_vars/shared_mutable/scheduled_delay_change/test.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aztec/src/state_vars/shared_mutable/scheduled_delay_change/test.nr b/aztec/src/state_vars/shared_mutable/scheduled_delay_change/test.nr index 17a9e5e..bedf0eb 100644 --- a/aztec/src/state_vars/shared_mutable/scheduled_delay_change/test.nr +++ b/aztec/src/state_vars/shared_mutable/scheduled_delay_change/test.nr @@ -155,7 +155,7 @@ unconstrained fn test_schedule_change_to_shorter_delay_after_change() { let mut delay_change = get_non_initial_delay_change(pre, post, block_of_change); delay_change.schedule_change(new, current_block_number); - // The schedule time is determined by the different between the current value (ex post, now pre) and new delay. + // The schedule time is determined by the difference between the current value (ex post, now pre) and new delay. assert_eq(delay_change.pre.unwrap(), post); assert_eq(delay_change.post.unwrap(), new); assert_eq(delay_change.block_of_change, current_block_number + post - new); From 9d44babaed4ba337f83d8d108bbe2fda9f79a9fa Mon Sep 17 00:00:00 2001 From: crStiv Date: Tue, 26 Nov 2024 01:14:14 +0100 Subject: [PATCH 09/11] typo scheduled_delay_change.nr --- aztec/src/state_vars/shared_mutable/scheduled_delay_change.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aztec/src/state_vars/shared_mutable/scheduled_delay_change.nr b/aztec/src/state_vars/shared_mutable/scheduled_delay_change.nr index 4aeac99..428346f 100644 --- a/aztec/src/state_vars/shared_mutable/scheduled_delay_change.nr +++ b/aztec/src/state_vars/shared_mutable/scheduled_delay_change.nr @@ -58,7 +58,7 @@ impl ScheduledDelayChange { // When changing the delay value we must ensure that it is not possible to produce a value change with a delay // shorter than the current one. let blocks_until_change = if new > current { - // Increasing the delay value can therefore be done immediately: this does not invalidate prior contraints + // Increasing the delay value can therefore be done immediately: this does not invalidate prior constraints // about how quickly a value might be changed (indeed it strengthens them). 0 } else { From 1bae900ffe18571134d8d8ad612679184533dfc3 Mon Sep 17 00:00:00 2001 From: crStiv Date: Tue, 26 Nov 2024 01:16:56 +0100 Subject: [PATCH 10/11] typo test.nr --- aztec/src/state_vars/shared_mutable/test.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aztec/src/state_vars/shared_mutable/test.nr b/aztec/src/state_vars/shared_mutable/test.nr index cdf5414..a4f331b 100644 --- a/aztec/src/state_vars/shared_mutable/test.nr +++ b/aztec/src/state_vars/shared_mutable/test.nr @@ -37,7 +37,7 @@ unconstrained fn in_private( unconstrained fn in_unconstrained( env: TestEnvironment, ) -> SharedMutable { - SharedMutable::new(env.unkonstrained(), storage_slot) + SharedMutable::new(env.unconstrained(), storage_slot) } #[test] From ffe786e7125a48e7badb07fd065379eb7ddc6273 Mon Sep 17 00:00:00 2001 From: crStiv Date: Tue, 26 Nov 2024 01:20:58 +0100 Subject: [PATCH 11/11] Update private_set.nr --- aztec/src/state_vars/private_set.nr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aztec/src/state_vars/private_set.nr b/aztec/src/state_vars/private_set.nr index 471ede3..887f44d 100644 --- a/aztec/src/state_vars/private_set.nr +++ b/aztec/src/state_vars/private_set.nr @@ -82,7 +82,7 @@ where } /// Note that if you obtained the note via `get_notes` it's much better to use `pop_notes` as `pop_notes` results - /// in significantly less constrains due to avoiding an extra hash and read request check. + /// in significantly less constraints due to avoiding an extra hash and read request check. pub fn remove(self, note: Note) { let note_hash = compute_note_hash_for_read_request(note); let has_been_read = @@ -93,7 +93,7 @@ where } /// Note that if you later on remove the note it's much better to use `pop_notes` as `pop_notes` results - /// in significantly less constrains due to avoiding 1 read request check. + /// in significantly less constraints due to avoiding 1 read request check. pub fn get_notes( self, options: NoteGetterOptions,