Created
May 17, 2024 08:50
-
-
Save ubinix-warun/a8de0c0e92c69a7a397fd6ef1682da5f to your computer and use it in GitHub Desktop.
Revisions
-
ubinix-warun created this gist
May 17, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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)); } }