Skip to content

Instantly share code, notes, and snippets.

@ubinix-warun
Created May 17, 2024 08:50
Show Gist options
  • Save ubinix-warun/a8de0c0e92c69a7a397fd6ef1682da5f to your computer and use it in GitHub Desktop.
Save ubinix-warun/a8de0c0e92c69a7a397fd6ef1682da5f to your computer and use it in GitHub Desktop.

Revisions

  1. ubinix-warun created this gist May 17, 2024.
    29 changes: 29 additions & 0 deletions hello_world.move
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    // Copyright (c) 2022, Sui Foundation
    // SPDX-License-Identifier: Apache-2.0

    /// A basic Hello World example for Sui Move, part of the Sui Move intro course:
    /// https://github.com/sui-foundation/sui-move-intro-course
    ///
    module hello_world::hello_world {

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

    /// An object that contains an arbitrary string
    public struct HelloWorldObject has key, store {
    id: UID,
    /// A string contained in the object
    text: string::String
    }

    public entry 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));
    }

    }