From b91fd4d76a7e5330875a43d2c75bab01426ae332 Mon Sep 17 00:00:00 2001 From: murat <155527010+kejan2514@users.noreply.github.com> Date: Sat, 8 Aug 2026 22:51:22 +0300 Subject: [PATCH 1/5] chore: standardize counter MASM comments --- masm/accounts/counter.masm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/masm/accounts/counter.masm b/masm/accounts/counter.masm index 8ac3bbc5..bb070dab 100644 --- a/masm/accounts/counter.masm +++ b/masm/accounts/counter.masm @@ -5,28 +5,29 @@ use miden::core::sys const COUNTER_SLOT = word("miden::tutorials::counter") +#! Description: Reads the current counter value from active account storage. #! Inputs: [] #! Outputs: [count] +#! Invocation: exec pub proc get_count push.COUNTER_SLOT[0..2] exec.active_account::get_item # => [count] exec.sys::truncate_stack - # => [count] end +#! Description: Increments the active account counter by one and stores the updated value. #! Inputs: [] #! Outputs: [] +#! Invocation: exec pub proc increment_count push.COUNTER_SLOT[0..2] exec.active_account::get_item # => [count] add.1 - # => [count+1] + # => [count] push.COUNTER_SLOT[0..2] exec.native_account::set_item - # => [] exec.sys::truncate_stack - # => [] end From 57cddcfdf8db55ed4bf06443fe32b2fdd3f04ddb Mon Sep 17 00:00:00 2001 From: murat <155527010+kejan2514@users.noreply.github.com> Date: Sat, 8 Aug 2026 22:52:50 +0300 Subject: [PATCH 2/5] chore: standardize count reader MASM comments --- masm/accounts/count_reader.masm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/masm/accounts/count_reader.masm b/masm/accounts/count_reader.masm index 5d92db91..5be27f5c 100644 --- a/masm/accounts/count_reader.masm +++ b/masm/accounts/count_reader.masm @@ -7,20 +7,28 @@ use miden::core::sys # The storage slot where the copied count is stored. const COUNT_READER_SLOT = word("miden::tutorials::count_reader") -# => [account_id_suffix, account_id_prefix, PROC_HASH(4), foreign_procedure_inputs(16)] +#! Copies a count from a foreign account into this account's storage. +#! +#! Inputs: [account_id_suffix, account_id_prefix, PROC_HASH, foreign_procedure_inputs] +#! Outputs: [] +#! +#! Where: +#! - account_id_{prefix,suffix} identify the foreign account. +#! - PROC_HASH is the foreign procedure hash. +#! - foreign_procedure_inputs are the inputs reserved for the foreign procedure call. +#! +#! Invocation: call pub proc copy_count exec.tx::execute_foreign_procedure # => [count, pad(12)] push.COUNT_READER_SLOT[0..2] - # [slot_id_prefix, slot_id_suffix, count, pad(12)] + # => [slot_id_prefix, slot_id_suffix, count, pad(12)] exec.native_account::set_item # => [OLD_VALUE, pad(12)] dropw dropw dropw dropw - # => [] exec.sys::truncate_stack - # => [] end From c2808b2abd2bd771208fdebc6a2856618a27dafe Mon Sep 17 00:00:00 2001 From: murat <155527010+kejan2514@users.noreply.github.com> Date: Sat, 8 Aug 2026 22:52:59 +0300 Subject: [PATCH 3/5] chore: document no-auth MASM procedure --- masm/accounts/auth/no_auth.masm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/masm/accounts/auth/no_auth.masm b/masm/accounts/auth/no_auth.masm index c22205db..9b954794 100644 --- a/masm/accounts/auth/no_auth.masm +++ b/masm/accounts/auth/no_auth.masm @@ -1,5 +1,11 @@ use miden::protocol::native_account +#! Authorizes a transaction without signature checks and increments the account nonce. +#! +#! Inputs: [] +#! Outputs: [] +#! +#! Invocation: auth script @auth_script pub proc auth__basic exec.native_account::incr_nonce drop From 69f6f113959794c64cce0f3c4038bca34c4d4d9b Mon Sep 17 00:00:00 2001 From: murat <155527010+kejan2514@users.noreply.github.com> Date: Sat, 8 Aug 2026 22:53:22 +0300 Subject: [PATCH 4/5] chore: add contribution note --- CONTRIBUTION_NOTE.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 CONTRIBUTION_NOTE.md diff --git a/CONTRIBUTION_NOTE.md b/CONTRIBUTION_NOTE.md new file mode 100644 index 00000000..0a1afc84 --- /dev/null +++ b/CONTRIBUTION_NOTE.md @@ -0,0 +1 @@ +This branch prepares a focused MASM formatting contribution for 0xMiden/tutorials#190. From a55912794ed7dac193c21c5da9b0808dd8373865 Mon Sep 17 00:00:00 2001 From: murat <155527010+kejan2514@users.noreply.github.com> Date: Sat, 8 Aug 2026 22:53:48 +0300 Subject: [PATCH 5/5] chore: remove temporary contribution note --- CONTRIBUTION_NOTE.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CONTRIBUTION_NOTE.md diff --git a/CONTRIBUTION_NOTE.md b/CONTRIBUTION_NOTE.md deleted file mode 100644 index 0a1afc84..00000000 --- a/CONTRIBUTION_NOTE.md +++ /dev/null @@ -1 +0,0 @@ -This branch prepares a focused MASM formatting contribution for 0xMiden/tutorials#190.