
Sui Move Lecture #4 Functions and strings
In this lecture, we will talk about functions and strings in Sui Move. You can see the public functions of any packages with explorer.public functionsFunction VisibilitySui Move functions have three types of visibility:private: the default visibility of a function; it can only be accessed by functions inside the same modulepublic: the function is accessible by functions inside the same module, and by functions defined in another modulepublic(friend): the function is accessible by functions in...

Meet the Web3 Projects Building Smart Contracts on Bitcoin
For quite some time, the cryptocurrency ecosystem can be quickly summarized this way: you use Bitcoin to spend and store value, but you build apps that can increase this value on the Ethereum blockchain. But this year, several developers working on Bitcoin have launched breakthrough after breakthrough that would allow Bitcoin to also be the blockchain that you can use to build apps. While new features such as Ordinals and BRC-20 have gotten most of the spotlight, the Web3 movement that is wor...

Move Lecture #6 Unit Test
Hello, everyone! In today’s lecture, we will discuss the Sui Move unit test. Following our previous lectures, you should have a general idea about how to code with Sui Move. If you didn’t read the previous lectures, check out here.Why do we need unit test?Unit tests are necessary for smart contracts because they:Ensure correctness: By writing unit tests, developers can verify that their smart contracts perform as intended and handle various scenarios correctly.Identify bugs and vulnerabilitie...
Hello world! Follow us for tips and insights on branding, marketing, and entrepreneurship. Join us in creating the future of Web3.

Sui Move Lecture #4 Functions and strings
In this lecture, we will talk about functions and strings in Sui Move. You can see the public functions of any packages with explorer.public functionsFunction VisibilitySui Move functions have three types of visibility:private: the default visibility of a function; it can only be accessed by functions inside the same modulepublic: the function is accessible by functions inside the same module, and by functions defined in another modulepublic(friend): the function is accessible by functions in...

Meet the Web3 Projects Building Smart Contracts on Bitcoin
For quite some time, the cryptocurrency ecosystem can be quickly summarized this way: you use Bitcoin to spend and store value, but you build apps that can increase this value on the Ethereum blockchain. But this year, several developers working on Bitcoin have launched breakthrough after breakthrough that would allow Bitcoin to also be the blockchain that you can use to build apps. While new features such as Ordinals and BRC-20 have gotten most of the spotlight, the Web3 movement that is wor...

Move Lecture #6 Unit Test
Hello, everyone! In today’s lecture, we will discuss the Sui Move unit test. Following our previous lectures, you should have a general idea about how to code with Sui Move. If you didn’t read the previous lectures, check out here.Why do we need unit test?Unit tests are necessary for smart contracts because they:Ensure correctness: By writing unit tests, developers can verify that their smart contracts perform as intended and handle various scenarios correctly.Identify bugs and vulnerabilitie...
Hello world! Follow us for tips and insights on branding, marketing, and entrepreneurship. Join us in creating the future of Web3.

Subscribe to Artech.Club

Subscribe to Artech.Club
Share Dialog
Share Dialog


<100 subscribers
<100 subscribers
Following the introduction of lecture #1, let’s dive into the details of Sui Move language.
Move is a programming language designed specifically for the Libra blockchain, whereas Solidity is primarily used for developing smart contracts on the Ethereum blockchain. While both languages serve a similar purpose, their underlying blockchain platforms have different architectures and designs, which may impact the way developers use the languages.
Move and Solidity have different approaches to implementing smart contract functionality. Move uses resource types, which are special types of values that can only be owned by one account at a time. Solidity, on the other hand, uses an account-based model where each account has an associated balance and can perform actions on behalf of that account. This fundamental difference impacts the way smart contracts are designed and implemented in each language.
A Sui module is a set of functions and types packed together which the developer publishes under a specific address
The Sui standard library is published under the 0x2 address, while user-deployed modules are published under a pseudorandom address assigned by the Sui Move VM
Module starts with the module keyword, which is followed by module name and curly braces - inside them module contents are placed:
Example from explorer:
module hello_world {
// module contents
}
Published modules are immutable objects in Sui; an immutable object is an object that can never be mutated, transferred or deleted. Because of this immutability, the object is not owned by anyone, and hence it can be used by anyone
A Move package is just a collection of modules with a manifest file called Move.toml. Example:
Use the following Sui CLI command to start a skeleton Sui package:
sui move new <PACKAGE NAME>
For our example in this unit, we will start a Hello World project:
sui move new hello_world
This creates:
the project root folder hello_world
the Move.toml manifest file
the sources subfolder which will contain Sui Move smart contract source files

