0xMiden / 0xMiden/tutorials

fix: address Miden Bank tutorial feedback from review

Offen
#180 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
18
Forks
34
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Context

Consolidates Miden Bank tutorial feedback from two reviewers:
- Dominik's review in [miden-devrel#126](https://github.com/0xMiden/miden-devrel/issues/126) (comments from [Mar 9](https://github.com/0xMiden/miden-devrel/issues/126#issuecomment-4021614999) and [Mar 10](https://github.com/0xMiden/miden-devrel/issues/126#issuecomment-4024893006))
- PhilippGackstatter's detailed audit in [docs#203](https://github.com/0xMiden/docs/issues/203)

## Blockers (tests that don't compile)

1. **Part 3**: Test references `deposit-note` which doesn't exist until Part 4
2. **Part 4**: Test references `init-tx-script` which doesn't exist until Part 6
3. **Part 6**: Possible `no field 'dep'` compiler error (needs verification)

## Security concerns

4. Withdraw note passes sender explicitly as `depositor` param, an attacker could pass a victim's ID
5. No overflow check on `current_balance + deposit_amount` in deposit
6. No validation that asset is fungible before accessing `inner[0]`

## Important accuracy fixes

7. Part 0 Step 4 Cargo.toml update is a no-op
8. Part 1 re-adds `balances: StorageMap` already present from Part 0
9. Part 5 WIT file listing shows wrong filenames
10. "Auto-assigns slot numbers based on field order" is outdated
11. StorageMap::get return type claimed as Felt but returns any type convertible from Word
12. "Called by other contracts" should be "Called by other components"
13. Part 7 re-introduces `withdraw()` already in Part 3
14. Cross-component explanation (Part 5) comes AFTER Part 4 already uses it
15. Key layout should use little-endian for 0.14 compatibility

## Minor / cosmetic

16. Part 2 test description mismatch (says "verifies deposit without init fails" but never calls deposit)
17. `require_initialized` introduced too early (Part 1, not called until Part 2)
18. Cargo.toml updates in Parts 4, 6, 7 are all no-ops
19. Trace log spam not shown in expected output
20. Typo "from outside" -> "from the outside"
21. Part 5 bindings visualization arrow unclear
22. No IDE support note for contracts excluded from workspace
23. Part 1 MockChain claim but no MockChain created

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

The issue lists specific feedback items for the Miden Bank tutorial. Start by locating the tutorial files in the repository, likely under a directory like `miden-bank/`. Review each part (0-7) mentioned, checking the code and documentation against the listed blockers, security concerns, and accuracy fixes. Run the tests to verify compilation errors. Focus on making the corrections sequentially as outlined in the issue body.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
65/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.