You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/builder/smart-contracts/rust/accounts/account-operations.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ let new_nonce: Felt = native_account::incr_nonce();
98
98
```
99
99
100
100
:::warning
101
-
The nonce must be incremented for any transaction that modifies account state. Without it, the same transaction could be replayed. The `#[component]` macro handles this automatically for most cases.
101
+
The nonce must be incremented for any transaction that modifies account state. Without it, the same transaction could be replayed.
Copy file name to clipboardExpand all lines: docs/builder/smart-contracts/rust/accounts/components.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ impl CounterContract {
41
41
The macro generates:
42
42
43
43
1.**WIT interface definition** describing the component's public API
44
-
2.**Storage metadata** mapping field names to slot indices
44
+
2.**Storage metadata** mapping slot names to slot IDs (derived from the component package + field name)
45
45
3.**Export bindings** for the Miden runtime
46
46
47
47
## Struct definition
@@ -71,13 +71,15 @@ field_name: Value,
71
71
field_name:StorageMap,
72
72
```
73
73
74
-
The `description` is required and becomes part of the generated metadata. Slots are assigned sequentially starting from 0 unless explicitly specified with `slot(N)`:
74
+
The `description` is optional but recommended and becomes part of the generated metadata. Slot IDs are derived from the component package name (from `[package.metadata.component]`) and the field name, so **renaming a field changes the slot ID**. Ordering does not matter, and `slot(N)` is not supported.
75
+
76
+
Use `#[storage(description = "...")]` on each storage field:
0 commit comments