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

完成task1、task7、task8 #2180

Merged
merged 3 commits into from
Dec 25, 2024
Merged
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
1 change: 1 addition & 0 deletions mover/xdd-object/code/task1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
37 changes: 37 additions & 0 deletions mover/xdd-object/code/task1/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "task1"
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://gitee.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]
task1 = "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"

100 changes: 100 additions & 0 deletions mover/xdd-object/code/task1/log
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
╭───────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Transaction Effects │
├───────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Digest: HS558k6ZuJ3Fg8UWwWQLV3aPcu8yvzPz3yyPogL9HVh2 │
│ Status: Success │
│ Executed Epoch: 588 │
│ │
│ Created Objects: │
│ ┌── │
│ │ ID: 0x2efb74165a368ebf4f041c1ee86f4e0ff7d08decdf8411ce38c65231a4f92d88 │
│ │ Owner: Account Address ( 0x0c651eb9cd6ffa4928b5a9481f09591834a68f452cfbb8932cd6ac3643a61eb2 ) │
│ │ Version: 268768490 │
│ │ Digest: DbSr7YiDUZ549at6hfHM9ZvK5ZNGM4yChm1CupXxdqEp │
│ └── │
│ ┌── │
│ │ ID: 0x98b379e2c8041537e8435a2242f6604b76592656ba53ceb07891141afc92bbf3 │
│ │ Owner: Immutable │
│ │ Version: 1 │
│ │ Digest: FSPTJEMEtpwnxCj3D2zL7piP3AABuetMs6biHYECrpZa │
│ └── │
│ ┌── │
│ │ ID: 0x9b6a0f49005eb3c160770c60e1a10fd1cc3f9d09ce2f767e95547a1a5623d66e │
│ │ Owner: Account Address ( 0x0c651eb9cd6ffa4928b5a9481f09591834a68f452cfbb8932cd6ac3643a61eb2 ) │
│ │ Version: 268768490 │
│ │ Digest: 5899c8ekbfQxjG3Y5G57CfFf5KBu6BzTwQJq7hP1tQQE │
│ └── │
│ Mutated Objects: │
│ ┌── │
│ │ ID: 0x026373cf3928b8e2a245fa272bee8c59b2f239a3672456cb44c39305c90c1cbd │
│ │ Owner: Account Address ( 0x0c651eb9cd6ffa4928b5a9481f09591834a68f452cfbb8932cd6ac3643a61eb2 ) │
│ │ Version: 268768490 │
│ │ Digest: 6Fv7jhdpFsZNTBabgeKn6mQ5RUTr5sZubp8EXnHtQsSj │
│ └── │
│ Gas Object: │
│ ┌── │
│ │ ID: 0x026373cf3928b8e2a245fa272bee8c59b2f239a3672456cb44c39305c90c1cbd │
│ │ Owner: Account Address ( 0x0c651eb9cd6ffa4928b5a9481f09591834a68f452cfbb8932cd6ac3643a61eb2 ) │
│ │ Version: 268768490 │
│ │ Digest: 6Fv7jhdpFsZNTBabgeKn6mQ5RUTr5sZubp8EXnHtQsSj │
│ └── │
│ Gas Cost Summary: │
│ Storage Cost: 8952800 MIST │
│ Computation Cost: 1000000 MIST │
│ Storage Rebate: 978120 MIST │
│ Non-refundable Storage Fee: 9880 MIST │
│ │
│ Transaction Dependencies: │
│ DcBq61iszHLsaSWto3LDhwTfsdLnzMFbahEmyLuGriUJ │
│ Gtwgse64nSVXhQvmqCpwCe5xJz9N4VypvEGJUy5DyG4e │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────────────╮
│ No transaction block events │
╰─────────────────────────────╯

╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Object Changes │
├──────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Created Objects: │
│ ┌── │
│ │ ObjectID: 0x2efb74165a368ebf4f041c1ee86f4e0ff7d08decdf8411ce38c65231a4f92d88 │
│ │ Sender: 0x0c651eb9cd6ffa4928b5a9481f09591834a68f452cfbb8932cd6ac3643a61eb2 │
│ │ Owner: Account Address ( 0x0c651eb9cd6ffa4928b5a9481f09591834a68f452cfbb8932cd6ac3643a61eb2 ) │
│ │ ObjectType: 0x2::package::UpgradeCap │
│ │ Version: 268768490 │
│ │ Digest: DbSr7YiDUZ549at6hfHM9ZvK5ZNGM4yChm1CupXxdqEp │
│ └── │
│ ┌── │
│ │ ObjectID: 0x9b6a0f49005eb3c160770c60e1a10fd1cc3f9d09ce2f767e95547a1a5623d66e │
│ │ Sender: 0x0c651eb9cd6ffa4928b5a9481f09591834a68f452cfbb8932cd6ac3643a61eb2 │
│ │ Owner: Account Address ( 0x0c651eb9cd6ffa4928b5a9481f09591834a68f452cfbb8932cd6ac3643a61eb2 ) │
│ │ ObjectType: 0x98b379e2c8041537e8435a2242f6604b76592656ba53ceb07891141afc92bbf3::task1::Hello │
│ │ Version: 268768490 │
│ │ Digest: 5899c8ekbfQxjG3Y5G57CfFf5KBu6BzTwQJq7hP1tQQE │
│ └── │
│ Mutated Objects: │
│ ┌── │
│ │ ObjectID: 0x026373cf3928b8e2a245fa272bee8c59b2f239a3672456cb44c39305c90c1cbd │
│ │ Sender: 0x0c651eb9cd6ffa4928b5a9481f09591834a68f452cfbb8932cd6ac3643a61eb2 │
│ │ Owner: Account Address ( 0x0c651eb9cd6ffa4928b5a9481f09591834a68f452cfbb8932cd6ac3643a61eb2 ) │
│ │ ObjectType: 0x2::coin::Coin<0x2::sui::SUI> │
│ │ Version: 268768490 │
│ │ Digest: 6Fv7jhdpFsZNTBabgeKn6mQ5RUTr5sZubp8EXnHtQsSj │
│ └── │
│ Published Objects: │
│ ┌── │
│ │ PackageID: 0x98b379e2c8041537e8435a2242f6604b76592656ba53ceb07891141afc92bbf3 │
│ │ Version: 1 │
│ │ Digest: FSPTJEMEtpwnxCj3D2zL7piP3AABuetMs6biHYECrpZa │
│ │ Modules: task1 │
│ └── │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Balance Changes │
├───────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ┌── │
│ │ Owner: Account Address ( 0x0c651eb9cd6ffa4928b5a9481f09591834a68f452cfbb8932cd6ac3643a61eb2 ) │
│ │ CoinType: 0x2::sui::SUI │
│ │ Amount: -8974680 │
│ └── │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯
26 changes: 26 additions & 0 deletions mover/xdd-object/code/task1/sources/task1.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

/// Module: task1
module task1::task1{
use std::ascii::{String, string};
use sui::object::{Self,UID};
use sui::transfer::transfer;
use sui::tx_context::{TxContext, sender};

public struct Hello has key{
id:UID,
say: String
}

fun init(ctx: &mut TxContext) {
let hello_move = Hello {
id:object::new(ctx),
say: string(b"hello xdd-object"),
};
transfer(hello_move, sender(ctx));
}
}

// For Move coding conventions, see
// https://docs.sui.io/concepts/sui-move-concepts/conventions


18 changes: 18 additions & 0 deletions mover/xdd-object/code/task1/tests/task1_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module task1::task1_tests;
// uncomment this line to import the module
// use task1::task1;

const ENotImplemented: u64 = 0;

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

#[test, expected_failure(abort_code = ::task1::task1_tests::ENotImplemented)]
fun test_task1_fail() {
abort ENotImplemented
}
*/
1 change: 1 addition & 0 deletions mover/xdd-object/code/task7/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
37 changes: 37 additions & 0 deletions mover/xdd-object/code/task7/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "task7"
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://gitee.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]
task7 = "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"

10 changes: 10 additions & 0 deletions mover/xdd-object/code/task7/call.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sui client call --package 包名 --module 模块名 --function 方法名 --args 权限id(TreasuryCap对应的id) 金额 地址

#调用方法
sui client call --package 0x99edc36bae9353eb8408a23a331aaf7d7fc04a4e7cb6c15aeda01ad6622d9877 --module check_in --function get_flag --args 0x345c44f0a5dd98de46bac518ac8fb640fc332ab217b44a7cb993958ed4fe705f "xdd-object" 0x876a6f2289917132e3ce9b7036872a0e21eb3e75211c9f546863532eca048250 0x8




sui client call --package 0x914099b4d1b4f5513acc8aaa4fdc1f67578522b81d818f61bae527d590c6d87d --module check_in --function get_flag --args 0xd660d5e3ce3b3f4519c90eaf599442e36a6d8555bb9f8578a83da9787e4b64a5 "xdd-object" 0xc8dcd54baa7724177593a9f70598a09ae6a4286f996542e058f248209db08147 0x8

Loading
Loading