Skip to main content
Modules are the fundamental building blocks of Move code on Sui. They encapsulate types, functions, and logic into reusable components.

Module Structure

Module Naming

Modules follow the format address::module_name:

Imports

Using Other Modules

Public Use (Re-exports)

Visibility

Init Function

The init function runs once when a module is published:
The init function receives a one-time witness (a struct with the same name as the module) that can be used for privileged operations like creating currencies.

Friend Modules

Package Organization

Packages contain multiple modules:

Move.toml

Best Practices

Move Overview

Learn Move basics

Move Functions

Understand functions

Move Abilities

Type abilities explained