Package Manifest
Package
The [package]
section is used to describe the package. None of the fields in this section are published on chain, but they are used in tooling and release management; they also specify the Move edition for the compiler.
name
- the name of the package when it is imported;version
- the version of the package, can be used in release management;edition
- the edition of the Move language; currently, the only valid value is2024
.
Dependencies
The [dependencies]
section is used to specify the dependencies of the project. Each dependency is specified as a key-value pair, where the key is the name of the dependency, and the value is the dependency specification. The dependency specification can be a git repository URL or a path to the local directory.
Packages also import addresses from other packages. For example, the Umi Network dependency adds the std
and sui
addresses to the project. These addresses can be used in the code as aliases for the addresses.
Resolving version conflicts with override
Sometimes dependencies have conflicting versions of the same package. For example, if you have two dependencies that use different versions of the Umi Network package, you can override the dependency in the [dependencies]
section. To do so, add the override
field to the dependency. The version of the dependency specified in the [dependencies]
section will be used instead of the one specified in the dependency itself.
Dev-dependencies
It is possible to add [dev-dependencies]
section to the manifest. It is used to override dependencies in the dev and test modes. For example, if you want to use a different version of the Umi Network package in the dev mode, you can add a custom dependency specification to the [dev-dependencies]
section.
Addresses
The [addresses]
section is used to add aliases for the addresses. Any address can be specified in this section, and then used in the code as an alias. For example, if you add alice = "0xA11CE"
to this section, you can use alice
as 0xA11CE
in the code.
Dev-addresses
The [dev-addresses]
section is the same as [addresses]
, but only works for the test and dev modes. Important to note that it is impossible to introduce new aliases in this section, only override the existing ones. So in the example above, if you add alice = "0xB0B"
to this section, the alice
address will be 0xB0B
in the test and dev modes, and 0xA11CE
in the regular build.
TOML styles
The TOML format supports two styles for tables: inline and multiline. The examples above are using the inline style, but it is also possible to use the multiline style. You wouldn't want to use it for the [package]
section, but it can be useful for the dependencies.
Address
Explanation of the address format and its usage in the Umi Network blockchain.
Package
Move is a language for writing smart contracts - programs that are stored and run on the blockchain. A single program is organized into a package. A package is published on the blockchain and is identified by an address. A published package can be interacted with by sending transactions calling its functions. It can also act as a dependency for other packages.