0xMiden / 0xMiden/tutorials

fix: address Miden Bank tutorial feedback from review

Đang mở
#180 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
18
Fork
34
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.