Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task3 #2162

Closed
wants to merge 2 commits into from
Closed

task3 #2162

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mover/liucanhui-eng/code/task1/hellomove/Move.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ flavor = "sui"

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0xfb25ea5f65dca98a2e8db4e30e5f9eaeb7dea459665c87d748d9f55eff01efa8"
latest-published-id = "0xfb25ea5f65dca98a2e8db4e30e5f9eaeb7dea459665c87d748d9f55eff01efa8"
original-published-id = "0xb9f46a12d0133883dd0a7f8699e138598573122d0cf36c9656da98b2cb1bbf4e"
latest-published-id = "0xb9f46a12d0133883dd0a7f8699e138598573122d0cf36c9656da98b2cb1bbf4e"
published-version = "1"
34 changes: 34 additions & 0 deletions mover/liucanhui-eng/code/task3/mynft/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# @generated by Move, please check-in and do not edit manually.

[move]
version = 3
manifest_digest = "DEDE53BD567ECEDC2009BE853A86F47F6BDC3F1F03A6B00FAED274F07E74A18B"
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
dependencies = [
{ id = "Sui", name = "Sui" },
]

[[move.package]]
id = "MoveStdlib"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/move-stdlib" }

[[move.package]]
id = "Sui"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/sui-framework" }

dependencies = [
{ id = "MoveStdlib", name = "MoveStdlib" },
]

[move.toolchain-version]
compiler-version = "1.37.1"
edition = "2024.beta"
flavor = "sui"

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0xcfffbe4676111dcf576760d50aeffc170eb74053cf2ef3136a4f4149b9d25f9e"
latest-published-id = "0xcfffbe4676111dcf576760d50aeffc170eb74053cf2ef3136a4f4149b9d25f9e"
published-version = "1"
37 changes: 37 additions & 0 deletions mover/liucanhui-eng/code/task3/mynft/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "task3"
edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move
# license = "" # e.g., "MIT", "GPL", "Apache 2.0"
# authors = ["..."] # e.g., ["Joe Smith ([email protected])", "John Snow ([email protected])"]

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" }

# For remote import, use the `{ git = "...", subdir = "...", rev = "..." }`.
# Revision can be a branch, a tag, and a commit hash.
# MyRemotePackage = { git = "https://some.remote/host.git", subdir = "remote/path", rev = "main" }

# For local dependencies use `local = path`. Path is relative to the package root
# Local = { local = "../path/to" }

# To resolve a version conflict and force a specific version for dependency
# override use `override = true`
# Override = { local = "../conflicting/version", override = true }

[addresses]
task3 = "0x0"

# Named addresses will be accessible in Move as `@name`. They're also exported:
# for example, `std = "0x1"` is exported by the Standard Library.
# alice = "0xA11CE"

[dev-dependencies]
# The dev-dependencies section allows overriding dependencies for `--test` and
# `--dev` modes. You can introduce test-only dependencies here.
# Local = { local = "../path/to/dev-build" }

[dev-addresses]
# The dev-addresses section allows overwriting named addresses for the `--test`
# and `--dev` modes.
# alice = "0xB0B"

27 changes: 27 additions & 0 deletions mover/liucanhui-eng/code/task3/mynft/sources/mynft.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#[allow(duplicate_alias)]
module task3::mynft;
// use std::ascii::String;

use std::string;
use std::string::String;
use sui::object::UID;
use sui::transfer::{transfer};

public struct NFT has key {
id: UID,
name : String,
link: String,
image_url: String,
description: String,
}

fun init(ctx : &mut TxContext){
let myNft2 = NFT{
id: object::new(ctx),
name : string::utf8(b"MY NFT2"),
link: string::utf8(b"https://images.pexels.com/photos/2174974/pexels-photo-2174974.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"),
image_url : string::utf8(b"https://images.pexels.com/photos/2174974/pexels-photo-2174974.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"),
description :string::utf8(b"MY NFT"),
};
transfer(myNft2,ctx.sender())
}
18 changes: 18 additions & 0 deletions mover/liucanhui-eng/code/task3/mynft/tests/mynft_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module mynft::mynft_tests;
// uncomment this line to import the module
// use mynft::mynft;

const ENotImplemented: u64 = 0;

#[test]
fun test_mynft() {
// pass
}

#[test, expected_failure(abort_code = ::mynft::mynft_tests::ENotImplemented)]
fun test_mynft_fail() {
abort ENotImplemented
}
*/
Binary file added mover/liucanhui-eng/images/nft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions mover/liucanhui-eng/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
- [] `Faucet Coin` address2 mint hash:

## 03 move NFT
- [] nft package id :
- [] nft object id :
- [] 转账 nft hash:
- [] scan上的NFT截图:![Scan截图](./images/你的图片地址)
- [x] nft package id : 0x91b384fbad1b710d3ee1856e4ae87f2d35aa89adfcdbc513bd874878d34711b1
- [x] nft object id : 0x918663d8f57fdec2b1dfb8215219a35a91aa93ba376562a3db7ba57fd627b3a6
- [x] 转账 nft hash: AuPfRWuXDupuHqpidh3niChTVesZZEHJT5gFgksM3Ahn
- [x] scan上的NFT截图:![Scan截图](./images/nft.png)

## 04 Move Game
- [] game package id :
Expand Down
Loading