Create a Move Package
Once you have installed IOTA, you are ready to create your first IOTA Move package. In IOTA, packages are the way to organize the modules that make up your smart contract program. When you publish a package to any IOTA network, it will be assigned an address you can use to interact with the package by issuing transactions.
Use the following command to create a standard package:
iota move new first_package
The command will create and populate the first_package
directory with a skeleton for an IOTA Move project,
consisting of the following files and directories:
Move.toml
The Move.toml
file is the package's manifest. It describes the package and its dependencies.
.toml
filesIn .toml
files, use the hash mark (#
) to denote a comment.
[package]
name = "first_package"
edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move
# license = "" # e.g., "MIT", "GPL", "Apache 2.0"
# authors = ["..."] # e.g., ["Joe Smith ([email protected])", "John Snow ([email protected])"]
[dependencies]
Iota = { git = "https://github.com/iotaledger/iota.git", subdir = "crates/iota-framework/packages/iota-framework", rev = "framework/testnet" }
# For remote import, use the `{ git = "...", subdir = "...", rev = "..." }`.
# Revision can be a branch, a tag, and a commit hash.
# MyRemotePackage = { git = "https://some.remote/host.git", subdir = "remote/path", rev = "main" }
# For local dependencies use `local = path`. Path is relative to the package root
# Local = { local = "../path/to" }
# To resolve a version conflict and force a specific version for dependency
# override use `override = true`
# Override = { local = "../conflicting/version", override = true }
[addresses]
first_package = "0x0"
# Named addresses will be accessible in Move as `@name`. They're also exported:
# for example, `std = "0x1"` is exported by the Standard Library.
# alice = "0xA11CE"
[dev-dependencies]
# The dev-dependencies section allows overriding dependencies for `--test` and
# `--dev` modes. You can introduce test-only dependencies here.
# Local = { local = "../path/to/dev-build" }
[dev-addresses]
# The dev-addresses section allows overwriting named addresses for the `--test`
# and `--dev` modes.
# alice = "0xB0B"
For local testnet development and testing it is recommended to use the local dependency of the Iota
framework for faster and more reliable builds. See the commented line in the example above as an example pointing towards your local checkout of the iota
repository.