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

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
<100 subscribers
<100 subscribers
Share Dialog
Share Dialog


In this lecture, we will learn about types and abilities.
We will start with creating our Hello World demo contract step by step and explain fundamental concepts in Sui Move as they come up, such as custom types and abilities.
(If you skipped the previous section) You can initialize a Hello World Sui package with the following command in the command line after installing Sui binaries:
sui move new hello_world
Use an editor of your choice to create a Move smart contract source file called hello.move under the sources subfolder.
And create the empty module as following:
module hello_world::hello {
// module contents
}
Import Statements
You can directly import modules in Move by their address, but to make code easier to read, we can organize imports with the keyword use.
use <Address/Alias>::<ModuleName>;
In our example, we need to import the following modules:
use std::string;
use sui::object::{Self, UID};
use sui::transfer;
use sui::tx_context::{Self, TxContext};
Custom Types
A structure in Sui Move is a custom type that contains key-value pairs, where the key is the name of a property and the value is what's stored. Defined using keyword struct, a structure can have up to 4 abilities.
Abilities are keywords in Sui Move that define how types behave at the compiler level.
Abilities are crucial to defining how object behave in Sui Move at the language level. Each unique combination of abilities in Sui Move is its own design pattern. We will study abitilies and how to use them in Sui Move throughout the course.
For now, just know that there are four abilities in Sui Move:
Copy: value can be copied (or cloned by value)
Drop: value can be dropped by the end of scope
Key: value can be used as a key for global storage operations
Store: value can be stored inside global storage
Custom types that have the abilities key and store are considered to be assets in Sui Move. Assets are stored in global storage and can be transferred between accounts.
We define the object in our Hello World example as the following:
/// An object that contains an arbitrary string
struct HelloWorldObject has key, store {
id: UID,
/// A string contained in the object
text: string::String
}
UID here is a Sui Framework type (sui::object::UID) that defines the globally unique ID of an object. Any custom type with the key ability is required to have an ID field.
example
Rederence
In this lecture, we will learn about types and abilities.
We will start with creating our Hello World demo contract step by step and explain fundamental concepts in Sui Move as they come up, such as custom types and abilities.
(If you skipped the previous section) You can initialize a Hello World Sui package with the following command in the command line after installing Sui binaries:
sui move new hello_world
Use an editor of your choice to create a Move smart contract source file called hello.move under the sources subfolder.
And create the empty module as following:
module hello_world::hello {
// module contents
}
Import Statements
You can directly import modules in Move by their address, but to make code easier to read, we can organize imports with the keyword use.
use <Address/Alias>::<ModuleName>;
In our example, we need to import the following modules:
use std::string;
use sui::object::{Self, UID};
use sui::transfer;
use sui::tx_context::{Self, TxContext};
Custom Types
A structure in Sui Move is a custom type that contains key-value pairs, where the key is the name of a property and the value is what's stored. Defined using keyword struct, a structure can have up to 4 abilities.
Abilities are keywords in Sui Move that define how types behave at the compiler level.
Abilities are crucial to defining how object behave in Sui Move at the language level. Each unique combination of abilities in Sui Move is its own design pattern. We will study abitilies and how to use them in Sui Move throughout the course.
For now, just know that there are four abilities in Sui Move:
Copy: value can be copied (or cloned by value)
Drop: value can be dropped by the end of scope
Key: value can be used as a key for global storage operations
Store: value can be stored inside global storage
Custom types that have the abilities key and store are considered to be assets in Sui Move. Assets are stored in global storage and can be transferred between accounts.
We define the object in our Hello World example as the following:
/// An object that contains an arbitrary string
struct HelloWorldObject has key, store {
id: UID,
/// A string contained in the object
text: string::String
}
UID here is a Sui Framework type (sui::object::UID) that defines the globally unique ID of an object. Any custom type with the key ability is required to have an ID field.
example
Rederence
No activity yet