Version 1 - mainnet - 0x02...55a0da
Readme
Versions
1
Dependencies
0
Dependents
0
Analytics
On the way
This is a simple "Hello World" smart contract example based on Sui Move. The contract allows users to send a "Hello" event, which is a basic example for learning Sui Move programming.
The contract mainly implements the following functions:
SayHello event structure containing the sender's addresssay_hello entry function that allows users to trigger an event containing their addresshello.move: Contains the main code of the contract, defines the event structure and interaction functionstests/hello_tests.move: Contains test code for the contractpublic struct SayHello has copy, drop {
author: address,
}
SayHello event structure stores the address of the user who triggered the eventcopy and drop abilities, allowing values of this type to be copied and discardedpublic entry fun say_hello(ctx: &mut TxContext) {
event::emit(SayHello {
author: tx_context::sender(ctx),
});
}
say_hello function allows users to send an eventsui move buildsui move testsui client publishsui client call --function say_hello --module hello --package <PACKAGE_ID> --gas-budget 10000000The project includes basic test cases that verify the core functionality of the contract. You can run the tests by executing sui move test.
You can install this package in your Move project by calling
mvr add @pkg/hello-worldhello world demo on SUi
0xdwong@gmail.com