Skip to content

Commit 4fdf491

Browse files
committed
Merge branch 'main' of https://github.com/0xMiden/miden-docs into brian/miden-smart-contract
2 parents 6dce1e9 + 0a56186 commit 4fdf491

File tree

523 files changed

+49205
-10364
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

523 files changed

+49205
-10364
lines changed

.github/workflows/cut-versions.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# v0.4 Information Architecture:
66
# - Design docs (miden-base, miden-vm, compiler, miden-node) → docs/design/
7-
# - Builder docs (miden-tutorials, miden-client) → docs/builder/
7+
# - Builder docs (miden-tutorials, miden-client) → docs/builder/develop/tutorials/, docs/builder/tools/client/
88
#
99
# Workflow responsibilities:
1010
# 1. Check out external repos at pinned refs
@@ -34,8 +34,9 @@ on:
3434
compiler_ref: { required: false }
3535
miden_tutorials_ref: { required: false }
3636

37-
# Optional: auto-run when manifest changes (enable after you trust the flow)
37+
# Auto-run when manifest changes on a branch (NOT main — prevents re-triggering on merge)
3838
push:
39+
branches-ignore: [main]
3940
paths:
4041
- ".release/release-manifest.yml"
4142

@@ -150,7 +151,8 @@ jobs:
150151
151152
# Clean directories that will be re-synced (v0.4 nested paths)
152153
rm -rf docs/design/miden-base docs/design/miden-vm docs/design/miden-node docs/design/compiler
153-
rm -rf docs/builder/tutorials docs/builder/client
154+
rm -rf docs/builder/tools/client
155+
# Note: docs/builder/develop/tutorials is NOT fully cleaned to preserve local tutorials (e.g. miden-bank)
154156
155157
# Design docs → docs/design/*
156158
if [ -d "vendor/miden-base/docs/src" ]; then
@@ -178,16 +180,17 @@ jobs:
178180
fi
179181
180182
# Builder docs → docs/builder/*
183+
# Sync miden-tutorials into develop/tutorials (local tutorials are preserved)
181184
if [ -d "vendor/miden-tutorials/docs/src" ]; then
182-
mkdir -p docs/builder/tutorials
183-
cp -r vendor/miden-tutorials/docs/src/* docs/builder/tutorials/
184-
echo "Synced miden-tutorials → docs/builder/tutorials"
185+
mkdir -p docs/builder/develop/tutorials
186+
cp -r vendor/miden-tutorials/docs/src/* docs/builder/develop/tutorials/
187+
echo "Synced miden-tutorials → docs/builder/develop/tutorials"
185188
fi
186189
187-
if [ -d "vendor/miden-client/docs/src" ]; then
188-
mkdir -p docs/builder/client
189-
cp -r vendor/miden-client/docs/src/* docs/builder/client/
190-
echo "Synced miden-client → docs/builder/client"
190+
if [ -d "vendor/miden-client/docs/external/src" ]; then
191+
mkdir -p docs/builder/tools/client
192+
cp -r vendor/miden-client/docs/external/src/* docs/builder/tools/client/
193+
echo "Synced miden-client → docs/builder/tools/client"
191194
fi
192195
193196
echo "Content aggregation complete. Final docs structure:"
@@ -196,6 +199,8 @@ jobs:
196199
ls -la docs/design/ || true
197200
echo "Builder subdirs:"
198201
ls -la docs/builder/ || true
202+
echo "Tutorials subdirs:"
203+
ls -la docs/builder/develop/tutorials/ || true
199204
200205
- name: Cut version snapshot
201206
run: |
@@ -214,8 +219,8 @@ jobs:
214219
rm -rf docs/design/miden-vm
215220
rm -rf docs/design/miden-node
216221
rm -rf docs/design/compiler
217-
rm -rf docs/builder/tutorials
218-
rm -rf docs/builder/client
222+
rm -rf docs/builder/tools/client
223+
# Note: tutorials live in docs/builder/develop/tutorials/ (authored content, not cleaned)
219224
220225
- name: Commit snapshots
221226
run: |

.github/workflows/deploy-docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
148148
# Clean directories that will be re-synced (v0.4 nested paths)
149149
rm -rf docs/design/miden-base docs/design/miden-vm docs/design/miden-node docs/design/compiler
150-
rm -rf docs/builder/client
150+
rm -rf docs/builder/tools/client
151151
# Note: docs/builder/develop/tutorials is NOT fully cleaned to preserve local tutorials (e.g. miden-bank)
152152
153153
# Design docs → docs/design/*
@@ -184,9 +184,9 @@ jobs:
184184
fi
185185
186186
if [ -d "vendor/miden-client/docs/external/src" ]; then
187-
mkdir -p docs/builder/client
188-
cp -r vendor/miden-client/docs/external/src/* docs/builder/client/
189-
echo "Synced miden-client → docs/builder/client"
187+
mkdir -p docs/builder/tools/client
188+
cp -r vendor/miden-client/docs/external/src/* docs/builder/tools/client/
189+
echo "Synced miden-client → docs/builder/tools/client"
190190
fi
191191
192192
echo "Content aggregation complete. Final docs structure:"

.release/release-manifest.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
version: "0.12 (stable)" # the label to snapshot (used if no manual override)
1+
version: "0.13" # the label to snapshot (used if no manual override)
22
refs: # exact, immutable refs per source repo (tags or release branches)
3-
miden-base: "refs/tags/v0.12.3"
4-
miden-node: "refs/tags/v0.12.3"
5-
miden-client: "refs/tags/v0.12.3"
3+
miden-base: "refs/tags/v0.13.3"
4+
miden-node: "refs/tags/v0.13.4"
5+
miden-client: "refs/tags/v0.13.0"
66
miden-tutorials: "refs/heads/main"
7-
miden-vm: "refs/tags/v0.19.1"
8-
compiler: "refs/tags/0.5.1"
9-
next_version: "0.13"
7+
miden-vm: "refs/tags/v0.20.6"
8+
compiler: "refs/tags/0.7.0"
9+
next_version: "0.14"

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ refs:
152152
153153
#### 2. Run the Version Cut Workflow
154154
155-
Trigger `.github/workflows/cut-versions.yml` (manually or via push to manifest):
155+
> **Important:** Run this workflow on a **branch** (not `main`). The workflow commits the snapshot
156+
> to the current branch, allowing you to review changes in a PR before merging to `main`.
157+
> The workflow is configured to NOT run automatically when changes are pushed to `main`.
158+
159+
Trigger `.github/workflows/cut-versions.yml` on a branch (manually via `workflow_dispatch`, or by pushing the updated manifest to the branch):
156160

157161
The workflow executes these steps:
158162
1. **Checkout external repos** at pinned refs
@@ -178,7 +182,7 @@ The `.github/workflows/deploy-docs.yml` workflow:
178182
1. Checks out this repository and all external source repos
179183
2. Ingests external docs into v0.4 IA structure:
180184
- Design docs → `docs/design/miden-base/`, `miden-vm/`, `compiler/`, `miden-node/`
181-
- Builder docs → `docs/builder/tutorials/`, `docs/builder/client/`
185+
- Builder docs → `docs/builder/develop/tutorials/`, `docs/builder/tools/client/`
182186
3. Runs `npm run build` to generate the static site
183187
4. Deploys to GitHub Pages at `docs.miden.xyz`
184188

docs/builder/develop/tutorials/rust-compiler/miden-bank/00-project-setup.md

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@ miden --version
3434
<summary>Expected output</summary>
3535

3636
```text
37-
miden-cli 0.8.x
37+
The Miden toolchain porcelain:
38+
39+
Environment:
40+
- cargo version: cargo 1.93.0 (083ac5135 2025-12-15).
41+
42+
Midenup:
43+
- midenup + miden version: 0.1.0.
44+
- active toolchain version: 0.20.3.
45+
- ...
3846
```
3947

4048
</details>
@@ -90,7 +98,7 @@ edition = "2021"
9098
crate-type = ["cdylib"]
9199

92100
[dependencies]
93-
miden = { workspace = true }
101+
miden = { version = "0.10" }
94102

95103
[package.metadata.component]
96104
package = "miden:bank-account"
@@ -132,12 +140,12 @@ use miden::*;
132140
struct Bank {
133141
/// Tracks whether the bank has been initialized (deposits enabled).
134142
/// Word layout: [is_initialized (0 or 1), 0, 0, 0]
135-
#[storage(slot(0), description = "initialized")]
143+
#[storage(description = "initialized")]
136144
initialized: Value,
137145

138146
/// Maps depositor AccountId -> balance (as Felt).
139147
/// We'll use this to track user balances in Part 1.
140-
#[storage(slot(1), description = "balances")]
148+
#[storage(description = "balances")]
141149
balances: StorageMap,
142150
}
143151

@@ -185,18 +193,24 @@ Update the root `Cargo.toml` to reflect our renamed contract:
185193

186194
```toml title="Cargo.toml"
187195
[workspace]
188-
resolver = "2"
189-
190196
members = [
191-
"contracts/bank-account",
192-
"contracts/increment-note", # We'll replace this later
193-
"integration",
197+
"integration"
198+
]
199+
exclude = [
200+
"contracts/",
194201
]
202+
resolver = "2"
203+
204+
[workspace.package]
205+
edition = "2021"
195206

196207
[workspace.dependencies]
197-
miden = { version = "0.8" }
198208
```
199209

210+
:::info Contracts Are Excluded
211+
In v0.13, contracts are excluded from the Cargo workspace and built independently by `cargo miden`. Each contract specifies its own `miden` dependency directly. Only the `integration` crate remains a workspace member.
212+
:::
213+
200214
## Step 5: Build and Verify
201215

202216
Let's verify everything compiles correctly:
@@ -231,7 +245,7 @@ Let's create a simple test to verify the bank account can be created. Create a n
231245
use integration::helpers::{
232246
build_project_in_dir, create_testing_account_from_package, AccountCreationConfig,
233247
};
234-
use miden_client::account::{StorageMap, StorageSlot};
248+
use miden_client::account::{StorageMap, StorageSlot, StorageSlotName};
235249
use miden_client::Word;
236250
use std::{path::Path, sync::Arc};
237251

@@ -243,13 +257,21 @@ async fn test_bank_account_builds_and_loads() -> anyhow::Result<()> {
243257
true,
244258
)?);
245259

246-
// Create the bank account with initial storage
247-
// Slot 0: initialized flag (Value, starts as [0, 0, 0, 0])
248-
// Slot 1: balances map (StorageMap, starts empty)
260+
// Create named storage slots matching the contract's storage layout
261+
let initialized_slot =
262+
StorageSlotName::new("miden::component::miden_bank_account::initialized")
263+
.expect("Valid slot name");
264+
let balances_slot =
265+
StorageSlotName::new("miden::component::miden_bank_account::balances")
266+
.expect("Valid slot name");
267+
249268
let bank_cfg = AccountCreationConfig {
250269
storage_slots: vec![
251-
StorageSlot::Value(Word::default()),
252-
StorageSlot::Map(StorageMap::with_entries([])?),
270+
StorageSlot::with_value(initialized_slot, Word::default()),
271+
StorageSlot::with_map(
272+
balances_slot,
273+
StorageMap::with_entries([]).expect("Empty storage map"),
274+
),
253275
],
254276
..Default::default()
255277
};
@@ -268,7 +290,7 @@ async fn test_bank_account_builds_and_loads() -> anyhow::Result<()> {
268290
Run the test from the project root:
269291

270292
```bash title=">_ Terminal"
271-
cargo test --package integration part0_setup_test -- --nocapture
293+
cargo test --package integration test_bank_account_builds_and_loads -- --nocapture
272294
```
273295

274296
<details>
@@ -317,7 +339,7 @@ Your bank can be created, but doesn't do anything useful yet. In the next parts,
317339

318340
1. **`miden new`** creates a complete project workspace with contracts and integration folders
319341
2. **Account components** are defined with `#[component]` on a struct
320-
3. **Storage slots** are declared with `#[storage(slot(N))]` attributes
342+
3. **Storage slots** are declared with `#[storage(description = "...")]` attributes (the compiler auto-assigns slot numbers)
321343
4. **`miden build`** compiles Rust to Miden Assembly (.masp package)
322344
5. **Tests verify** that your code works before moving on
323345

0 commit comments

Comments
 (0)