Managing Modules and Packages

Move code is organized into modules and packages. Understanding how to structure, import, and publish your code is essential for building maintainable smart contracts.

  • A module is the basic unit of code organization -- a named collection of types, functions, and constants published at a specific address.
  • A package is a collection of modules along with a manifest (Move.toml) that specifies metadata and dependencies.

What You'll Learn

  1. Module Basics - Defining and structuring modules
  2. Module Imports - Using code from other modules
  3. Function Scopes - Visibility levels for functions
  4. Package Basics - The Move.toml manifest and project layout
  5. Package Dependencies - Adding and managing external dependencies
  6. Package Publishing - Deploying your code on-chain