From 65c6b7b4267359b4642df0d00865e02af5abb09a Mon Sep 17 00:00:00 2001 From: uvd <386180127@qq.com> Date: Mon, 6 May 2024 10:13:10 +0800 Subject: [PATCH 1/2] feat: move 2024 --- SUMMARY.md | 6 ++++++ .../BCS_encoding/example_projects/bcs_move/Move.toml | 1 + .../example_projects/bcs_move/sources/bcs_object.move | 6 +++--- .../example_projects/closed_loop_token/Move.toml | 1 + .../closed_loop_token/sources/parity.move | 6 +++--- .../closed_loop_token/sources/parity_rule.move | 2 +- .../closed_loop_token/lessons/closed_loop_token.md | 2 +- exercises/unit-four/locked_coin_df.move | 6 +++--- unit-five/example_projects/flashloan/Move.toml | 1 + .../example_projects/flashloan/sources/flashloan.move | 6 +++--- unit-five/example_projects/kiosk/Move.toml | 1 + .../example_projects/kiosk/sources/dummy_policy.move | 4 ++-- .../kiosk/sources/fixed_royalty_rule.move | 6 +++--- unit-five/example_projects/kiosk/sources/kiosk.move | 4 ++-- unit-five/lessons/2_hot_potato_pattern.md | 6 +++--- unit-five/lessons/4_kiosk_basic_usage.md | 2 +- unit-five/lessons/5_transfer_policy.md | 6 +++--- unit-four/example_projects/collections/Move.toml | 1 + .../example_projects/collections/sources/bag.move | 2 +- .../collections/sources/dynamic_fields.move | 6 +++--- .../example_projects/collections/sources/table.move | 4 ++-- .../example_projects/collections/sources/vector.move | 6 +++--- unit-four/example_projects/marketplace/Move.toml | 1 + .../marketplace/sources/marketplace.move | 10 +++++----- .../example_projects/marketplace/sources/widget.move | 2 +- unit-four/lessons/1_homogeneous_collections.md | 10 +++++----- unit-four/lessons/2_dynamic_fields.md | 6 +++--- unit-four/lessons/3_heterogeneous_collections.md | 2 +- unit-four/lessons/4_marketplace_contract.md | 4 ++-- unit-four/lessons/5_deployment_and_testing.md | 2 +- unit-one/example_projects/hello_world/Move.toml | 1 + .../hello_world/sources/hello_world.move | 2 +- unit-one/lessons/2_sui_project_structure.md | 2 ++ unit-one/lessons/3_custom_types_and_abilities.md | 2 +- unit-one/lessons/4_functions.md | 2 +- unit-three/example_projects/fungible_tokens/Move.toml | 1 + .../fungible_tokens/sources/managed.move | 2 +- .../fungible_tokens/sources/managed_tests.move | 6 +++--- unit-three/example_projects/generics/Move.toml | 1 + .../example_projects/generics/sources/generics.move | 6 +++--- unit-three/example_projects/witness/Move.toml | 1 + unit-three/example_projects/witness/sources/peace.move | 4 ++-- unit-three/lessons/2_intro_to_generics.md | 6 +++--- unit-three/lessons/3_witness_design_pattern.md | 4 ++-- .../lessons/4_the_coin_resource_and_create_currency.md | 8 ++++---- unit-three/lessons/6_clock_and_locked_coin.md | 2 +- unit-two/example_projects/transcript/Move.toml | 1 + .../transcript/sources/transcript.move | 8 ++++---- unit-two/lessons/1_working_with_sui_objects.md | 4 ++-- unit-two/lessons/4_object_wrapping.md | 4 ++-- unit-two/lessons/5_object_wrapping_example.md | 4 ++-- unit-two/lessons/6_capability_design_pattern.md | 2 +- unit-two/lessons/7_events.md | 2 +- 53 files changed, 108 insertions(+), 89 deletions(-) diff --git a/SUMMARY.md b/SUMMARY.md index ae290d8..8629d10 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -28,5 +28,11 @@ - [Heterogeneous Collections](./unit-four/lessons/3_heterogeneous_collections.md) - [Marketplace Contract](./unit-four/lessons/4_marketplace_contract.md) - [Deployment and Testing](./unit-four/lessons/5_deployment_and_testing.md) +- [Unit Five: Sui Kiosk](./unit-four/readme.md) + - [Programmable Transaction Block](./unit-five/lessons/1_programmable_transaction_block.md) + - [Hot Potato Design Pattern](./unit-five/lessons/2_hot_potato_pattern.md) + - [Sui Kiosk Basic Concepts](./unit-five/lessons/3_kiosk_basics.md) + - [Sui Kiosk Basic Usage](./unit-five/lessons/4_kiosk_basic_usage.md) + - [Transfer Policy](./unit-five/lessons/5_transfer_policy.md) - [Advanced Topics](./advanced-topics/readme.md) - [BCS Encoding](./advanced-topics/BCS_encoding/lessons/BCS_encoding.md) diff --git a/advanced-topics/BCS_encoding/example_projects/bcs_move/Move.toml b/advanced-topics/BCS_encoding/example_projects/bcs_move/Move.toml index 8bc8ba5..af99aa6 100644 --- a/advanced-topics/BCS_encoding/example_projects/bcs_move/Move.toml +++ b/advanced-topics/BCS_encoding/example_projects/bcs_move/Move.toml @@ -1,6 +1,7 @@ [package] name = "bcs_move" version = "0.0.1" +edition = "2024.beta" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "devnet" } diff --git a/advanced-topics/BCS_encoding/example_projects/bcs_move/sources/bcs_object.move b/advanced-topics/BCS_encoding/example_projects/bcs_move/sources/bcs_object.move index 3932bc1..7e6cb3a 100644 --- a/advanced-topics/BCS_encoding/example_projects/bcs_move/sources/bcs_object.move +++ b/advanced-topics/BCS_encoding/example_projects/bcs_move/sources/bcs_object.move @@ -4,11 +4,11 @@ module bcs_move::bcs_object { use sui::object::{Self, ID}; use sui::event; - struct Metadata has drop, copy { + public struct Metadata has drop, copy { name: std::ascii::String } - struct BCSObject has drop, copy { + public struct BCSObject has drop, copy { id: ID, owner: address, meta: Metadata @@ -16,7 +16,7 @@ module bcs_move::bcs_object { public fun object_from_bytes(bcs_bytes: vector): BCSObject { - let bcs = bcs::new(bcs_bytes); + let mut bcs = bcs::new(bcs_bytes); // Use `peel_*` functions to peel values from the serialized bytes. // Order has to be the same as we used in serialization! diff --git a/advanced-topics/closed_loop_token/example_projects/closed_loop_token/Move.toml b/advanced-topics/closed_loop_token/example_projects/closed_loop_token/Move.toml index 70ad172..76be07b 100644 --- a/advanced-topics/closed_loop_token/example_projects/closed_loop_token/Move.toml +++ b/advanced-topics/closed_loop_token/example_projects/closed_loop_token/Move.toml @@ -1,6 +1,7 @@ [package] name = "closed_loop_token" version = "0.0.1" +edition = "2024.beta" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "devnet" } diff --git a/advanced-topics/closed_loop_token/example_projects/closed_loop_token/sources/parity.move b/advanced-topics/closed_loop_token/example_projects/closed_loop_token/sources/parity.move index 6d7b6fe..603637c 100644 --- a/advanced-topics/closed_loop_token/example_projects/closed_loop_token/sources/parity.move +++ b/advanced-topics/closed_loop_token/example_projects/closed_loop_token/sources/parity.move @@ -13,7 +13,7 @@ module closed_loop_token::parity { /// Name of the coin. By convention, this type has the same name as its parent module /// and has no fields. The full type of the coin defined by this module will be `COIN`. - struct PARITY has drop {} + public struct PARITY has drop {} /// Register the PARITY currency to acquire its `TreasuryCap`. Because /// this is a module initializer, it ensures the currency only gets @@ -21,7 +21,7 @@ module closed_loop_token::parity { fun init(witness: PARITY, ctx: &mut TxContext) { let (treasury_cap, metadata) = coin::create_currency(witness, 2, b"PARITY", b"MNG", b"", option::none(), ctx); transfer::public_freeze_object(metadata); - let (policy, policy_cap) = token::new_policy(&treasury_cap, ctx); + let (mut policy, policy_cap) = token::new_policy(&treasury_cap, ctx); token::add_rule_for_action(&mut policy, &policy_cap, utf8(b"from_coin"), ctx); token::share_policy(policy); transfer::public_transfer(policy_cap,tx_context::sender(ctx)); @@ -47,7 +47,7 @@ module closed_loop_token::parity { public fun policy_mint_token(treasury_cap: &mut TreasuryCap, policy: &TokenPolicy, amount: u64, ctx: &mut TxContext ) { let _coin = coin::mint(treasury_cap, amount, ctx); - let (_token, _request) = token::from_coin(_coin, ctx); + let (_token, mut _request) = token::from_coin(_coin, ctx); parity_rule::verify(policy, &mut _request, ctx); token::confirm_request(policy, _request, ctx); token::keep(_token, ctx) diff --git a/advanced-topics/closed_loop_token/example_projects/closed_loop_token/sources/parity_rule.move b/advanced-topics/closed_loop_token/example_projects/closed_loop_token/sources/parity_rule.move index 3f4a365..d0824c7 100644 --- a/advanced-topics/closed_loop_token/example_projects/closed_loop_token/sources/parity_rule.move +++ b/advanced-topics/closed_loop_token/example_projects/closed_loop_token/sources/parity_rule.move @@ -11,7 +11,7 @@ module closed_loop_token::parity_rule { const EWrongParity: u64 = 0; /// The Rule witness. - struct ParityRule has drop {} + public struct ParityRule has drop {} /// Verifies that the sender and the recipient (if set) are not on the /// denylist for the given action. diff --git a/advanced-topics/closed_loop_token/lessons/closed_loop_token.md b/advanced-topics/closed_loop_token/lessons/closed_loop_token.md index 4b3fb19..2acbd29 100644 --- a/advanced-topics/closed_loop_token/lessons/closed_loop_token.md +++ b/advanced-topics/closed_loop_token/lessons/closed_loop_token.md @@ -26,7 +26,7 @@ Protected actions generate an `ActionRequest` which need to be confirmed. ```rust - struct ActionRequest { + public struct ActionRequest { /// Name of the Action to look up in the Policy. Name can be one of the /// default actions: `transfer`, `spend`, `to_coin`, `from_coin` or a /// custom action. diff --git a/exercises/unit-four/locked_coin_df.move b/exercises/unit-four/locked_coin_df.move index 290dd04..181a110 100644 --- a/exercises/unit-four/locked_coin_df.move +++ b/exercises/unit-four/locked_coin_df.move @@ -9,14 +9,14 @@ module locked_coin::locked_coin_df { /// Shared objected used to attach the lockers /// - struct Registry has key { + public struct Registry has key { id: UID, metadata: CoinMetadata } - struct LOCKED_COIN has drop {} + public struct LOCKED_COIN has drop {} - struct Locker has store { + public struct Locker has store { start_date: u64, final_date: u64, original_balance: u64, diff --git a/unit-five/example_projects/flashloan/Move.toml b/unit-five/example_projects/flashloan/Move.toml index 524ad2a..44dfe59 100644 --- a/unit-five/example_projects/flashloan/Move.toml +++ b/unit-five/example_projects/flashloan/Move.toml @@ -1,6 +1,7 @@ [package] name = "flashloan" version = "0.0.1" +edition = "2024.beta" # edition = "2024.alpha" # To use the Move 2024 edition, currently in alpha # license = "" # e.g., "MIT", "GPL", "Apache 2.0" diff --git a/unit-five/example_projects/flashloan/sources/flashloan.move b/unit-five/example_projects/flashloan/sources/flashloan.move index f748d1a..6aedf7c 100644 --- a/unit-five/example_projects/flashloan/sources/flashloan.move +++ b/unit-five/example_projects/flashloan/sources/flashloan.move @@ -21,7 +21,7 @@ module flashloan::flashloan { /// A "shared" loan pool. /// For demonstration purpose, we assume the loan pool only allows SUI. - struct LoanPool has key { + public struct LoanPool has key { id: UID, amount: Balance, } @@ -29,12 +29,12 @@ module flashloan::flashloan { /// A loan position. /// This is a hot potato struct, it enforces the users /// to repay the loan in the end of the transaction or within the same PTB. - struct Loan { + public struct Loan { amount: u64, } /// A dummy NFT to represent the flashloan functionality - struct NFT has key{ + public struct NFT has key{ id: UID, price: Balance, } diff --git a/unit-five/example_projects/kiosk/Move.toml b/unit-five/example_projects/kiosk/Move.toml index 94ca44d..59f10a4 100644 --- a/unit-five/example_projects/kiosk/Move.toml +++ b/unit-five/example_projects/kiosk/Move.toml @@ -1,6 +1,7 @@ [package] name = "kiosk" version = "0.0.1" +edition = "2024.beta" # edition = "2024.alpha" # To use the Move 2024 edition, currently in alpha # license = "" # e.g., "MIT", "GPL", "Apache 2.0" diff --git a/unit-five/example_projects/kiosk/sources/dummy_policy.move b/unit-five/example_projects/kiosk/sources/dummy_policy.move index e8f8fe7..552e57b 100644 --- a/unit-five/example_projects/kiosk/sources/dummy_policy.move +++ b/unit-five/example_projects/kiosk/sources/dummy_policy.move @@ -15,11 +15,11 @@ module kiosk::dummy_rule { /// The Rule Witness; has no fields and is used as a /// static authorization method for the rule. - struct Rule has drop {} + public struct Rule has drop {} /// Configuration struct with any fields (as long as it /// has `drop`). Managed by the Rule module. - struct Config has store, drop {} + public struct Config has store, drop {} /// Function that adds a Rule to the `TransferPolicy`. /// Requires `TransferPolicyCap` to make sure the rules are diff --git a/unit-five/example_projects/kiosk/sources/fixed_royalty_rule.move b/unit-five/example_projects/kiosk/sources/fixed_royalty_rule.move index 536e6ea..2dd7599 100644 --- a/unit-five/example_projects/kiosk/sources/fixed_royalty_rule.move +++ b/unit-five/example_projects/kiosk/sources/fixed_royalty_rule.move @@ -22,10 +22,10 @@ module kiosk::fixed_royalty_rule { const MAX_BPS: u16 = 10_000; /// The Rule Witness to authorize the policy - struct Rule has drop {} + public struct Rule has drop {} /// Configuration for the Rule - struct Config has store, drop { + public struct Config has store, drop { /// Percentage of the transfer amount to be paid as royalty fee amount_bp: u16, /// This is used as royalty fee if the calculated fee is smaller than `min_amount` @@ -65,7 +65,7 @@ module kiosk::fixed_royalty_rule { /// Can be used dry-runned to estimate the fee amount based on the Kiosk listing price. public fun fee_amount(policy: &TransferPolicy, paid: u64): u64 { let config: &Config = transfer_policy::get_rule(Rule {}, policy); - let amount = (((paid as u128) * (config.amount_bp as u128) / 10_000) as u64); + let mut amount = (((paid as u128) * (config.amount_bp as u128) / 10_000) as u64); // If the amount is less than the minimum, use the minimum if (amount < config.min_amount) { diff --git a/unit-five/example_projects/kiosk/sources/kiosk.move b/unit-five/example_projects/kiosk/sources/kiosk.move index cc9d76c..c0daa8c 100644 --- a/unit-five/example_projects/kiosk/sources/kiosk.move +++ b/unit-five/example_projects/kiosk/sources/kiosk.move @@ -11,11 +11,11 @@ module kiosk::kiosk { use sui::package::{Self, Publisher}; use sui::transfer::{Self}; - struct TShirt has key, store { + public struct TShirt has key, store { id: UID, } - struct KIOSK has drop {} + public struct KIOSK has drop {} fun init(otw: KIOSK, ctx: &mut TxContext) { let publisher = package::claim(otw, ctx); diff --git a/unit-five/lessons/2_hot_potato_pattern.md b/unit-five/lessons/2_hot_potato_pattern.md index e0173ff..040fa21 100644 --- a/unit-five/lessons/2_hot_potato_pattern.md +++ b/unit-five/lessons/2_hot_potato_pattern.md @@ -20,7 +20,7 @@ module flashloan::flashloan { /// A "shared" loan pool. /// For demonstration purpose, we assume the loan pool only allows SUI. - struct LoanPool has key { + public struct LoanPool has key { id: UID, amount: Balance, } @@ -28,7 +28,7 @@ module flashloan::flashloan { /// A loan position. /// This is a hot potato struct, it enforces the users /// to repay the loan in the end of the transaction or within the same PTB. - struct Loan { + public struct Loan { amount: u64, } } @@ -77,7 +77,7 @@ Let's try to create an example with flashloan where we borrow some SUI amount, u ```move /// A dummy NFT to represent the flashloan functionality -struct NFT has key{ +public struct NFT has key{ id: UID, price: Balance, } diff --git a/unit-five/lessons/4_kiosk_basic_usage.md b/unit-five/lessons/4_kiosk_basic_usage.md index 5452268..a26e4e5 100644 --- a/unit-five/lessons/4_kiosk_basic_usage.md +++ b/unit-five/lessons/4_kiosk_basic_usage.md @@ -40,7 +40,7 @@ _💡Note: Kiosk is heterogeneous collection by default so that's why it doesn't ## Place Item inside Kiosk ```move -struct TShirt has key, store { +public struct TShirt has key, store { id: UID, } diff --git a/unit-five/lessons/5_transfer_policy.md b/unit-five/lessons/5_transfer_policy.md index d805cbc..d1cf151 100644 --- a/unit-five/lessons/5_transfer_policy.md +++ b/unit-five/lessons/5_transfer_policy.md @@ -13,7 +13,7 @@ use sui::transfer_policy::{Self, TransferRequest, TransferPolicy, TransferPolicy use sui::package::{Self, Publisher}; use sui::transfer::{Self}; -struct KIOSK has drop {} +public struct KIOSK has drop {} fun init(witness: KIOSK, ctx: &mut TxContext) { let publisher = package::claim(otw, ctx); @@ -67,10 +67,10 @@ module kiosk::fixed_royalty_rule { const MAX_BPS: u16 = 10_000; /// The Rule Witness to authorize the policy - struct Rule has drop {} + public struct Rule has drop {} /// Configuration for the Rule - struct Config has store, drop { + public struct Config has store, drop { /// Percentage of the transfer amount to be paid as royalty fee amount_bp: u16, /// This is used as royalty fee if the calculated fee is smaller than `min_amount` diff --git a/unit-four/example_projects/collections/Move.toml b/unit-four/example_projects/collections/Move.toml index 88ca123..7ca83ab 100644 --- a/unit-four/example_projects/collections/Move.toml +++ b/unit-four/example_projects/collections/Move.toml @@ -1,6 +1,7 @@ [package] name = "collection" version = "0.0.1" +edition = "2024.beta" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "devnet" } diff --git a/unit-four/example_projects/collections/sources/bag.move b/unit-four/example_projects/collections/sources/bag.move index b710999..76c029c 100644 --- a/unit-four/example_projects/collections/sources/bag.move +++ b/unit-four/example_projects/collections/sources/bag.move @@ -7,7 +7,7 @@ module collection::bag { use sui::tx_context::{TxContext}; // Defining a table with generic types for the key and value - struct GenericBag { + public struct GenericBag { items: Bag } diff --git a/unit-four/example_projects/collections/sources/dynamic_fields.move b/unit-four/example_projects/collections/sources/dynamic_fields.move index 3e0a3e6..2d4e75c 100644 --- a/unit-four/example_projects/collections/sources/dynamic_fields.move +++ b/unit-four/example_projects/collections/sources/dynamic_fields.move @@ -11,17 +11,17 @@ module collection::dynamic_fields { use sui::tx_context::{Self, TxContext}; // Parent struct - struct Parent has key { + public struct Parent has key { id: UID, } // Dynamic field child struct type containing a counter - struct DFChild has store { + public struct DFChild has store { count: u64 } // Dynamic object field child struct type containing a counter - struct DOFChild has key, store { + public struct DOFChild has key, store { id: UID, count: u64, } diff --git a/unit-four/example_projects/collections/sources/table.move b/unit-four/example_projects/collections/sources/table.move index b69bc82..83a4984 100644 --- a/unit-four/example_projects/collections/sources/table.move +++ b/unit-four/example_projects/collections/sources/table.move @@ -9,12 +9,12 @@ module collection::table { #[allow(unused_field)] // Defining a table with specified types for the key and value - struct IntegerTable { + public struct IntegerTable { table_values: Table } // Defining a table with generic types for the key and value - struct GenericTable { + public struct GenericTable { table_values: Table } diff --git a/unit-four/example_projects/collections/sources/vector.move b/unit-four/example_projects/collections/sources/vector.move index bc93662..d012ddd 100644 --- a/unit-four/example_projects/collections/sources/vector.move +++ b/unit-four/example_projects/collections/sources/vector.move @@ -6,17 +6,17 @@ module collection::vector { use std::vector; - struct Widget { + public struct Widget { } #[allow(unused_field)] // Vector for a specified type - struct WidgetVector { + public struct WidgetVector { widgets: vector } // Vector for a generic type - struct GenericVector { + public struct GenericVector { values: vector } diff --git a/unit-four/example_projects/marketplace/Move.toml b/unit-four/example_projects/marketplace/Move.toml index 8467fa8..846fe81 100644 --- a/unit-four/example_projects/marketplace/Move.toml +++ b/unit-four/example_projects/marketplace/Move.toml @@ -1,6 +1,7 @@ [package] name = "marketplace" version = "0.0.1" +edition = "2024.beta" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "devnet" } diff --git a/unit-four/example_projects/marketplace/sources/marketplace.move b/unit-four/example_projects/marketplace/sources/marketplace.move index 4598d1c..50607b8 100644 --- a/unit-four/example_projects/marketplace/sources/marketplace.move +++ b/unit-four/example_projects/marketplace/sources/marketplace.move @@ -21,7 +21,7 @@ module marketplace::marketplace { /// A shared `Marketplace`. Can be created by anyone using the /// `create` function. One instance of `Marketplace` accepts /// only one type of Coin - `COIN` for all its listings. - struct Marketplace has key { + public struct Marketplace has key { id: UID, items: Bag, payments: Table> @@ -29,7 +29,7 @@ module marketplace::marketplace { /// A single listing which contains the listed item and its /// price in [`Coin`]. - struct Listing has key, store { + public struct Listing has key, store { id: UID, ask: u64, owner: address, @@ -55,7 +55,7 @@ module marketplace::marketplace { ctx: &mut TxContext ) { let item_id = object::id(&item); - let listing = Listing { + let mut listing = Listing { ask, id: object::new(ctx), owner: tx_context::sender(ctx), @@ -72,7 +72,7 @@ module marketplace::marketplace { ctx: &TxContext ): T { let Listing { - id, + mut id, owner, ask: _, } = bag::remove(&mut marketplace.items, item_id); @@ -103,7 +103,7 @@ module marketplace::marketplace { paid: Coin, ): T { let Listing { - id, + mut id, ask, owner } = bag::remove(&mut marketplace.items, item_id); diff --git a/unit-four/example_projects/marketplace/sources/widget.move b/unit-four/example_projects/marketplace/sources/widget.move index 421a8bc..3a46aac 100644 --- a/unit-four/example_projects/marketplace/sources/widget.move +++ b/unit-four/example_projects/marketplace/sources/widget.move @@ -11,7 +11,7 @@ module marketplace::widget { use sui::transfer; use sui::tx_context::{Self, TxContext}; - struct Widget has key, store { + public struct Widget has key, store { id: UID, } diff --git a/unit-four/lessons/1_homogeneous_collections.md b/unit-four/lessons/1_homogeneous_collections.md index 0b454e8..307d184 100644 --- a/unit-four/lessons/1_homogeneous_collections.md +++ b/unit-four/lessons/1_homogeneous_collections.md @@ -13,16 +13,16 @@ module collection::vector { use std::vector; - struct Widget { + public struct Widget { } // Vector for a specified type - struct WidgetVector { + public struct WidgetVector { widgets: vector } // Vector for a generic type - struct GenericVector { + public struct GenericVector { values: vector } @@ -72,12 +72,12 @@ module collection::table { use sui::tx_context::{TxContext}; // Defining a table with specified types for the key and value - struct IntegerTable { + public struct IntegerTable { table_values: Table } // Defining a table with generic types for the key and value - struct GenericTable { + public struct GenericTable { table_values: Table } diff --git a/unit-four/lessons/2_dynamic_fields.md b/unit-four/lessons/2_dynamic_fields.md index 5e7c6fd..488bfc2 100644 --- a/unit-four/lessons/2_dynamic_fields.md +++ b/unit-four/lessons/2_dynamic_fields.md @@ -15,17 +15,17 @@ To illustrate how to work with dynamic fields, we define the following structs: ```rust // Parent struct - struct Parent has key { + public struct Parent has key { id: UID, } // Dynamic field child struct type containing a counter - struct DFChild has store { + public struct DFChild has store { count: u64 } // Dynamic object field child struct type containing a counter - struct DOFChild has key, store { + public struct DOFChild has key, store { id: UID, count: u64, } diff --git a/unit-four/lessons/3_heterogeneous_collections.md b/unit-four/lessons/3_heterogeneous_collections.md index 72dcfac..63b65ef 100644 --- a/unit-four/lessons/3_heterogeneous_collections.md +++ b/unit-four/lessons/3_heterogeneous_collections.md @@ -19,7 +19,7 @@ module collection::bag { use sui::tx_context::{TxContext}; // Defining a table with generic types for the key and value - struct GenericBag { + public struct GenericBag { items: Bag } diff --git a/unit-four/lessons/4_marketplace_contract.md b/unit-four/lessons/4_marketplace_contract.md index 94f102b..2673a19 100644 --- a/unit-four/lessons/4_marketplace_contract.md +++ b/unit-four/lessons/4_marketplace_contract.md @@ -14,7 +14,7 @@ First, we define the overall `Marketplace` struct: /// A shared `Marketplace`. Can be created by anyone using the /// `create` function. One instance of `Marketplace` accepts /// only one type of Coin - `COIN` for all its listings. - struct Marketplace has key { + public struct Marketplace has key { id: UID, items: Bag, payments: Table> @@ -34,7 +34,7 @@ Next, we define a `Listing` type: ```rust /// A single listing that contains the listed item and its /// price in [`Coin`]. - struct Listing has key, store { + public struct Listing has key, store { id: UID, ask: u64, owner: address, diff --git a/unit-four/lessons/5_deployment_and_testing.md b/unit-four/lessons/5_deployment_and_testing.md index b88d5e5..4de664b 100644 --- a/unit-four/lessons/5_deployment_and_testing.md +++ b/unit-four/lessons/5_deployment_and_testing.md @@ -11,7 +11,7 @@ module marketplace::widget { use sui::transfer; use sui::tx_context::{Self, TxContext}; - struct Widget has key, store { + public struct Widget has key, store { id: UID, } diff --git a/unit-one/example_projects/hello_world/Move.toml b/unit-one/example_projects/hello_world/Move.toml index cea21ec..4183bf3 100644 --- a/unit-one/example_projects/hello_world/Move.toml +++ b/unit-one/example_projects/hello_world/Move.toml @@ -1,6 +1,7 @@ [package] name = "hello_world" version = "0.0.1" +edition = "2024.beta" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "devnet" } diff --git a/unit-one/example_projects/hello_world/sources/hello_world.move b/unit-one/example_projects/hello_world/sources/hello_world.move index 85d1ff4..df433c4 100644 --- a/unit-one/example_projects/hello_world/sources/hello_world.move +++ b/unit-one/example_projects/hello_world/sources/hello_world.move @@ -12,7 +12,7 @@ module hello_world::hello_world { use sui::tx_context::{Self, TxContext}; /// An object that contains an arbitrary string - struct HelloWorldObject has key, store { + public struct HelloWorldObject has key, store { id: UID, /// A string contained in the object text: string::String diff --git a/unit-one/lessons/2_sui_project_structure.md b/unit-one/lessons/2_sui_project_structure.md index 27f69ec..aee0e91 100644 --- a/unit-one/lessons/2_sui_project_structure.md +++ b/unit-one/lessons/2_sui_project_structure.md @@ -52,6 +52,8 @@ This is the `Move.toml` generated by the Sui CLI with the package name `hello_wo [package] name = "hello_world" version = "0.0.1" +edition = "2024.beta" + [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" } diff --git a/unit-one/lessons/3_custom_types_and_abilities.md b/unit-one/lessons/3_custom_types_and_abilities.md index defa169..f2be831 100644 --- a/unit-one/lessons/3_custom_types_and_abilities.md +++ b/unit-one/lessons/3_custom_types_and_abilities.md @@ -64,7 +64,7 @@ We define the object in our Hello World example as the following: ```rust /// An object that contains an arbitrary string -struct HelloWorldObject has key, store { +public struct HelloWorldObject has key, store { id: UID, /// A string contained in the object text: string::String diff --git a/unit-one/lessons/4_functions.md b/unit-one/lessons/4_functions.md index 56be2a5..a539f71 100644 --- a/unit-one/lessons/4_functions.md +++ b/unit-one/lessons/4_functions.md @@ -8,7 +8,7 @@ Sui Move functions have three types of visibility: - **private**: the default visibility of a function; it can only be accessed by functions inside the same module - **public**: the function is accessible by functions inside the same module and by functions defined in another module -- **public(friend)**: the function is accessible by functions inside the same module and by functions defined in modules that are included on [the module's friends list](https://diem.github.io/move/friends.html). +- **public(package)**: the function is accessible by functions inside the same module ## Return Value diff --git a/unit-three/example_projects/fungible_tokens/Move.toml b/unit-three/example_projects/fungible_tokens/Move.toml index afafc65..250247f 100644 --- a/unit-three/example_projects/fungible_tokens/Move.toml +++ b/unit-three/example_projects/fungible_tokens/Move.toml @@ -1,6 +1,7 @@ [package] name = "fungible_tokens" version = "0.0.1" +edition = "2024.beta" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "devnet" } diff --git a/unit-three/example_projects/fungible_tokens/sources/managed.move b/unit-three/example_projects/fungible_tokens/sources/managed.move index 56b5cb8..bcb9adc 100644 --- a/unit-three/example_projects/fungible_tokens/sources/managed.move +++ b/unit-three/example_projects/fungible_tokens/sources/managed.move @@ -12,7 +12,7 @@ module fungible_tokens::managed { /// Name of the coin. By convention, this type has the same name as its parent module /// and has no fields. The full type of the coin defined by this module will be `COIN`. - struct MANAGED has drop {} + public struct MANAGED has drop {} /// Register the managed currency to acquire its `TreasuryCap`. Because /// this is a module initializer, it ensures the currency only gets diff --git a/unit-three/example_projects/fungible_tokens/sources/managed_tests.move b/unit-three/example_projects/fungible_tokens/sources/managed_tests.move index eee73cd..16275fc 100644 --- a/unit-three/example_projects/fungible_tokens/sources/managed_tests.move +++ b/unit-three/example_projects/fungible_tokens/sources/managed_tests.move @@ -14,7 +14,7 @@ module fungible_tokens::managed_tests { let addr1 = @0xA; // Begins a multi transaction scenario with addr1 as the sender - let scenario = test_scenario::begin(addr1); + let mut scenario = test_scenario::begin(addr1); // Run the managed coin module init function { @@ -24,7 +24,7 @@ module fungible_tokens::managed_tests { // Mint a `Coin` object next_tx(&mut scenario, addr1); { - let treasurycap = test_scenario::take_from_sender>(&scenario); + let mut treasurycap = test_scenario::take_from_sender>(&scenario); managed::mint(&mut treasurycap, 100, addr1, test_scenario::ctx(&mut scenario)); test_scenario::return_to_address>(addr1, treasurycap); }; @@ -33,7 +33,7 @@ module fungible_tokens::managed_tests { next_tx(&mut scenario, addr1); { let coin = test_scenario::take_from_sender>(&scenario); - let treasurycap = test_scenario::take_from_sender>(&scenario); + let mut treasurycap = test_scenario::take_from_sender>(&scenario); managed::burn(&mut treasurycap, coin); test_scenario::return_to_address>(addr1, treasurycap); }; diff --git a/unit-three/example_projects/generics/Move.toml b/unit-three/example_projects/generics/Move.toml index d8a3eff..55c7528 100644 --- a/unit-three/example_projects/generics/Move.toml +++ b/unit-three/example_projects/generics/Move.toml @@ -1,6 +1,7 @@ [package] name = "generics" version = "0.0.1" +edition = "2024.beta" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "devnet" } diff --git a/unit-three/example_projects/generics/sources/generics.move b/unit-three/example_projects/generics/sources/generics.move index b033dc2..cde020b 100644 --- a/unit-three/example_projects/generics/sources/generics.move +++ b/unit-three/example_projects/generics/sources/generics.move @@ -10,17 +10,17 @@ module generics::generics { use sui::object::{Self, UID}; use sui::tx_context::{Self, TxContext}; - struct Box has key, store { + public struct Box has key, store { id: UID, value: T } - struct SimpleBox has key, store { + public struct SimpleBox has key, store { id: UID, value: u8 } - struct PhantomBox has key { + public struct PhantomBox has key { id: UID, } diff --git a/unit-three/example_projects/witness/Move.toml b/unit-three/example_projects/witness/Move.toml index 261741d..df1f6ae 100644 --- a/unit-three/example_projects/witness/Move.toml +++ b/unit-three/example_projects/witness/Move.toml @@ -1,6 +1,7 @@ [package] name = "witness" version = "0.0.1" +edition = "2024.beta" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "devnet" } diff --git a/unit-three/example_projects/witness/sources/peace.move b/unit-three/example_projects/witness/sources/peace.move index b14c340..93ebd25 100644 --- a/unit-three/example_projects/witness/sources/peace.move +++ b/unit-three/example_projects/witness/sources/peace.move @@ -7,12 +7,12 @@ /// Phantom parameter T can only be initialized in the `create_guardian` /// function. But the types passed here must have `drop`. - struct Guardian has key, store { + public struct Guardian has key, store { id: UID } /// This type is the witness resource and is intended to be used only once. - struct PEACE has drop {} + public struct PEACE has drop {} /// The first argument of this function is an actual instance of the /// type T with `drop` ability. It is dropped as soon as received. diff --git a/unit-three/lessons/2_intro_to_generics.md b/unit-three/lessons/2_intro_to_generics.md index f8a2552..e3f77ed 100644 --- a/unit-three/lessons/2_intro_to_generics.md +++ b/unit-three/lessons/2_intro_to_generics.md @@ -14,7 +14,7 @@ First, without generics, we can define a `Box` that holds a `u64` type as the fo ```rust module generics::storage { - struct Box { + public struct Box { value: u64 } } @@ -24,7 +24,7 @@ However, this type will only be able to hold a value of type `u64`. To make our ```rust module generics::storage { - struct Box { + public struct Box { value: T } } @@ -37,7 +37,7 @@ We can add conditions to enforce that the type passed into the generic must have ```rust module generics::storage { // T must be copyable and droppable - struct Box has key, store { + public struct Box has key, store { value: T } } diff --git a/unit-three/lessons/3_witness_design_pattern.md b/unit-three/lessons/3_witness_design_pattern.md index 38b0321..1dcff46 100644 --- a/unit-three/lessons/3_witness_design_pattern.md +++ b/unit-three/lessons/3_witness_design_pattern.md @@ -20,12 +20,12 @@ The `witness` resource type must have the `drop` keyword so that this resource c /// Phantom parameter T can only be initialized in the `create_guardian` /// function. But the types passed here must have `drop`. - struct Guardian has key, store { + public struct Guardian has key, store { id: UID } /// This type is the witness resource and is intended to be used only once. - struct PEACE has drop {} + public struct PEACE has drop {} /// The first argument of this function is an actual instance of the /// type T with `drop` ability. It is dropped as soon as received. diff --git a/unit-three/lessons/4_the_coin_resource_and_create_currency.md b/unit-three/lessons/4_the_coin_resource_and_create_currency.md index d52dd22..3cafc2e 100644 --- a/unit-three/lessons/4_the_coin_resource_and_create_currency.md +++ b/unit-three/lessons/4_the_coin_resource_and_create_currency.md @@ -7,7 +7,7 @@ Now we know how generics and witness patterns work, let's revisit the `Coin` res Now we understand how generics work. We can revisit the `Coin` resource from `sui::coin`. It's [defined](https://github.com/MystenLabs/sui/blob/main/crates/sui-framework/packages/sui-framework/sources/coin.move#L28) as the following: ```rust -struct Coin has key, store { +public struct Coin has key, store { id: UID, balance: Balance } @@ -18,7 +18,7 @@ The `Coin` resource type is a struct that has a generic type `T` and two fields, `balance` is of the type [`sui::balance::Balance`](https://github.com/MystenLabs/sui/blob/main/crates/sui-framework/docs/sui-framework/balance.md#0x2_balance_Balance), and is [defined](https://github.com/MystenLabs/sui/blob/main/crates/sui-framework/packages/sui-framework/sources/balance.move#L29) as: ```rust -struct Balance has store { +public struct Balance has store { value: u64 } ``` @@ -77,7 +77,7 @@ The `TreasuryCap` is an asset and is guaranteed to be a singleton object by the ```rust /// Capability allowing the bearer to mint and burn /// coins of type `T`. Transferable - struct TreasuryCap has key, store { + public struct TreasuryCap has key, store { id: UID, total_supply: Supply } @@ -88,7 +88,7 @@ It wraps a singleton field `total_supply` of type `Balance::Supply`: ```rust /// A Supply of T. Used for minting and burning. /// Wrapped into a `TreasuryCap` in the `Coin` module. - struct Supply has store { + public struct Supply has store { value: u64 } ``` diff --git a/unit-three/lessons/6_clock_and_locked_coin.md b/unit-three/lessons/6_clock_and_locked_coin.md index 180d2da..6fb0424 100644 --- a/unit-three/lessons/6_clock_and_locked_coin.md +++ b/unit-three/lessons/6_clock_and_locked_coin.md @@ -27,7 +27,7 @@ Now that we know how to access time on-chain through `clock`, implementing a ves ```rust /// Transferrable object for storing the vesting coins /// - struct Locker has key, store { + public struct Locker has key, store { id: UID, start_date: u64, final_date: u64, diff --git a/unit-two/example_projects/transcript/Move.toml b/unit-two/example_projects/transcript/Move.toml index 2a86a08..f66066a 100644 --- a/unit-two/example_projects/transcript/Move.toml +++ b/unit-two/example_projects/transcript/Move.toml @@ -1,6 +1,7 @@ [package] name = "transcript" version = "0.0.1" +edition = "2024.beta" [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "devnet" } diff --git a/unit-two/example_projects/transcript/sources/transcript.move b/unit-two/example_projects/transcript/sources/transcript.move index 2c83f0c..5f1547b 100644 --- a/unit-two/example_projects/transcript/sources/transcript.move +++ b/unit-two/example_projects/transcript/sources/transcript.move @@ -11,25 +11,25 @@ module sui_intro_unit_two::transcript { use sui::transfer; use sui::event; - struct WrappableTranscript has key, store { + public struct WrappableTranscript has key, store { id: UID, history: u8, math: u8, literature: u8, } - struct Folder has key { + public struct Folder has key { id: UID, transcript: WrappableTranscript, intended_address: address } - struct TeacherCap has key { + public struct TeacherCap has key { id: UID } /// Event marking when a transcript has been requested - struct TranscriptRequestEvent has copy, drop { + public struct TranscriptRequestEvent has copy, drop { // The Object ID of the transcript wrapper wrapper_id: ID, // The requester of the transcript diff --git a/unit-two/lessons/1_working_with_sui_objects.md b/unit-two/lessons/1_working_with_sui_objects.md index ed41582..d52c02d 100644 --- a/unit-two/lessons/1_working_with_sui_objects.md +++ b/unit-two/lessons/1_working_with_sui_objects.md @@ -7,7 +7,7 @@ Sui Move is a fully object-centric language. Transactions on Sui are expressed a Let's first start with an example that represents a transcript recording a student's grades: ```rust -struct Transcript { +public struct Transcript { history: u8, math: u8, literature: u8, @@ -19,7 +19,7 @@ The above definition is a regular Move struct, but it is not a Sui object. In or ```rust use sui::object::{UID}; -struct TranscriptObject has key { +public struct TranscriptObject has key { id: UID, history: u8, math: u8, diff --git a/unit-two/lessons/4_object_wrapping.md b/unit-two/lessons/4_object_wrapping.md index 46b3e5d..79d28a1 100644 --- a/unit-two/lessons/4_object_wrapping.md +++ b/unit-two/lessons/4_object_wrapping.md @@ -5,13 +5,13 @@ There are multiple ways of nesting an object inside of another object in Sui Mov Let's continue our transcript example. We define a new `WrappableTranscript` type, and the associated wrapper type `Folder`. ```rust -struct WrappableTranscript has store { +public struct WrappableTranscript has store { history: u8, math: u8, literature: u8, } -struct Folder has key { +public struct Folder has key { id: UID, transcript: WrappableTranscript, } diff --git a/unit-two/lessons/5_object_wrapping_example.md b/unit-two/lessons/5_object_wrapping_example.md index 1e6612e..f813ae8 100644 --- a/unit-two/lessons/5_object_wrapping_example.md +++ b/unit-two/lessons/5_object_wrapping_example.md @@ -11,7 +11,7 @@ First, we need to make some adjustments to our two custom types `WrappableTransc Remember that custom types with the abilities `key` and `store` are considered to be assets in Sui Move. ```rust -struct WrappableTranscript has key, store { +public struct WrappableTranscript has key, store { id: UID, history: u8, math: u8, @@ -22,7 +22,7 @@ struct WrappableTranscript has key, store { 2. We need to add an additional field `intended_address` to the `Folder` struct that indicates the address of the intended viewer of the wrapped transcript. ``` rust -struct Folder has key { +public struct Folder has key { id: UID, transcript: WrappableTranscript, intended_address: address diff --git a/unit-two/lessons/6_capability_design_pattern.md b/unit-two/lessons/6_capability_design_pattern.md index 3ee528c..7929352 100644 --- a/unit-two/lessons/6_capability_design_pattern.md +++ b/unit-two/lessons/6_capability_design_pattern.md @@ -6,7 +6,7 @@ Capability is a commonly used pattern in Move that allows fine-tuned access cont ```rust // Type that marks the capability to create, update, and delete transcripts - struct TeacherCap has key { +public struct TeacherCap has key { id: UID } ``` diff --git a/unit-two/lessons/7_events.md b/unit-two/lessons/7_events.md index 33ba2b8..44bf758 100644 --- a/unit-two/lessons/7_events.md +++ b/unit-two/lessons/7_events.md @@ -14,7 +14,7 @@ Developers can also define custom events on Sui. We can define a custom event ma ```rust /// Event marking when a transcript has been requested - struct TranscriptRequestEvent has copy, drop { + public struct TranscriptRequestEvent has copy, drop { // The Object ID of the transcript wrapper wrapper_id: ID, // The requester of the transcript From a3f10cb785e7e0c566b9b056ec6d909db531b602 Mon Sep 17 00:00:00 2001 From: uvd <386180127@qq.com> Date: Mon, 6 May 2024 10:20:37 +0800 Subject: [PATCH 2/2] feat: move 2024 --- .github/scripts/check.sh | 3 +++ .../BCS_encoding/example_projects/bcs_move/Move.lock | 7 +++++++ .../example_projects/closed_loop_token/Move.lock | 7 ++++++- unit-five/example_projects/flashloan/Move.lock | 6 +++--- unit-five/example_projects/kiosk/Move.lock | 6 +++--- unit-four/example_projects/collections/Move.lock | 7 +++++++ unit-four/example_projects/marketplace/Move.lock | 9 +++++++-- unit-one/example_projects/hello_world/Move.lock | 9 +++++++-- unit-three/example_projects/fungible_tokens/Move.lock | 9 +++++++-- unit-three/example_projects/generics/Move.lock | 7 +++++++ unit-three/example_projects/witness/Move.lock | 7 +++++++ unit-two/example_projects/transcript/Move.lock | 9 +++++++-- 12 files changed, 71 insertions(+), 15 deletions(-) diff --git a/.github/scripts/check.sh b/.github/scripts/check.sh index 3382141..a46c609 100644 --- a/.github/scripts/check.sh +++ b/.github/scripts/check.sh @@ -8,7 +8,10 @@ unit-three/example_projects/generics unit-three/example_projects/witness unit-four/example_projects/collections unit-four/example_projects/marketplace +unit-five/example_projects/flashloan +unit-five/example_projects/kiosk advanced-topics/BCS_encoding/example_projects/bcs_move +advanced-topics/closed_loop_token/example_projects/closed_loop_token ); for(( i=0;i<${#project_path[@]};i++)) do diff --git a/advanced-topics/BCS_encoding/example_projects/bcs_move/Move.lock b/advanced-topics/BCS_encoding/example_projects/bcs_move/Move.lock index 9c3edf3..4c4ea43 100644 --- a/advanced-topics/BCS_encoding/example_projects/bcs_move/Move.lock +++ b/advanced-topics/BCS_encoding/example_projects/bcs_move/Move.lock @@ -6,6 +6,8 @@ version = 0 dependencies = [ { name = "Sui" }, ] +manifest_digest = "D8515C9CED37C781262CB3B844AD9552149EF9827C7FB372E2E62816F3C2C6BF" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" [[move.package]] name = "MoveStdlib" @@ -18,3 +20,8 @@ source = { git = "https://github.com/MystenLabs/sui.git", rev = "devnet", subdir dependencies = [ { name = "MoveStdlib" }, ] + +[move.toolchain-version] +compiler-version = "1.24.1" +edition = "2024.beta" +flavor = "sui" diff --git a/advanced-topics/closed_loop_token/example_projects/closed_loop_token/Move.lock b/advanced-topics/closed_loop_token/example_projects/closed_loop_token/Move.lock index 476dac0..f1b58d2 100644 --- a/advanced-topics/closed_loop_token/example_projects/closed_loop_token/Move.lock +++ b/advanced-topics/closed_loop_token/example_projects/closed_loop_token/Move.lock @@ -2,7 +2,7 @@ [move] version = 0 -manifest_digest = "CF46C9A24109CFA3F138893B30EFF8A8CC19F54F02054795330F54BB3B9444E3" +manifest_digest = "FA732D23F5DAE83F5EDEB8ED57934DBFEB20A1106C9F4F5972EFDCFBC8C31627" deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ @@ -20,3 +20,8 @@ source = { git = "https://github.com/MystenLabs/sui.git", rev = "devnet", subdir dependencies = [ { name = "MoveStdlib" }, ] + +[move.toolchain-version] +compiler-version = "1.24.1" +edition = "2024.beta" +flavor = "sui" diff --git a/unit-five/example_projects/flashloan/Move.lock b/unit-five/example_projects/flashloan/Move.lock index da55037..0eceb2b 100644 --- a/unit-five/example_projects/flashloan/Move.lock +++ b/unit-five/example_projects/flashloan/Move.lock @@ -2,7 +2,7 @@ [move] version = 0 -manifest_digest = "FC84CCD33DE1E9661DA31B49398152B41FB6772CFBCD634619716A9823846811" +manifest_digest = "5AF76D6421F742DE4D1F6175ED0F52E3A74B283CFD6DECAA7DABA5E9780D4107" deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ @@ -22,6 +22,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.21.0" -edition = "legacy" +compiler-version = "1.24.1" +edition = "2024.beta" flavor = "sui" diff --git a/unit-five/example_projects/kiosk/Move.lock b/unit-five/example_projects/kiosk/Move.lock index 1c1853c..e1fd0e8 100644 --- a/unit-five/example_projects/kiosk/Move.lock +++ b/unit-five/example_projects/kiosk/Move.lock @@ -2,7 +2,7 @@ [move] version = 0 -manifest_digest = "1FF626947D27118D75E5892ECC965B6EA5D58EF40C92513A237A9F1A2B5F5DDB" +manifest_digest = "00D2CACC4303A52D3E564B6DA3290FDA6A89B39D2820D120C2BE5B942BB863C3" deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ @@ -22,6 +22,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.21.0" -edition = "legacy" +compiler-version = "1.24.1" +edition = "2024.beta" flavor = "sui" diff --git a/unit-four/example_projects/collections/Move.lock b/unit-four/example_projects/collections/Move.lock index 9c3edf3..34e1e6a 100644 --- a/unit-four/example_projects/collections/Move.lock +++ b/unit-four/example_projects/collections/Move.lock @@ -6,6 +6,8 @@ version = 0 dependencies = [ { name = "Sui" }, ] +manifest_digest = "5C017484C02CE42775412AD1BB8BA5FDD8CF4E2C4CF09B901CD12A4A82547862" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" [[move.package]] name = "MoveStdlib" @@ -18,3 +20,8 @@ source = { git = "https://github.com/MystenLabs/sui.git", rev = "devnet", subdir dependencies = [ { name = "MoveStdlib" }, ] + +[move.toolchain-version] +compiler-version = "1.24.1" +edition = "2024.beta" +flavor = "sui" diff --git a/unit-four/example_projects/marketplace/Move.lock b/unit-four/example_projects/marketplace/Move.lock index e30b296..5f00177 100644 --- a/unit-four/example_projects/marketplace/Move.lock +++ b/unit-four/example_projects/marketplace/Move.lock @@ -2,8 +2,8 @@ [move] version = 0 -manifest_digest = "16991489A6123D6B6A2B2B00B9A075B52DF7A08BD4079E6D627C966AFC215ED6" -deps_digest = "112928C94A84031C09CD9B9D1D44B149B73FC0EEA5FA8D8B2D7CA4D91936335A" +manifest_digest = "1977009319D5BA9844DD3574762DA5DC8A0D33FBB1072997E2778507F428CDE9" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ { name = "Sui" }, @@ -20,3 +20,8 @@ source = { git = "https://github.com/MystenLabs/sui.git", rev = "devnet", subdir dependencies = [ { name = "MoveStdlib" }, ] + +[move.toolchain-version] +compiler-version = "1.24.1" +edition = "2024.beta" +flavor = "sui" diff --git a/unit-one/example_projects/hello_world/Move.lock b/unit-one/example_projects/hello_world/Move.lock index 10b84af..e192efc 100644 --- a/unit-one/example_projects/hello_world/Move.lock +++ b/unit-one/example_projects/hello_world/Move.lock @@ -2,8 +2,8 @@ [move] version = 0 -manifest_digest = "B2F8F93B84A84C2FCD809920ACF46C3381BC51B0764D78D4A97BB8C71F722F2B" -deps_digest = "112928C94A84031C09CD9B9D1D44B149B73FC0EEA5FA8D8B2D7CA4D91936335A" +manifest_digest = "DB072483FBDF525751B78403105D3DBE412A969F062ED443B19B657E3DEF7010" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ { name = "Sui" }, @@ -20,3 +20,8 @@ source = { git = "https://github.com/MystenLabs/sui.git", rev = "devnet", subdir dependencies = [ { name = "MoveStdlib" }, ] + +[move.toolchain-version] +compiler-version = "1.24.1" +edition = "2024.beta" +flavor = "sui" diff --git a/unit-three/example_projects/fungible_tokens/Move.lock b/unit-three/example_projects/fungible_tokens/Move.lock index 9499d3e..59d7278 100644 --- a/unit-three/example_projects/fungible_tokens/Move.lock +++ b/unit-three/example_projects/fungible_tokens/Move.lock @@ -2,8 +2,8 @@ [move] version = 0 -manifest_digest = "C16FF25ED360F469D919A97F7109D0292E4654BE1637C21125CBEF1F7A4E2407" -deps_digest = "112928C94A84031C09CD9B9D1D44B149B73FC0EEA5FA8D8B2D7CA4D91936335A" +manifest_digest = "4745002A00713707E8DC6DA15567DCC1137D1EF3B21C39042DD7AC25357D1C4B" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ { name = "Sui" }, @@ -20,3 +20,8 @@ source = { git = "https://github.com/MystenLabs/sui.git", rev = "devnet", subdir dependencies = [ { name = "MoveStdlib" }, ] + +[move.toolchain-version] +compiler-version = "1.24.1" +edition = "2024.beta" +flavor = "sui" diff --git a/unit-three/example_projects/generics/Move.lock b/unit-three/example_projects/generics/Move.lock index 9c3edf3..34ccb6a 100644 --- a/unit-three/example_projects/generics/Move.lock +++ b/unit-three/example_projects/generics/Move.lock @@ -6,6 +6,8 @@ version = 0 dependencies = [ { name = "Sui" }, ] +manifest_digest = "9D1225EE7AEADAEA7370D4A5F323DF879D52EA441C77BAE724668B824ACD6F00" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" [[move.package]] name = "MoveStdlib" @@ -18,3 +20,8 @@ source = { git = "https://github.com/MystenLabs/sui.git", rev = "devnet", subdir dependencies = [ { name = "MoveStdlib" }, ] + +[move.toolchain-version] +compiler-version = "1.24.1" +edition = "2024.beta" +flavor = "sui" diff --git a/unit-three/example_projects/witness/Move.lock b/unit-three/example_projects/witness/Move.lock index 9c3edf3..077bb2a 100644 --- a/unit-three/example_projects/witness/Move.lock +++ b/unit-three/example_projects/witness/Move.lock @@ -6,6 +6,8 @@ version = 0 dependencies = [ { name = "Sui" }, ] +manifest_digest = "73C565C7C3742B39E1F6295478D1AD69467B9FC094E41AFD447A2E2BED5A6E21" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" [[move.package]] name = "MoveStdlib" @@ -18,3 +20,8 @@ source = { git = "https://github.com/MystenLabs/sui.git", rev = "devnet", subdir dependencies = [ { name = "MoveStdlib" }, ] + +[move.toolchain-version] +compiler-version = "1.24.1" +edition = "2024.beta" +flavor = "sui" diff --git a/unit-two/example_projects/transcript/Move.lock b/unit-two/example_projects/transcript/Move.lock index 27222df..17b7c7d 100644 --- a/unit-two/example_projects/transcript/Move.lock +++ b/unit-two/example_projects/transcript/Move.lock @@ -2,8 +2,8 @@ [move] version = 0 -manifest_digest = "23A956CBD3A0A6C88F8E7EE5E0C622368C8252DC631EB64F274586C67B81D80A" -deps_digest = "112928C94A84031C09CD9B9D1D44B149B73FC0EEA5FA8D8B2D7CA4D91936335A" +manifest_digest = "21FECB6EE394281E3D78742791A3FBA04C0DAF8A5FDFE634B98FF14A4DE4BECF" +deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ { name = "Sui" }, @@ -20,3 +20,8 @@ source = { git = "https://github.com/MystenLabs/sui.git", rev = "devnet", subdir dependencies = [ { name = "MoveStdlib" }, ] + +[move.toolchain-version] +compiler-version = "1.24.1" +edition = "2024.beta" +flavor = "sui"