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
- Module Basics - Defining and structuring modules
- Module Imports - Using code from other modules
- Function Scopes - Visibility levels for functions
- Package Basics - The
Move.tomlmanifest and project layout - Package Dependencies - Adding and managing external dependencies
- Package Publishing - Deploying your code on-chain