Sui Module

πŸš€ Your First Sui Module on M2 using Movement CLI

Install the Movement CLI

bash <(curl -fsSL --latest

Initialize your environment

You can now create a new sui move project with the following command:

movement sui move new hello_world

This will give you a folder to access into:

cd hello_world

Open it in your favorite editor:

code .

Create your move file:

touch sources/hello_world.move

Now you have the following folder structure:

/ sources

Inside hello_world.move you can paste the following code:


module hello_world::hello_world {

    use std::string;
    use sui::object::{Self, UID};
    use sui::transfer;
    use sui::tx_context::{Self, TxContext};

    struct HelloWorldObject has key, store {
        id: UID,
        text: string::String

    public fun mint(ctx: &mut TxContext) {
        let object = HelloWorldObject {
            id: object::new(ctx),
            text: string::utf8(b"Hello World!")
        transfer::public_transfer(object, tx_context::sender(ctx));


After building your project, you can deploy it to the M2 testnet:

movement sui client publish --gas-budget 20000000

The object ID under the Published Objects section is the ID of your module. You can now call the mint function on your module with that object ID:

movement sui client call --function mint --module hello_world --package <package object ID> --gas-budget 10000000

Don't forget to replace <package object ID> with the object ID of your module from previous console output!

Congratulations! You have just written, published, and executed your first SuiMove module on the testnet!

Last updated