Skip to content

Instantly share code, notes, and snippets.

@juzybits
Last active July 15, 2025 06:21
Show Gist options
  • Select an option

  • Save juzybits/af9b75f598c839e300ac433aa00f5dda to your computer and use it in GitHub Desktop.

Select an option

Save juzybits/af9b75f598c839e300ac433aa00f5dda to your computer and use it in GitHub Desktop.

Revisions

  1. juzybits revised this gist Jul 14, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion sui-move-ai-instructions.txt
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ Sui Move instructions (.move files):

    - Abilities are a Move typing feature that control what actions are permissible on a struct:
    - `key`: the struct can be used as a key in storage. If an struct does not have the key ability, it has to be stored under another struct or destroyed before the end of the transaction.
    - `store`: the struct can be stored in structs that have the key ability. Also relaxes transfer restrictions.
    - `store`: the struct can be stored inside other structs. It also relaxes transfer restrictions.
    - `drop`: the struct can be dropped or discarded. Simply allowing the object to go out of scope will destroy it.
    - `copy`: the struct can be copied.

  2. juzybits revised this gist Jul 14, 2025. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions sui-move-ai-instructions.txt
    Original file line number Diff line number Diff line change
    @@ -10,10 +10,10 @@ Sui Move instructions (.move files):
    - Immutable objects: like Shared objects, any address can use them, but they are read-only.

    - Abilities are a Move typing feature that control what actions are permissible on a struct:
    - `key`: the struct can be used as a key in a storage. If an struct does not have the key ability, it has to be stored under another struct or destroyed before the contract finishes execution.
    - `copy`: the struct can be copied.
    - `drop`: the struct can be dropped or discarded. Simply allowing the object to go out of scope will destroy it.
    - `key`: the struct can be used as a key in storage. If an struct does not have the key ability, it has to be stored under another struct or destroyed before the end of the transaction.
    - `store`: the struct can be stored in structs that have the key ability. Also relaxes transfer restrictions.
    - `drop`: the struct can be dropped or discarded. Simply allowing the object to go out of scope will destroy it.
    - `copy`: the struct can be copied.

    - Structs can only be created within the module that defines them. A module exposes functions to determine how its structs can be created, read, modified and destroyed.

  3. juzybits created this gist Jul 14, 2025.
    36 changes: 36 additions & 0 deletions sui-move-ai-instructions.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    Sui Move instructions (.move files):

    - Sui is an object-oriented blockchain. Sui smart contracts are written in the Move language.

    - Sui's object ownership model guarantees that the sender of a transaction has permission to use the objects it passes to functions as arguments.

    - Sui object ownership model in a nutshell:
    - Single owner objects: owned by a single address - granting it exclusive control over the object.
    - Shared objects: any address can use them in transactions and pass them to functions.
    - Immutable objects: like Shared objects, any address can use them, but they are read-only.

    - Abilities are a Move typing feature that control what actions are permissible on a struct:
    - `key`: the struct can be used as a key in a storage. If an struct does not have the key ability, it has to be stored under another struct or destroyed before the contract finishes execution.
    - `copy`: the struct can be copied.
    - `drop`: the struct can be dropped or discarded. Simply allowing the object to go out of scope will destroy it.
    - `store`: the struct can be stored in structs that have the key ability. Also relaxes transfer restrictions.

    - Structs can only be created within the module that defines them. A module exposes functions to determine how its structs can be created, read, modified and destroyed.

    - Similarly, the `transfer::transfer/share/freeze/receive/party_transfer` functions can only be called within the module that defines the struct being transferred. However, if the struct has the `store` ability, the `transfer::public_transfer/public_share/etc` functions can be called on that object from other modules.

    - All numbers are unsigned integers (u8, u16, u32, u64, u128, u256).

    - Functions calls are all or nothing (atomic). If there's an error, the transaction is reverted.

    - Race conditions are impossible.

    - It is allowed to compare a reference to a value using == or !=. The language automatically borrows the value if one operand is a reference and the other is not.

    - Integer overflows/underflows are automatically reverted. Any transaction that causes an integer overflow/underflow cannot succeed. E.g. `std::u64::max_value!() + 1` raises an arithmetic error.

    - Don't worry about "missing imports", because the compiler includes many std::/sui:: imports by default.

    - Don't worry about emitting additional events.

    - Prefer macros over constants.