Skip to content

Commit fefaf9b

Browse files
committed
contracts
1 parent a0b57af commit fefaf9b

File tree

4 files changed

+120
-0
lines changed

4 files changed

+120
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# @generated by Move, please check-in and do not edit manually.
2+
3+
[move]
4+
version = 2
5+
manifest_digest = "6A910C2C8BDCE2F251724F36019452CA3B8DA26B5C036EC1F9172952CEC05624"
6+
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
7+
dependencies = [
8+
{ name = "Sui" },
9+
]
10+
11+
[[move.package]]
12+
name = "MoveStdlib"
13+
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/move-stdlib" }
14+
15+
[[move.package]]
16+
name = "Sui"
17+
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/sui-framework" }
18+
19+
dependencies = [
20+
{ name = "MoveStdlib" },
21+
]
22+
23+
[move.toolchain-version]
24+
compiler-version = "1.24.1"
25+
edition = "2024.beta"
26+
flavor = "sui"
27+
28+
[env]
29+
30+
[env.testnet]
31+
chain-id = "4c78adac"
32+
original-published-id = "0x3d74725bf9be7475c2371b2d8b5393ee99262760c35cb6427127b84b72b1fb83"
33+
latest-published-id = "0x3d74725bf9be7475c2371b2d8b5393ee99262760c35cb6427127b84b72b1fb83"
34+
published-version = "1"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[package]
2+
name = "hello_world"
3+
edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move
4+
# license = "" # e.g., "MIT", "GPL", "Apache 2.0"
5+
authors = ["chmod777john"] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"]
6+
7+
[dependencies]
8+
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" }
9+
10+
# For remote import, use the `{ git = "...", subdir = "...", rev = "..." }`.
11+
# Revision can be a branch, a tag, and a commit hash.
12+
# MyRemotePackage = { git = "https://some.remote/host.git", subdir = "remote/path", rev = "main" }
13+
14+
# For local dependencies use `local = path`. Path is relative to the package root
15+
# Local = { local = "../path/to" }
16+
17+
# To resolve a version conflict and force a specific version for dependency
18+
# override use `override = true`
19+
# Override = { local = "../conflicting/version", override = true }
20+
21+
[addresses]
22+
hello_world = "0x0"
23+
24+
# Named addresses will be accessible in Move as `@name`. They're also exported:
25+
# for example, `std = "0x1"` is exported by the Standard Library.
26+
# alice = "0xA11CE"
27+
28+
[dev-dependencies]
29+
# The dev-dependencies section allows overriding dependencies for `--test` and
30+
# `--dev` modes. You can introduce test-only dependencies here.
31+
# Local = { local = "../path/to/dev-build" }
32+
33+
[dev-addresses]
34+
# The dev-addresses section allows overwriting named addresses for the `--test`
35+
# and `--dev` modes.
36+
# alice = "0xB0B"
37+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (c) 2022, Sui Foundation
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
/// A basic Hello World example for Sui Move, part of the Sui Move intro course:
5+
/// https://github.com/sui-foundation/sui-move-intro-course
6+
///
7+
module hello_world::hello_world {
8+
9+
use std::string;
10+
use sui::object::{Self, UID};
11+
use sui::transfer;
12+
use sui::tx_context::{Self, TxContext};
13+
14+
/// An object that contains an arbitrary string
15+
public struct HelloWorldObject has key, store {
16+
id: UID,
17+
/// A string contained in the object
18+
text: string::String
19+
}
20+
21+
#[lint_allow(self_transfer)]
22+
public fun mint(ctx: &mut TxContext) {
23+
let object = HelloWorldObject {
24+
id: object::new(ctx),
25+
text: string::utf8(b"Hello, chmod777john")
26+
};
27+
transfer::public_transfer(object, tx_context::sender(ctx));
28+
}
29+
30+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
#[test_only]
3+
module hello_world::hello_world_tests {
4+
// uncomment this line to import the module
5+
// use hello_world::hello_world;
6+
7+
const ENotImplemented: u64 = 0;
8+
9+
#[test]
10+
fun test_hello_world() {
11+
// pass
12+
}
13+
14+
#[test, expected_failure(abort_code = ::hello_world::hello_world_tests::ENotImplemented)]
15+
fun test_hello_world_fail() {
16+
abort ENotImplemented
17+
}
18+
}
19+
*/

0 commit comments

Comments
 (0)