Move.toml is the manifest file of a package and is automatically generated in the project root folder.
Move.toml consists of three sections:
[package] Defines the name and version number of the package
[dependencies] Defines other packages that this package depends on, such as the Sui standard library; other third-party dependencies should be added here as well
[addresses] Defines aliases for addresses in the package source code
Sample Move.toml File
This is the Move.toml generated by the Sui CLI with the package name hello_world:
[package]
name = "hello_world"
version = "0.0.1"
[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet" }
[addresses]
hello_world = "0x0"
sui = "0000000000000000000000000000000000000000000000000000000000000002"
We see that the Sui standard library dependency here is defined using a GitHub repo, but it can also point to a local binary using its relative or absolute file path, for example:
[dependencies]
Sui = { local = "../sui/crates/sui-framework/packages/sui-framework" }
Sui Module and Package Naming
Sui Move module and package naming convention uses snake casing, i.e. this_is_snake_casing.
A Sui module name uses the Rust path separator :: to divide the package name and the module name, examples:
unit_one::hello_world - hello_world module in unit_one package
capy::capy - capy module in capy package
For more information on Move naming conventions, please check the style section of the Move book.
Examples from explorer:

Reference:
Following the introduction of lecture #1, let’s dive into the details of Sui Move language.
Move is a programming language designed specifically for the Libra blockchain, whereas Solidity is primarily used for developing smart contracts on the Ethereum blockchain. While both languages serve a similar purpose, their underlying blockchain platforms have different architectures and designs, which may impact the way developers use the languages.
Move and Solidity have different approaches to implementing smart contract functionality. Move uses resource types, which are special types of values that can only be owned by one account at a time. Solidity, on the other hand, uses an account-based model where each account has an associated balance and can perform actions on behalf of that account. This fundamental difference impacts the way smart contracts are designed and implemented in each language.
A Sui module is a set of functions and types packed together which the developer publishes under a specific address
The Sui standard library is published under the 0x2 address, while user-deployed modules are published under a pseudorandom address assigned by the Sui Move VM
Module starts with the module keyword, which is followed by module name and curly braces - inside them module contents are placed:
Example from explorer:
module hello_world {
// module contents
}
Published modules are immutable objects in Sui; an immutable object is an object that can never be mutated, transferred or deleted. Because of this immutability, the object is not owned by anyone, and hence it can be used by anyone
A Move package is just a collection of modules with a manifest file called Move.toml. Example:
Use the following Sui CLI command to start a skeleton Sui package:
sui move new <PACKAGE NAME>
For our example in this unit, we will start a Hello World project:
sui move new hello_world
This creates:
the project root folder hello_world
the Move.toml manifest file
the sources subfolder which will contain Sui Move smart contract source files

Move.toml is the manifest file of a package and is automatically generated in the project root folder.
Move.toml consists of three sections:
[package] Defines the name and version number of the package
[dependencies] Defines other packages that this package depends on, such as the Sui standard library; other third-party dependencies should be added here as well
[addresses] Defines aliases for addresses in the package source code
Sample Move.toml File
This is the Move.toml generated by the Sui CLI with the package name hello_world:
[package]
name = "hello_world"
version = "0.0.1"
[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet" }
[addresses]
hello_world = "0x0"
sui = "0000000000000000000000000000000000000000000000000000000000000002"
We see that the Sui standard library dependency here is defined using a GitHub repo, but it can also point to a local binary using its relative or absolute file path, for example:
[dependencies]
Sui = { local = "../sui/crates/sui-framework/packages/sui-framework" }
Sui Module and Package Naming
Sui Move module and package naming convention uses snake casing, i.e. this_is_snake_casing.
A Sui module name uses the Rust path separator :: to divide the package name and the module name, examples:
unit_one::hello_world - hello_world module in unit_one package
capy::capy - capy module in capy package
For more information on Move naming conventions, please check the style section of the Move book.
Examples from explorer:

Reference:
No activity yet