Join our
Discord!
LogoLogo
SupraScan ExplorerStarKey WalletDiscord
MoveVM
  • Network
  • Oracles
  • Automation
  • SupraNova
  • Guides
MoveVM
  • Overview
  • Getting Started
    • Install Supra CLI with Docker
    • Create a Supra Account
    • Create a Move Package
      • Initialize a Package
      • Write a Module
      • Compile and Publish
      • Interact with a Package
    • Create a dApp with StarKey
  • Network Information
  • Token Standards
  • Learn Move 101
    • Getting Started with Move
    • Unsigned Integers in Move
    • Math Operations in Move
    • Using Vectors in Move
    • Reading Resource Data with borrow_global
    • Passing Data in Move: Value vs. Reference
    • Adding Elements with vector::push_back
    • Emitting Events with event::emit
  • Move Book
    • Getting Started
      • Modules and Scripts
      • Move Tutorial
    • Primitive Types
      • Integers
      • Bool
      • Address
      • Vector
      • Signer
      • References
      • Tuples and Unit
    • Basic Concepts
      • Local Variables and Scope
      • Equality
      • Abort and Assert
      • Conditionals
      • While, For, and Loop
      • Functions
      • Structs and Resources
      • Constants
      • Generics
      • Type Abilities
      • Uses and Aliases
      • Friends
      • Packages
      • Package Upgrades
      • Unit Tests
    • Global Storage
      • Structure
      • Operators
    • Reference
      • Standard Library
      • Coding Conventions
  • TypeScript SDK
    • Guides
      • Create Supra Accounts
      • Publish a Package
    • Documentation
    • Repository
  • Rest API
    • Mainnet
      • Accounts
      • Faucet
      • Transactions
      • Block
      • View
      • Consensus
      • Events
      • Tables
    • Testnet
      • Accounts
      • Faucet
      • Transactions
      • Block
      • View
      • Events
      • Tables
  • Developer Resources
    • Supra Dapp Templates
    • Supra Move VS Code Extension
  • Links
    • Supra DevHub
    • SupraScan Block Explorer
    • StarKey Wallet
    • Live Data Feeds
    • Whitepapers
    • Security Audits
    • Supra's Official GitHub
Powered by GitBook
On this page
Edit on GitHub
  1. Getting Started
  2. Create a Move Package

Initialize a Package

Create and deploy your first move module.

PreviousCreate a Move PackageNextWrite a Module

Last updated 4 days ago

Initialize your move package

1

Create a new Move package

Executing the command without the --package-dir argument will initiatlize the package within your current working directory.

execute me!
supra move tool init --package-dir /supra/configs/move_workspace/exampleContract --name exampleContract

This will create your project directory, including a Move.toml file. This is a manifest file that contains important metadata about your package. This includes the package name, version, dependencies, named addresses, and more. The SupraFramework dependency is automatically populated. This framework includes core components that you will interact with during your time on Supra. The framework package includes clearly defined documentation within the /doc directory for you to review alongside the Move code within the /sources directory. You can view .

Move.toml
[package]
name = "exampleContract"
version = "1.0.0"
authors = []

[addresses]

[dev-addresses]

[dependencies.SupraFramework]
git = "https://github.com/Entropy-Foundation/aptos-core.git"
rev = "dev"
subdir = "aptos-move/framework/supra-framework"

[dev-dependencies]
2

Update the named addresses

Named addresses allow identifiers such as @exampleAddress to be used throughout your package, rather than hard coding an address value. When compiled into bytecode, any occurrence of the identifier such as @exampleAddress will be replaced with the set value below. For now, add the below named address to your Move.toml file and set the value to your address. We'll explain why in the next step.

You can view the address of your profiles by executing: supra profile -l

[addresses]
exampleAddress ="YOUR-ADDRESS-HERE"
this package here