← ClaudeAtlas

sui-move-setuplisted

Move package setup (Move.toml, edition, dependencies), building, testing, and common pitfalls from other Move dialects.
widnyana/eyay-toolkits · ★ 4 · Web & Frontend · score 77
Install: claude install-skill widnyana/eyay-toolkits
## 1. Package Setup Always use the Move 2024 edition (`edition = "2024"` in Move.toml). The `name` in `[package]` defines the package's address name and **must match** what the Move code uses (e.g., `module my_package::m` requires `name = "my_package"`): ```toml [package] name = "my_package" edition = "2024" ``` **Implicit framework dependencies (Sui 1.45+)** — do not list `Sui`, `MoveStdlib`, `Bridge`, or `SuiSystem` in `[dependencies]`. They are implicit: ```toml # ✅ Sui 1.45+ [dependencies] # no framework entries needed # ❌ Outdated [dependencies] Sui = { git = "...", subdir = "crates/sui-framework/packages/sui-framework", rev = "..." } ``` **No `[addresses]` section (Sui CLI 1.63+)** — named addresses are derived from the `[package]` name and `[dependencies]` keys. Do not add an `[addresses]` or `[dev-addresses]` section. Run `sui move build` after any significant change to verify the code compiles before proceeding. --- ## 2. Building and Testing Always verify code compiles and tests pass using the Sui CLI: ```bash # Build sui move build # Run all tests sui move test # Run a specific test by name sui move test swap_exact_input ``` ### Test conventions **Naming** — do not prefix test functions with `test_`. The `#[test]` attribute already signals intent: ```move // ✅ #[test] fun create_pool() { } #[test] fun swap_returns_correct_amount() { } // ❌ #[test] fun test_create_pool() { } ``` **Merge attributes** — combine `#[test]` and `#[expected_failure]` on