diff --git a/mover/fish-yan/coLearn2411/images/readme.md b/mover/fish-yan/coLearn2411/images/readme.md new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/mover/fish-yan/coLearn2411/images/readme.md @@ -0,0 +1 @@ + diff --git a/mover/fish-yan/coLearn2411/project/readme.md b/mover/fish-yan/coLearn2411/project/readme.md new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/mover/fish-yan/coLearn2411/project/readme.md @@ -0,0 +1 @@ + diff --git a/mover/fish-yan/coLearn2411/readme.md b/mover/fish-yan/coLearn2411/readme.md new file mode 100644 index 000000000..e20223a39 --- /dev/null +++ b/mover/fish-yan/coLearn2411/readme.md @@ -0,0 +1,53 @@ + + +## b站,推特关注 + +- [] b站,推特关注截图: ![关注截图](./images/你的图片地址) + +## 为共学营宣传(在朋友圈或者群聊中转发海报/文章) + +- [] 宣传截图:![宣传截图](./images/你的图片地址) + +## 每周课程学习 + +- [] 第一周:![学习记录截图](./images/你的图片地址) +- [] 第二周:![学习记录截图](./images/你的图片地址) +- [] 第三周:![学习记录截图](./images/你的图片地址) +- [] 第四周:![学习记录截图](./images/你的图片地址) + +## 参加直播答疑 + +- [] 第一周:![学习记录截图](./images/你的图片地址) +- [] 第二周:![学习记录截图](./images/你的图片地址) +- [] 第三周:![学习记录截图](./images/你的图片地址) +- [] 第四周:![学习记录截图](./images/你的图片地址) + +## 群里分享学习笔记 + +- [] 第一篇笔记 +- [] 第二篇笔记 +- [] 第三篇笔记 +- [] 第四篇笔记 + +## 对外输出学习笔记 + +- [] 第一篇笔记【学习笔记链接】 +- [] 第二篇笔记【学习笔记链接】 +- [] 第三篇笔记【学习笔记链接】 +- [] 第四篇笔记【学习笔记链接】 + +## 在HOH社区公众号发布自己的技术文章 + +- [] 第一篇笔记【公众号文章链接】 +- [] 第二篇笔记【公众号文章链接】 +- [] 第三篇笔记【公众号文章链接】 +- [] 第四篇笔记【公众号文章链接】 + +## 直播分享学习技巧/工具推荐 + +- [] 会议截图:![会议记录截图](./images/你的图片地址) + +## 提交项目 + +- [] 项目提交![项目截图](./images/你的图片地址) + diff --git a/mover/fish-yan/code/readme.md b/mover/fish-yan/code/readme.md new file mode 100644 index 000000000..e69de29bb diff --git a/mover/fish-yan/code/task1/hello_fish_yan/Move.lock b/mover/fish-yan/code/task1/hello_fish_yan/Move.lock new file mode 100644 index 000000000..295ffd408 --- /dev/null +++ b/mover/fish-yan/code/task1/hello_fish_yan/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "8A31BBDD996132C83274FEF69FD3F9CC1248BD1AA3E71325D13A38599008C0F5" +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.38.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0x3fb3fb0e02f78528803fdd392e77f0bc9312ef7c97203db29fe1f6d002b2d8ca" +latest-published-id = "0x3fb3fb0e02f78528803fdd392e77f0bc9312ef7c97203db29fe1f6d002b2d8ca" +published-version = "1" diff --git a/mover/fish-yan/code/task1/hello_fish_yan/Move.toml b/mover/fish-yan/code/task1/hello_fish_yan/Move.toml new file mode 100644 index 000000000..48ffb8ead --- /dev/null +++ b/mover/fish-yan/code/task1/hello_fish_yan/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "hello_fish_yan" +edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move +# license = "" # e.g., "MIT", "GPL", "Apache 2.0" +# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"] + +[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] +hello_fish_yan = "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" + diff --git a/mover/fish-yan/code/task1/hello_fish_yan/sources/hello_fish_yan.move b/mover/fish-yan/code/task1/hello_fish_yan/sources/hello_fish_yan.move new file mode 100644 index 000000000..49e33f013 --- /dev/null +++ b/mover/fish-yan/code/task1/hello_fish_yan/sources/hello_fish_yan.move @@ -0,0 +1,23 @@ +/* +/// Module: hello_fish_yan +module hello_fish_yan::hello_fish_yan; +*/ +module hello_fish_yan::hello_fish_yan { + 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 fish-yan"), + }; + transfer(hello_move, sender(ctx)); + } +} \ No newline at end of file diff --git a/mover/fish-yan/code/task1/hello_fish_yan/tests/hello_fish_yan_tests.move b/mover/fish-yan/code/task1/hello_fish_yan/tests/hello_fish_yan_tests.move new file mode 100644 index 000000000..cfc83a717 --- /dev/null +++ b/mover/fish-yan/code/task1/hello_fish_yan/tests/hello_fish_yan_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module hello_fish_yan::hello_fish_yan_tests; +// uncomment this line to import the module +// use hello_fish_yan::hello_fish_yan; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_hello_fish_yan() { + // pass +} + +#[test, expected_failure(abort_code = ::hello_fish_yan::hello_fish_yan_tests::ENotImplemented)] +fun test_hello_fish_yan_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/fish-yan/code/task2/fish_yan_coin/Move.lock b/mover/fish-yan/code/task2/fish_yan_coin/Move.lock new file mode 100644 index 000000000..149d7aff2 --- /dev/null +++ b/mover/fish-yan/code/task2/fish_yan_coin/Move.lock @@ -0,0 +1,40 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "145E5C78EB07690728DC57F119F2CCC4BCA6D0BAED21EBB71B1809FD4D703968" +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.38.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.testnet] +chain-id = "4c78adac" +original-published-id = "0xac3a134b4497789eca4f4a53828d4f6681cf9d0b7e78b4a43c6af289aaa5337e" +latest-published-id = "0xac3a134b4497789eca4f4a53828d4f6681cf9d0b7e78b4a43c6af289aaa5337e" +published-version = "1" + +[env.mainnet] +chain-id = "35834a8a" +original-published-id = "0x8b356127915437d3a1f2b80e3209775e79aeb08d4a0c5bcfba36187913912726" +latest-published-id = "0x8b356127915437d3a1f2b80e3209775e79aeb08d4a0c5bcfba36187913912726" +published-version = "1" diff --git a/mover/fish-yan/code/task2/fish_yan_coin/Move.toml b/mover/fish-yan/code/task2/fish_yan_coin/Move.toml new file mode 100644 index 000000000..a8cce964d --- /dev/null +++ b/mover/fish-yan/code/task2/fish_yan_coin/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "fish_yan_coin" +edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move +# license = "" # e.g., "MIT", "GPL", "Apache 2.0" +# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"] + +[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] +fish_yan_coin = "0x8b356127915437d3a1f2b80e3209775e79aeb08d4a0c5bcfba36187913912726" + +# 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" + diff --git a/mover/fish-yan/code/task2/fish_yan_coin/call.sh b/mover/fish-yan/code/task2/fish_yan_coin/call.sh new file mode 100644 index 000000000..b06e1b944 --- /dev/null +++ b/mover/fish-yan/code/task2/fish_yan_coin/call.sh @@ -0,0 +1,8 @@ +mint + +sui client call --gas-budget 100000000 \ +--package 0x2 \ +--module coin \ +--function mint_and_transfer \ +--type-args '0x8b356127915437d3a1f2b80e3209775e79aeb08d4a0c5bcfba36187913912726::fish_yan_coin::FISH_YAN_COIN' \ +--args 0x1af6bc51973213fc2263506f85ed6771f9a1c09801769e090211508dcdd175e9 1000000000 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd \ No newline at end of file diff --git a/mover/fish-yan/code/task2/fish_yan_coin/log.txt b/mover/fish-yan/code/task2/fish_yan_coin/log.txt new file mode 100644 index 000000000..442ddef9c --- /dev/null +++ b/mover/fish-yan/code/task2/fish_yan_coin/log.txt @@ -0,0 +1,157 @@ +Transaction Digest: xUMpxP7rb3sPrAZ3oyMHi15iv35nkPgL4kSTFEAWtzq +╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Transaction Data │ +├──────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ Gas Owner: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ Gas Budget: 100000000 MIST │ +│ Gas Price: 750 MIST │ +│ Gas Payment: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Version: 342813295 │ +│ │ Digest: En9JZUkHRSbbD9X2WYbXQvZtG5fzY9AjbMGnVAzXxcBB │ +│ └── │ +│ │ +│ Transaction Kind: Programmable │ +│ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ +│ │ Input Objects │ │ +│ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ +│ │ 0 Pure Arg: Type: address, Value: "0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd" │ │ +│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ +│ ╭─────────────────────────────────────────────────────────────────────────╮ │ +│ │ Commands │ │ +│ ├─────────────────────────────────────────────────────────────────────────┤ │ +│ │ 0 Publish: │ │ +│ │ ┌ │ │ +│ │ │ Dependencies: │ │ +│ │ │ 0x0000000000000000000000000000000000000000000000000000000000000001 │ │ +│ │ │ 0x0000000000000000000000000000000000000000000000000000000000000002 │ │ +│ │ └ │ │ +│ │ │ │ +│ │ 1 TransferObjects: │ │ +│ │ ┌ │ │ +│ │ │ Arguments: │ │ +│ │ │ Result 0 │ │ +│ │ │ Address: Input 0 │ │ +│ │ └ │ │ +│ ╰─────────────────────────────────────────────────────────────────────────╯ │ +│ │ +│ Signatures: │ +│ KZ2NdXhg0bpaYg77WEUkFnyT25tlj4MuJfHKAVEj9YXU5aKD55pjehTI4hb4b7ZmHQ2R0tDUweG0Cn0JGkP5Dw== │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Transaction Effects │ +├───────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Digest: xUMpxP7rb3sPrAZ3oyMHi15iv35nkPgL4kSTFEAWtzq │ +│ Status: Success │ +│ Executed Epoch: 606 │ +│ │ +│ Created Objects: │ +│ ┌── │ +│ │ ID: 0x1af6bc51973213fc2263506f85ed6771f9a1c09801769e090211508dcdd175e9 │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 342813296 │ +│ │ Digest: EXJMgry1tQrzQj4gspRrSb3NtGeZojdURbFdMCshNDbT │ +│ └── │ +│ ┌── │ +│ │ ID: 0x58aa126fa8690d00abed80bf600ca63c8b58432921c86d9be88f6125b7b3b223 │ +│ │ Owner: Immutable │ +│ │ Version: 342813296 │ +│ │ Digest: 4ot73FMjRwXWzVszoy9PhsAXUZAmZMX4U7cyE92egkTH │ +│ └── │ +│ ┌── │ +│ │ ID: 0x72dd538b4f13008aa08f8808808c3021ccb953cc3d7931220dd317c02ed792f2 │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 342813296 │ +│ │ Digest: 7RKPen6uzvpaqAcJsj1wMH7sVqsW2vPnmMcvSE8WVrR9 │ +│ └── │ +│ ┌── │ +│ │ ID: 0x8b356127915437d3a1f2b80e3209775e79aeb08d4a0c5bcfba36187913912726 │ +│ │ Owner: Immutable │ +│ │ Version: 1 │ +│ │ Digest: FomJh89L1n7YYbMjbRVRSNGbbfgVPNMBHL7rtz29UW7b │ +│ └── │ +│ Mutated Objects: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 342813296 │ +│ │ Digest: GYNLNAC1r743Zg2wzgwpZcr3q93HSrtT5cazrTskf7t9 │ +│ └── │ +│ Gas Object: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 342813296 │ +│ │ Digest: GYNLNAC1r743Zg2wzgwpZcr3q93HSrtT5cazrTskf7t9 │ +│ └── │ +│ Gas Cost Summary: │ +│ Storage Cost: 13300000 MIST │ +│ Computation Cost: 750000 MIST │ +│ Storage Rebate: 978120 MIST │ +│ Non-refundable Storage Fee: 9880 MIST │ +│ │ +│ Transaction Dependencies: │ +│ 9yiuqvKfVi3tXqDm3DfDMRcapojuyA5PWPbnvG1PhDgF │ +│ FPQJirZF6XaBX9wcmQbPUPPX9CzbpymnF3c8vtnpHqWt │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭─────────────────────────────╮ +│ No transaction block events │ +╰─────────────────────────────╯ + +╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Object Changes │ +├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Created Objects: │ +│ ┌── │ +│ │ ObjectID: 0x1af6bc51973213fc2263506f85ed6771f9a1c09801769e090211508dcdd175e9 │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::coin::TreasuryCap<0x8b356127915437d3a1f2b80e3209775e79aeb08d4a0c5bcfba36187913912726::fish_yan_coin::FISH_YAN_COIN> │ +│ │ Version: 342813296 │ +│ │ Digest: EXJMgry1tQrzQj4gspRrSb3NtGeZojdURbFdMCshNDbT │ +│ └── │ +│ ┌── │ +│ │ ObjectID: 0x58aa126fa8690d00abed80bf600ca63c8b58432921c86d9be88f6125b7b3b223 │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Immutable │ +│ │ ObjectType: 0x2::coin::CoinMetadata<0x8b356127915437d3a1f2b80e3209775e79aeb08d4a0c5bcfba36187913912726::fish_yan_coin::FISH_YAN_COIN> │ +│ │ Version: 342813296 │ +│ │ Digest: 4ot73FMjRwXWzVszoy9PhsAXUZAmZMX4U7cyE92egkTH │ +│ └── │ +│ ┌── │ +│ │ ObjectID: 0x72dd538b4f13008aa08f8808808c3021ccb953cc3d7931220dd317c02ed792f2 │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::package::UpgradeCap │ +│ │ Version: 342813296 │ +│ │ Digest: 7RKPen6uzvpaqAcJsj1wMH7sVqsW2vPnmMcvSE8WVrR9 │ +│ └── │ +│ Mutated Objects: │ +│ ┌── │ +│ │ ObjectID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::coin::Coin<0x2::sui::SUI> │ +│ │ Version: 342813296 │ +│ │ Digest: GYNLNAC1r743Zg2wzgwpZcr3q93HSrtT5cazrTskf7t9 │ +│ └── │ +│ Published Objects: │ +│ ┌── │ +│ │ PackageID: 0x8b356127915437d3a1f2b80e3209775e79aeb08d4a0c5bcfba36187913912726 │ +│ │ Version: 1 │ +│ │ Digest: FomJh89L1n7YYbMjbRVRSNGbbfgVPNMBHL7rtz29UW7b │ +│ │ Modules: fish_yan_coin │ +│ └── │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Balance Changes │ +├───────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ ┌── │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ CoinType: 0x2::sui::SUI │ +│ │ Amount: -13071880 │ +│ └── │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/mover/fish-yan/code/task2/fish_yan_coin/sources/fish_yan_coin.move b/mover/fish-yan/code/task2/fish_yan_coin/sources/fish_yan_coin.move new file mode 100644 index 000000000..4476d45e8 --- /dev/null +++ b/mover/fish-yan/code/task2/fish_yan_coin/sources/fish_yan_coin.move @@ -0,0 +1,24 @@ +/* +/// Module: fish_yan_coin +module fish_yan_coin::fish_yan_coin; +*/ +module fish_yan_coin::fish_yan_coin { + + use sui::coin; + + public struct FISH_YAN_COIN has drop {} + + fun init(witness: FISH_YAN_COIN, ctx: &mut TxContext) { + let (treasury_cap, coin_metadata) = coin::create_currency( + witness, + 9, + b"Fish Yan Coin", + b"Fish Yan Coin", + b"Fish Yan coin", + option::none(), + ctx + ); + transfer::public_freeze_object(coin_metadata); + transfer::public_transfer(treasury_cap, tx_context::sender(ctx)); + } +} diff --git a/mover/fish-yan/code/task2/fish_yan_coin/tests/fish_yan_coin_tests.move b/mover/fish-yan/code/task2/fish_yan_coin/tests/fish_yan_coin_tests.move new file mode 100644 index 000000000..372bdeeca --- /dev/null +++ b/mover/fish-yan/code/task2/fish_yan_coin/tests/fish_yan_coin_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module fish_yan_coin::fish_yan_coin_tests; +// uncomment this line to import the module +// use fish_yan_coin::fish_yan_coin; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_fish_yan_coin() { + // pass +} + +#[test, expected_failure(abort_code = ::fish_yan_coin::fish_yan_coin_tests::ENotImplemented)] +fun test_fish_yan_coin_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/fish-yan/code/task2/fish_yan_faucet/Move.lock b/mover/fish-yan/code/task2/fish_yan_faucet/Move.lock new file mode 100644 index 000000000..971d40a32 --- /dev/null +++ b/mover/fish-yan/code/task2/fish_yan_faucet/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "856E2D47DF888517A37FF0CBD31435ABA59EEF88D10EABB25C9160D871F719C9" +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.38.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.mainnet] +chain-id = "35834a8a" +original-published-id = "0x46a5b42763675e5032e2e89bcb8ed0944d1e7b2e39138e784813178ec1a18e51" +latest-published-id = "0x46a5b42763675e5032e2e89bcb8ed0944d1e7b2e39138e784813178ec1a18e51" +published-version = "1" diff --git a/mover/fish-yan/code/task2/fish_yan_faucet/Move.toml b/mover/fish-yan/code/task2/fish_yan_faucet/Move.toml new file mode 100644 index 000000000..5a96a87fb --- /dev/null +++ b/mover/fish-yan/code/task2/fish_yan_faucet/Move.toml @@ -0,0 +1,37 @@ +[package] +name = "fish_yan_faucet" +edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move +# license = "" # e.g., "MIT", "GPL", "Apache 2.0" +# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"] + +[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] +fish_yan_faucet = "0x46a5b42763675e5032e2e89bcb8ed0944d1e7b2e39138e784813178ec1a18e51" + +# 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" + diff --git a/mover/fish-yan/code/task2/fish_yan_faucet/call.sh b/mover/fish-yan/code/task2/fish_yan_faucet/call.sh new file mode 100644 index 000000000..5f7353347 --- /dev/null +++ b/mover/fish-yan/code/task2/fish_yan_faucet/call.sh @@ -0,0 +1,8 @@ +mint + +sui client call --gas-budget 100000000 \ +--package 0x2 \ +--module coin \ +--function mint_and_transfer \ +--type-args '0x46a5b42763675e5032e2e89bcb8ed0944d1e7b2e39138e784813178ec1a18e51::fish_yan_faucet::FISH_YAN_FAUCET' \ +--args 0x14561f41a4ccdc3e5990329ff20361a1c94c9384986544a55f293236409f289a 1000000000 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd \ No newline at end of file diff --git a/mover/fish-yan/code/task2/fish_yan_faucet/log.text b/mover/fish-yan/code/task2/fish_yan_faucet/log.text new file mode 100644 index 000000000..d96155a0a --- /dev/null +++ b/mover/fish-yan/code/task2/fish_yan_faucet/log.text @@ -0,0 +1,157 @@ +Transaction Digest: BENBv574puWHg5RBitKhJHrrRK8E46mc3nKejBLU6Evu +╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Transaction Data │ +├──────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ Gas Owner: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ Gas Budget: 100000000 MIST │ +│ Gas Price: 750 MIST │ +│ Gas Payment: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Version: 342813298 │ +│ │ Digest: G2brFWiLv76AvVtxQSvxiynCRL5vavwjowJoQGTCPik8 │ +│ └── │ +│ │ +│ Transaction Kind: Programmable │ +│ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ +│ │ Input Objects │ │ +│ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ +│ │ 0 Pure Arg: Type: address, Value: "0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd" │ │ +│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ +│ ╭─────────────────────────────────────────────────────────────────────────╮ │ +│ │ Commands │ │ +│ ├─────────────────────────────────────────────────────────────────────────┤ │ +│ │ 0 Publish: │ │ +│ │ ┌ │ │ +│ │ │ Dependencies: │ │ +│ │ │ 0x0000000000000000000000000000000000000000000000000000000000000001 │ │ +│ │ │ 0x0000000000000000000000000000000000000000000000000000000000000002 │ │ +│ │ └ │ │ +│ │ │ │ +│ │ 1 TransferObjects: │ │ +│ │ ┌ │ │ +│ │ │ Arguments: │ │ +│ │ │ Result 0 │ │ +│ │ │ Address: Input 0 │ │ +│ │ └ │ │ +│ ╰─────────────────────────────────────────────────────────────────────────╯ │ +│ │ +│ Signatures: │ +│ sN9TRBrlbQ+rXFyW4FDcjbOU/830/W8zCXWGD8wkDn3uoHzbIObHUujNRfvvSuBTraTI/kd0TRotw88GW2YrAg== │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Transaction Effects │ +├───────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Digest: BENBv574puWHg5RBitKhJHrrRK8E46mc3nKejBLU6Evu │ +│ Status: Success │ +│ Executed Epoch: 606 │ +│ │ +│ Created Objects: │ +│ ┌── │ +│ │ ID: 0x14561f41a4ccdc3e5990329ff20361a1c94c9384986544a55f293236409f289a │ +│ │ Owner: Shared( 342813299 ) │ +│ │ Version: 342813299 │ +│ │ Digest: 6PKriuMTsCsNvPJrxVVpZC47HE89Qpif8RFodZBuz6qX │ +│ └── │ +│ ┌── │ +│ │ ID: 0x46a5b42763675e5032e2e89bcb8ed0944d1e7b2e39138e784813178ec1a18e51 │ +│ │ Owner: Immutable │ +│ │ Version: 1 │ +│ │ Digest: HSrVyeWtTesspGbcudy6rE2McM4X1z98arQKJ1UGVUWg │ +│ └── │ +│ ┌── │ +│ │ ID: 0x8c87efb4c6ff72573b1a4ae70d7a7b0e745966b7ef01e4e24194c3c9439abab6 │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 342813299 │ +│ │ Digest: 5u1MPdTuZu6ZzhjuFCxBnWxK2s7w9j8G4kcFMUDgkvU │ +│ └── │ +│ ┌── │ +│ │ ID: 0xa4e10cd982fd684a29c77bc271f251a06686c11c95c6e78d80724cbce879fd8c │ +│ │ Owner: Immutable │ +│ │ Version: 342813299 │ +│ │ Digest: ELx4YHRDAu4rq3FomQaiH4cNxy7mGBy9pXpf13L217G1 │ +│ └── │ +│ Mutated Objects: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 342813299 │ +│ │ Digest: BuEDMTYSu5zjPQQgybt4qPooDWSbDP3y4cbjovZa4evp │ +│ └── │ +│ Gas Object: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 342813299 │ +│ │ Digest: BuEDMTYSu5zjPQQgybt4qPooDWSbDP3y4cbjovZa4evp │ +│ └── │ +│ Gas Cost Summary: │ +│ Storage Cost: 13634400 MIST │ +│ Computation Cost: 750000 MIST │ +│ Storage Rebate: 978120 MIST │ +│ Non-refundable Storage Fee: 9880 MIST │ +│ │ +│ Transaction Dependencies: │ +│ 6eZihPMkGHR6i8gSJ9zPWzkt9VZdkBVxkFrG8yX7N7R6 │ +│ FPQJirZF6XaBX9wcmQbPUPPX9CzbpymnF3c8vtnpHqWt │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭─────────────────────────────╮ +│ No transaction block events │ +╰─────────────────────────────╯ + +╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Object Changes │ +├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Created Objects: │ +│ ┌── │ +│ │ ObjectID: 0x14561f41a4ccdc3e5990329ff20361a1c94c9384986544a55f293236409f289a │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Shared( 342813299 ) │ +│ │ ObjectType: 0x2::coin::TreasuryCap<0x46a5b42763675e5032e2e89bcb8ed0944d1e7b2e39138e784813178ec1a18e51::fish_yan_faucet::FISH_YAN_FAUCET> │ +│ │ Version: 342813299 │ +│ │ Digest: 6PKriuMTsCsNvPJrxVVpZC47HE89Qpif8RFodZBuz6qX │ +│ └── │ +│ ┌── │ +│ │ ObjectID: 0x8c87efb4c6ff72573b1a4ae70d7a7b0e745966b7ef01e4e24194c3c9439abab6 │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::package::UpgradeCap │ +│ │ Version: 342813299 │ +│ │ Digest: 5u1MPdTuZu6ZzhjuFCxBnWxK2s7w9j8G4kcFMUDgkvU │ +│ └── │ +│ ┌── │ +│ │ ObjectID: 0xa4e10cd982fd684a29c77bc271f251a06686c11c95c6e78d80724cbce879fd8c │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Immutable │ +│ │ ObjectType: 0x2::coin::CoinMetadata<0x46a5b42763675e5032e2e89bcb8ed0944d1e7b2e39138e784813178ec1a18e51::fish_yan_faucet::FISH_YAN_FAUCET> │ +│ │ Version: 342813299 │ +│ │ Digest: ELx4YHRDAu4rq3FomQaiH4cNxy7mGBy9pXpf13L217G1 │ +│ └── │ +│ Mutated Objects: │ +│ ┌── │ +│ │ ObjectID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::coin::Coin<0x2::sui::SUI> │ +│ │ Version: 342813299 │ +│ │ Digest: BuEDMTYSu5zjPQQgybt4qPooDWSbDP3y4cbjovZa4evp │ +│ └── │ +│ Published Objects: │ +│ ┌── │ +│ │ PackageID: 0x46a5b42763675e5032e2e89bcb8ed0944d1e7b2e39138e784813178ec1a18e51 │ +│ │ Version: 1 │ +│ │ Digest: HSrVyeWtTesspGbcudy6rE2McM4X1z98arQKJ1UGVUWg │ +│ │ Modules: fish_yan_faucet │ +│ └── │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Balance Changes │ +├───────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ ┌── │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ CoinType: 0x2::sui::SUI │ +│ │ Amount: -13406280 │ +│ └── │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/mover/fish-yan/code/task2/fish_yan_faucet/sources/fish_yan_faucet.move b/mover/fish-yan/code/task2/fish_yan_faucet/sources/fish_yan_faucet.move new file mode 100644 index 000000000..416cda981 --- /dev/null +++ b/mover/fish-yan/code/task2/fish_yan_faucet/sources/fish_yan_faucet.move @@ -0,0 +1,25 @@ +/* +/// Module: fish_yan_faucet +module fish_yan_faucet::fish_yan_faucet; +*/ +module fish_yan_faucet::fish_yan_faucet { + + use sui::coin; + public struct FISH_YAN_FAUCET has drop {} + + fun init(witness: FISH_YAN_FAUCET, ctx: &mut TxContext) { + + let (treasury_cap, coin_metadata) = coin::create_currency( + witness, + 9, + b"Fish Yan Faucet", + b"Fish Yan Faucet Coin", + b"Fish Yan faucet coin", + option::none(), + ctx + ); + transfer::public_freeze_object(coin_metadata); + transfer::public_share_object(treasury_cap); + } + +} \ No newline at end of file diff --git a/mover/fish-yan/code/task2/fish_yan_faucet/tests/fish_yan_faucet_tests.move b/mover/fish-yan/code/task2/fish_yan_faucet/tests/fish_yan_faucet_tests.move new file mode 100644 index 000000000..65cdec814 --- /dev/null +++ b/mover/fish-yan/code/task2/fish_yan_faucet/tests/fish_yan_faucet_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module fish_yan_faucet::fish_yan_faucet_tests; +// uncomment this line to import the module +// use fish_yan_faucet::fish_yan_faucet; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_fish_yan_faucet() { + // pass +} + +#[test, expected_failure(abort_code = ::fish_yan_faucet::fish_yan_faucet_tests::ENotImplemented)] +fun test_fish_yan_faucet_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/fish-yan/code/task3/my_nft/Move.lock b/mover/fish-yan/code/task3/my_nft/Move.lock new file mode 100644 index 000000000..eb3d4963a --- /dev/null +++ b/mover/fish-yan/code/task3/my_nft/Move.lock @@ -0,0 +1,34 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "4C9B47E7441289AA0D50D87EEB9836BD01CE3604E3B249490E7F2046EAEE3400" +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.38.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.mainnet] +chain-id = "35834a8a" +original-published-id = "0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3" +latest-published-id = "0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3" +published-version = "1" diff --git a/mover/fish-yan/code/task3/my_nft/Move.toml b/mover/fish-yan/code/task3/my_nft/Move.toml new file mode 100644 index 000000000..12639a0ce --- /dev/null +++ b/mover/fish-yan/code/task3/my_nft/Move.toml @@ -0,0 +1,39 @@ +[package] +name = "my_nft" +version = "0.0.1" +publish-at = "0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3" +edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move +# license = "" # e.g., "MIT", "GPL", "Apache 2.0" +# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"] + +[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] +my_nft = "0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3" + +# 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" + diff --git a/mover/fish-yan/code/task3/my_nft/call.sh b/mover/fish-yan/code/task3/my_nft/call.sh new file mode 100644 index 000000000..db9641d35 --- /dev/null +++ b/mover/fish-yan/code/task3/my_nft/call.sh @@ -0,0 +1,6 @@ + +sui client call --gas-budget 100000000 \ +--package "0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3" \ +--module fish \ +--function mint \ +--args "fish-yan" "NFT for fish-yan" 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd \ No newline at end of file diff --git a/mover/fish-yan/code/task3/my_nft/log.txt b/mover/fish-yan/code/task3/my_nft/log.txt new file mode 100644 index 000000000..48efe22ff --- /dev/null +++ b/mover/fish-yan/code/task3/my_nft/log.txt @@ -0,0 +1,193 @@ +Transaction Digest: 75fVWWbMcRfa15snkje1WbEc6EUo88iLftsMK9qq3v4j +╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Transaction Data │ +├──────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ Gas Owner: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ Gas Budget: 100000000 MIST │ +│ Gas Price: 750 MIST │ +│ Gas Payment: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Version: 3150790 │ +│ │ Digest: CsMbKgz1k9jAS2oRyq5W7bVWmtL8Mbdw2LzoCSVJYQct │ +│ └── │ +│ │ +│ Transaction Kind: Programmable │ +│ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ +│ │ Input Objects │ │ +│ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ +│ │ 0 Pure Arg: Type: address, Value: "0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd" │ │ +│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ +│ ╭─────────────────────────────────────────────────────────────────────────╮ │ +│ │ Commands │ │ +│ ├─────────────────────────────────────────────────────────────────────────┤ │ +│ │ 0 Publish: │ │ +│ │ ┌ │ │ +│ │ │ Dependencies: │ │ +│ │ │ 0x0000000000000000000000000000000000000000000000000000000000000001 │ │ +│ │ │ 0x0000000000000000000000000000000000000000000000000000000000000002 │ │ +│ │ └ │ │ +│ │ │ │ +│ │ 1 TransferObjects: │ │ +│ │ ┌ │ │ +│ │ │ Arguments: │ │ +│ │ │ Result 0 │ │ +│ │ │ Address: Input 0 │ │ +│ │ └ │ │ +│ ╰─────────────────────────────────────────────────────────────────────────╯ │ +│ │ +│ Signatures: │ +│ 0wHgKcQILti7yduP8iqvQsrsJlf4255dYo0SFNOlAUGx4GI9dgVEDa4ihF7YU2kLtfRlaY8yRAYslEvgsezPAQ== │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Transaction Effects │ +├───────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Digest: 75fVWWbMcRfa15snkje1WbEc6EUo88iLftsMK9qq3v4j │ +│ Status: Success │ +│ Executed Epoch: 603 │ +│ │ +│ Created Objects: │ +│ ┌── │ +│ │ ID: 0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3 │ +│ │ Owner: Immutable │ +│ │ Version: 1 │ +│ │ Digest: JCctniAPk1ZkYkBXKZaVaRvVMn8TGFLP8jraBcomjv2v │ +│ └── │ +│ ┌── │ +│ │ ID: 0xa609f13222cec52a365dd3847d708008ca3b6e84d88cad64b5e068ddd76f322d │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 3150791 │ +│ │ Digest: 8pUgkuVAsEYaaAP31eWoXYnAtqn4LFCCDADPkKMEWMpN │ +│ └── │ +│ ┌── │ +│ │ ID: 0xd04d9e0587d9a5bdfb3f86e0b04b4a2b610fd1370a2901064f822a437ce59f15 │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 3150791 │ +│ │ Digest: H21m2VEdhShzU9xD4kpmDEE8audV9LXFwkVumXDbrc2z │ +│ └── │ +│ ┌── │ +│ │ ID: 0xd43c64e916f788d93fc952ef9b80a528d50eac0cbc5816693c1b0b664ff5e4aa │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 3150791 │ +│ │ Digest: 4SEf2B6Hh2SN2tbhCDCMzQDCipqDMKp4AutFy9cqHsej │ +│ └── │ +│ Mutated Objects: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 3150791 │ +│ │ Digest: 5jYn69dhGfGqz8FNRxVY1VnJsAhDnxPzhRTwXXn8y9xS │ +│ └── │ +│ Gas Object: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 3150791 │ +│ │ Digest: 5jYn69dhGfGqz8FNRxVY1VnJsAhDnxPzhRTwXXn8y9xS │ +│ └── │ +│ Gas Cost Summary: │ +│ Storage Cost: 15686400 MIST │ +│ Computation Cost: 750000 MIST │ +│ Storage Rebate: 978120 MIST │ +│ Non-refundable Storage Fee: 9880 MIST │ +│ │ +│ Transaction Dependencies: │ +│ CkHs1QTHGtPPGJ4fBpfHuhXcPJzGc5KH8DYn5rJHPeaP │ +│ FPQJirZF6XaBX9wcmQbPUPPX9CzbpymnF3c8vtnpHqWt │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Transaction Block Events │ +├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ ┌── │ +│ │ EventID: 75fVWWbMcRfa15snkje1WbEc6EUo88iLftsMK9qq3v4j:0 │ +│ │ PackageID: 0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3 │ +│ │ Transaction Module: fish │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ EventType: 0x2::display::DisplayCreated<0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3::fish::FISHNFT> │ +│ │ ParsedJSON: │ +│ │ ┌────┬────────────────────────────────────────────────────────────────────┐ │ +│ │ │ id │ 0xd04d9e0587d9a5bdfb3f86e0b04b4a2b610fd1370a2901064f822a437ce59f15 │ │ +│ │ └────┴────────────────────────────────────────────────────────────────────┘ │ +│ └── │ +│ ┌── │ +│ │ EventID: 75fVWWbMcRfa15snkje1WbEc6EUo88iLftsMK9qq3v4j:1 │ +│ │ PackageID: 0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3 │ +│ │ Transaction Module: fish │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ EventType: 0x2::display::VersionUpdated<0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3::fish::FISHNFT> │ +│ │ ParsedJSON: │ +│ │ ┌─────────┬──────────┬───────┬──────────────────────────────────────────────────────┐ │ +│ │ │ fields │ contents │ key │ name │ │ +│ │ │ │ ├───────┼──────────────────────────────────────────────────────┤ │ +│ │ │ │ │ value │ fish-yan │ │ +│ │ │ │ ├───────┼──────────────────────────────────────────────────────┤ │ +│ │ │ │ │ key │ description │ │ +│ │ │ │ ├───────┼──────────────────────────────────────────────────────┤ │ +│ │ │ │ │ value │ NFT for fish-yan │ │ +│ │ │ │ ├───────┼──────────────────────────────────────────────────────┤ │ +│ │ │ │ │ key │ image_url │ │ +│ │ │ │ ├───────┼──────────────────────────────────────────────────────┤ │ +│ │ │ │ │ value │ https://avatars.githubusercontent.com/u/15316488?v=4 │ │ +│ │ ├─────────┼──────────┴───────┴──────────────────────────────────────────────────────┤ │ +│ │ │ id │ 0xd04d9e0587d9a5bdfb3f86e0b04b4a2b610fd1370a2901064f822a437ce59f15 │ │ +│ │ ├─────────┼─────────────────────────────────────────────────────────────────────────┤ │ +│ │ │ version │ 1 │ │ +│ │ └─────────┴─────────────────────────────────────────────────────────────────────────┘ │ +│ └── │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Object Changes │ +├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Created Objects: │ +│ ┌── │ +│ │ ObjectID: 0xa609f13222cec52a365dd3847d708008ca3b6e84d88cad64b5e068ddd76f322d │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::package::UpgradeCap │ +│ │ Version: 3150791 │ +│ │ Digest: 8pUgkuVAsEYaaAP31eWoXYnAtqn4LFCCDADPkKMEWMpN │ +│ └── │ +│ ┌── │ +│ │ ObjectID: 0xd04d9e0587d9a5bdfb3f86e0b04b4a2b610fd1370a2901064f822a437ce59f15 │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::display::Display<0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3::fish::FISHNFT> │ +│ │ Version: 3150791 │ +│ │ Digest: H21m2VEdhShzU9xD4kpmDEE8audV9LXFwkVumXDbrc2z │ +│ └── │ +│ ┌── │ +│ │ ObjectID: 0xd43c64e916f788d93fc952ef9b80a528d50eac0cbc5816693c1b0b664ff5e4aa │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::package::Publisher │ +│ │ Version: 3150791 │ +│ │ Digest: 4SEf2B6Hh2SN2tbhCDCMzQDCipqDMKp4AutFy9cqHsej │ +│ └── │ +│ Mutated Objects: │ +│ ┌── │ +│ │ ObjectID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::coin::Coin<0x2::sui::SUI> │ +│ │ Version: 3150791 │ +│ │ Digest: 5jYn69dhGfGqz8FNRxVY1VnJsAhDnxPzhRTwXXn8y9xS │ +│ └── │ +│ Published Objects: │ +│ ┌── │ +│ │ PackageID: 0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3 │ +│ │ Version: 1 │ +│ │ Digest: JCctniAPk1ZkYkBXKZaVaRvVMn8TGFLP8jraBcomjv2v │ +│ │ Modules: fish │ +│ └── │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Balance Changes │ +├───────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ ┌── │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ CoinType: 0x2::sui::SUI │ +│ │ Amount: -15458280 │ +│ └── │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/mover/fish-yan/code/task3/my_nft/sources/my_nft.move b/mover/fish-yan/code/task3/my_nft/sources/my_nft.move new file mode 100644 index 000000000..2d5fe276d --- /dev/null +++ b/mover/fish-yan/code/task3/my_nft/sources/my_nft.move @@ -0,0 +1,46 @@ +/* +/// Module: my_nft +module my_nft::my_nft; +*/ +module my_nft::fish { + use sui::display; + use sui::package; + use std::string::{String, utf8}; + + public struct FISH has drop {} + + public struct FISHNFT has key, store { + id: UID, + name: String, + description: String, + } + + fun init(otw: FISH, ctx: &mut TxContext) { + let keys = vector[ + utf8(b"name"), + utf8(b"description"), + utf8(b"image_url") + ]; + let values = vector[ + utf8(b"fish-yan"), + utf8(b"NFT for fish-yan"), + utf8(b"https://avatars.githubusercontent.com/u/15316488?v=4") + ]; + let publisher = package::claim(otw, ctx); + let mut display = display::new_with_fields(&publisher, keys, values, ctx); + display::update_version(&mut display); + + let deployer = tx_context::sender(ctx); + transfer::public_transfer(publisher, deployer); + transfer::public_transfer(display, deployer); + } + + public entry fun mint(name: vector, description: vector, recipient: address, ctx: &mut TxContext) { + let nft = FISHNFT { + id: object::new(ctx), + name: utf8(name), + description: utf8(description), + }; + transfer::public_transfer(nft, recipient); + } +} \ No newline at end of file diff --git a/mover/fish-yan/code/task3/my_nft/tests/my_nft_tests.move b/mover/fish-yan/code/task3/my_nft/tests/my_nft_tests.move new file mode 100644 index 000000000..4f30419a2 --- /dev/null +++ b/mover/fish-yan/code/task3/my_nft/tests/my_nft_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module my_nft::my_nft_tests; +// uncomment this line to import the module +// use my_nft::my_nft; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_my_nft() { + // pass +} + +#[test, expected_failure(abort_code = ::my_nft::my_nft_tests::ENotImplemented)] +fun test_my_nft_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/fish-yan/code/task4/fish_yan_game/Move.lock b/mover/fish-yan/code/task4/fish_yan_game/Move.lock new file mode 100644 index 000000000..5e6a73a1b --- /dev/null +++ b/mover/fish-yan/code/task4/fish_yan_game/Move.lock @@ -0,0 +1,43 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "32D7EB84BA787C940966B7A39297C6EBED4C791C1FA0B5BC5D5C7657B965FB0B" +deps_digest = "3C4103934B1E040BB6B23F1D610B4EF9F2F1166A50A104EADCF77467C004C600" +dependencies = [ + { id = "Sui", name = "Sui" }, + { id = "fish_yan_faucet", name = "fish_yan_faucet" }, +] + +[[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.package]] +id = "fish_yan_faucet" +source = { local = "../../task2/fish_yan_faucet" } + +dependencies = [ + { id = "Sui", name = "Sui" }, +] + +[move.toolchain-version] +compiler-version = "1.38.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.mainnet] +chain-id = "35834a8a" +original-published-id = "0xd184632ebf05fa28b23e46ae5d6306c70a7badbe4a01a45896608e197ac8fe52" +latest-published-id = "0xd184632ebf05fa28b23e46ae5d6306c70a7badbe4a01a45896608e197ac8fe52" +published-version = "1" diff --git a/mover/fish-yan/code/task4/fish_yan_game/Move.toml b/mover/fish-yan/code/task4/fish_yan_game/Move.toml new file mode 100644 index 000000000..3456d5319 --- /dev/null +++ b/mover/fish-yan/code/task4/fish_yan_game/Move.toml @@ -0,0 +1,38 @@ +[package] +name = "fish_yan_game" +edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move +# license = "" # e.g., "MIT", "GPL", "Apache 2.0" +# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"] + +[dependencies] +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" } +fish_yan_faucet = { local = "../../task2/fish_yan_faucet" } + +# 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] +fish_yan_game = "0xd184632ebf05fa28b23e46ae5d6306c70a7badbe4a01a45896608e197ac8fe52" + +# 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" + diff --git a/mover/fish-yan/code/task4/fish_yan_game/call.sh b/mover/fish-yan/code/task4/fish_yan_game/call.sh new file mode 100644 index 000000000..835a84b3a --- /dev/null +++ b/mover/fish-yan/code/task4/fish_yan_game/call.sh @@ -0,0 +1,19 @@ +sui client call --gas-budget 100000000 \ +--package "0xd184632ebf05fa28b23e46ae5d6306c70a7badbe4a01a45896608e197ac8fe52" \ +--module fish_yan_game \ +--function deposit \ +--args 0xa43c3d1da6bdd20693473a83fa27f0dedf05659fe6257e46db76768875022b82 0xf64d0abdf490e13b80f325d2576a29ac2c067cb6791f8b9ecc89f2a6c7e4792b + + +sui client call --gas-budget 100000000 \ +--package "0xd184632ebf05fa28b23e46ae5d6306c70a7badbe4a01a45896608e197ac8fe52" \ +--module fish_yan_game \ +--function withdraw \ +--args 0xa43c3d1da6bdd20693473a83fa27f0dedf05659fe6257e46db76768875022b82 1000000000 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd + + +sui client call --gas-budget 100000000 \ +--package "0xd184632ebf05fa28b23e46ae5d6306c70a7badbe4a01a45896608e197ac8fe52" \ +--module fish_yan_game \ +--function play \ +--args 0xa43c3d1da6bdd20693473a83fa27f0dedf05659fe6257e46db76768875022b82 0xeb231e752651388dad54e8078e81c66cb0818e66ecd8adb5dd110fdd9cf13144 0x8 \ No newline at end of file diff --git a/mover/fish-yan/code/task4/fish_yan_game/log.txt b/mover/fish-yan/code/task4/fish_yan_game/log.txt new file mode 100644 index 000000000..9b2ef9e79 --- /dev/null +++ b/mover/fish-yan/code/task4/fish_yan_game/log.txt @@ -0,0 +1,159 @@ +Transaction Digest: ECD4a96L43Pfzn7zk8G4Ny9UM9BrZStZHMf6g7K2pinr +╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Transaction Data │ +├──────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ Gas Owner: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ Gas Budget: 100000000 MIST │ +│ Gas Price: 750 MIST │ +│ Gas Payment: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Version: 342813301 │ +│ │ Digest: EfBzmYXgxL9nrDgsEgBvckommvCMkuFJRXjCwG37ZkM │ +│ └── │ +│ │ +│ Transaction Kind: Programmable │ +│ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ +│ │ Input Objects │ │ +│ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ +│ │ 0 Pure Arg: Type: address, Value: "0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd" │ │ +│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ +│ ╭─────────────────────────────────────────────────────────────────────────╮ │ +│ │ Commands │ │ +│ ├─────────────────────────────────────────────────────────────────────────┤ │ +│ │ 0 Publish: │ │ +│ │ ┌ │ │ +│ │ │ Dependencies: │ │ +│ │ │ 0x0000000000000000000000000000000000000000000000000000000000000001 │ │ +│ │ │ 0x0000000000000000000000000000000000000000000000000000000000000002 │ │ +│ │ │ 0x46a5b42763675e5032e2e89bcb8ed0944d1e7b2e39138e784813178ec1a18e51 │ │ +│ │ └ │ │ +│ │ │ │ +│ │ 1 TransferObjects: │ │ +│ │ ┌ │ │ +│ │ │ Arguments: │ │ +│ │ │ Result 0 │ │ +│ │ │ Address: Input 0 │ │ +│ │ └ │ │ +│ ╰─────────────────────────────────────────────────────────────────────────╯ │ +│ │ +│ Signatures: │ +│ pHXmqvYLnQNPnOm7MuU77nzvR36dtWfznfjFKDYsJD1uJWr6oWXTDTUJYQ645orM46jdb10iAfn0Kgc7UTYqCg== │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Transaction Effects │ +├───────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Digest: ECD4a96L43Pfzn7zk8G4Ny9UM9BrZStZHMf6g7K2pinr │ +│ Status: Success │ +│ Executed Epoch: 606 │ +│ │ +│ Created Objects: │ +│ ┌── │ +│ │ ID: 0x8f7120cf4bf3fe743a62883d18f35d385a672f102a8492072a4e1e538dc48d2c │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 342813302 │ +│ │ Digest: HtYrznoGdKGnsHPNDUe4tFMKoZFUH19Gh9yxkiGsMZsp │ +│ └── │ +│ ┌── │ +│ │ ID: 0xa43c3d1da6bdd20693473a83fa27f0dedf05659fe6257e46db76768875022b82 │ +│ │ Owner: Shared( 342813302 ) │ +│ │ Version: 342813302 │ +│ │ Digest: J3x7NbkFC6LF9FHFFmFAkW9zso66M6NzL4pWJjr7JQr9 │ +│ └── │ +│ ┌── │ +│ │ ID: 0xca4a077c1756c60eb11fbbb39c0bed18fd572c2e9eeadb31f40c1532a1507121 │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 342813302 │ +│ │ Digest: DoKqF7KRoyHBJSHpSvcxzWTJCox1XZfNY6SsULLxrp6V │ +│ └── │ +│ ┌── │ +│ │ ID: 0xd184632ebf05fa28b23e46ae5d6306c70a7badbe4a01a45896608e197ac8fe52 │ +│ │ Owner: Immutable │ +│ │ Version: 1 │ +│ │ Digest: AhN4vVwqagQzgQZzDLBJczBitvn25q955JdbxuE2ShWV │ +│ └── │ +│ Mutated Objects: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 342813302 │ +│ │ Digest: 9ogQhGXaW2pc2gCZJKdYuvFE1qhKRbTk72YvQPeREKbH │ +│ └── │ +│ Gas Object: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 342813302 │ +│ │ Digest: 9ogQhGXaW2pc2gCZJKdYuvFE1qhKRbTk72YvQPeREKbH │ +│ └── │ +│ Gas Cost Summary: │ +│ Storage Cost: 16347600 MIST │ +│ Computation Cost: 750000 MIST │ +│ Storage Rebate: 978120 MIST │ +│ Non-refundable Storage Fee: 9880 MIST │ +│ │ +│ Transaction Dependencies: │ +│ 4YCwXNb2ShaqN56GzRzcprzjM2Pv3xuKbFp22EyTfSM7 │ +│ BENBv574puWHg5RBitKhJHrrRK8E46mc3nKejBLU6Evu │ +│ FPQJirZF6XaBX9wcmQbPUPPX9CzbpymnF3c8vtnpHqWt │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭─────────────────────────────╮ +│ No transaction block events │ +╰─────────────────────────────╯ + +╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Object Changes │ +├────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Created Objects: │ +│ ┌── │ +│ │ ObjectID: 0x8f7120cf4bf3fe743a62883d18f35d385a672f102a8492072a4e1e538dc48d2c │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0xd184632ebf05fa28b23e46ae5d6306c70a7badbe4a01a45896608e197ac8fe52::fish_yan_game::AdminCap │ +│ │ Version: 342813302 │ +│ │ Digest: HtYrznoGdKGnsHPNDUe4tFMKoZFUH19Gh9yxkiGsMZsp │ +│ └── │ +│ ┌── │ +│ │ ObjectID: 0xa43c3d1da6bdd20693473a83fa27f0dedf05659fe6257e46db76768875022b82 │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Shared( 342813302 ) │ +│ │ ObjectType: 0xd184632ebf05fa28b23e46ae5d6306c70a7badbe4a01a45896608e197ac8fe52::fish_yan_game::FishYanGame │ +│ │ Version: 342813302 │ +│ │ Digest: J3x7NbkFC6LF9FHFFmFAkW9zso66M6NzL4pWJjr7JQr9 │ +│ └── │ +│ ┌── │ +│ │ ObjectID: 0xca4a077c1756c60eb11fbbb39c0bed18fd572c2e9eeadb31f40c1532a1507121 │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::package::UpgradeCap │ +│ │ Version: 342813302 │ +│ │ Digest: DoKqF7KRoyHBJSHpSvcxzWTJCox1XZfNY6SsULLxrp6V │ +│ └── │ +│ Mutated Objects: │ +│ ┌── │ +│ │ ObjectID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::coin::Coin<0x2::sui::SUI> │ +│ │ Version: 342813302 │ +│ │ Digest: 9ogQhGXaW2pc2gCZJKdYuvFE1qhKRbTk72YvQPeREKbH │ +│ └── │ +│ Published Objects: │ +│ ┌── │ +│ │ PackageID: 0xd184632ebf05fa28b23e46ae5d6306c70a7badbe4a01a45896608e197ac8fe52 │ +│ │ Version: 1 │ +│ │ Digest: AhN4vVwqagQzgQZzDLBJczBitvn25q955JdbxuE2ShWV │ +│ │ Modules: fish_yan_game │ +│ └── │ +╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Balance Changes │ +├───────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ ┌── │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ CoinType: 0x2::sui::SUI │ +│ │ Amount: -16119480 │ +│ └── │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ \ No newline at end of file diff --git a/mover/fish-yan/code/task4/fish_yan_game/sources/fish_yan_game.move b/mover/fish-yan/code/task4/fish_yan_game/sources/fish_yan_game.move new file mode 100644 index 000000000..fe481ea83 --- /dev/null +++ b/mover/fish-yan/code/task4/fish_yan_game/sources/fish_yan_game.move @@ -0,0 +1,80 @@ +/* +/// Module: fish_yan_game +module fish_yan_game::fish_yan_game; +*/ +module fish_yan_game::fish_yan_game { + + use fish_yan_faucet::fish_yan_faucet::FISH_YAN_FAUCET; + use sui::balance; + use sui::balance::{Balance, zero}; + use sui::coin; + use sui::coin::{into_balance, from_balance}; + use sui::random; + use sui::random::Random; + use sui::transfer::{share_object, transfer, public_transfer}; + use sui::tx_context::sender; + + // ticket price + const TICKET_PRICE: u64 = 1_000_000_000; + + public struct FishYanGame has key { + id: UID, + pool: Balance, + } + + + public struct AdminCap has key { + id: UID, + } + + fun init(ctx: &mut TxContext) { + let game = FishYanGame { + id: object::new(ctx), + pool: zero(), + }; + + share_object(game); + + let admin = AdminCap { + id: object::new(ctx), + }; + + transfer(admin, sender(ctx)); + } + + public entry fun play( + game: &mut FishYanGame, + in: coin::Coin, + rand: &Random, + ctx: &mut TxContext + ) { + let in_val = coin::value(&in); + + assert!(in_val == TICKET_PRICE, 0); + + deposit(game, in, ctx); + // generate random + let mut gen = random::new_generator(rand, ctx); + + let number = random::generate_u8_in_range(&mut gen, 0, 5); + let mut _amount: u64 = 0; + if (number < 3) { + _amount = 0; + }else { + _amount = 2000_000_000; + }; + withdraw(game, _amount, sender(ctx), ctx) + } + + public entry fun deposit(game: &mut FishYanGame, in: coin::Coin, ctx: &mut TxContext) { + let in_balance = into_balance(in); + balance::join(&mut game.pool, in_balance); + } + + public entry fun withdraw(game: &mut FishYanGame, amount: u64, to: address, ctx: &mut TxContext) { + let out_balance = balance::split(&mut game.pool, amount); + let out_coin = from_balance(out_balance, ctx); + public_transfer(out_coin, to); + } + +} diff --git a/mover/fish-yan/code/task4/fish_yan_game/tests/fish_yan_game_tests.move b/mover/fish-yan/code/task4/fish_yan_game/tests/fish_yan_game_tests.move new file mode 100644 index 000000000..4a21b91f9 --- /dev/null +++ b/mover/fish-yan/code/task4/fish_yan_game/tests/fish_yan_game_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module fish_yan_game::fish_yan_game_tests; +// uncomment this line to import the module +// use fish_yan_game::fish_yan_game; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_fish_yan_game() { + // pass +} + +#[test, expected_failure(abort_code = ::fish_yan_game::fish_yan_game_tests::ENotImplemented)] +fun test_fish_yan_game_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/fish-yan/code/task5/fish_yan_swap/Move.lock b/mover/fish-yan/code/task5/fish_yan_swap/Move.lock new file mode 100644 index 000000000..b2d1dff18 --- /dev/null +++ b/mover/fish-yan/code/task5/fish_yan_swap/Move.lock @@ -0,0 +1,52 @@ +# @generated by Move, please check-in and do not edit manually. + +[move] +version = 3 +manifest_digest = "E0DB2B90FB8DE2754E53B3601503F3FA57DE2348C8D802FBB8A26BE2A2123C39" +deps_digest = "060AD7E57DFB13104F21BE5F5C3759D03F0553FC3229247D9A7A6B45F50D03A3" +dependencies = [ + { id = "Sui", name = "Sui" }, + { id = "fish_yan_coin", name = "fish_yan_coin" }, + { id = "fish_yan_faucet", name = "fish_yan_faucet" }, +] + +[[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.package]] +id = "fish_yan_coin" +source = { local = "../../task2/fish_yan_coin" } + +dependencies = [ + { id = "Sui", name = "Sui" }, +] + +[[move.package]] +id = "fish_yan_faucet" +source = { local = "../../task2/fish_yan_faucet" } + +dependencies = [ + { id = "Sui", name = "Sui" }, +] + +[move.toolchain-version] +compiler-version = "1.38.3" +edition = "2024.beta" +flavor = "sui" + +[env] + +[env.mainnet] +chain-id = "35834a8a" +original-published-id = "0x7426072f30841b586761b57a6578b2cd2019975f67176319545d55db0b09036e" +latest-published-id = "0x7426072f30841b586761b57a6578b2cd2019975f67176319545d55db0b09036e" +published-version = "1" diff --git a/mover/fish-yan/code/task5/fish_yan_swap/Move.toml b/mover/fish-yan/code/task5/fish_yan_swap/Move.toml new file mode 100644 index 000000000..2d25df131 --- /dev/null +++ b/mover/fish-yan/code/task5/fish_yan_swap/Move.toml @@ -0,0 +1,39 @@ +[package] +name = "fish_yan_swap" +edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move +# license = "" # e.g., "MIT", "GPL", "Apache 2.0" +# authors = ["..."] # e.g., ["Joe Smith (joesmith@noemail.com)", "John Snow (johnsnow@noemail.com)"] + +[dependencies] +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" } +fish_yan_faucet = { local = "../../task2/fish_yan_faucet" } +fish_yan_coin = { local = "../../task2/fish_yan_coin" } + +# 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] +fish_yan_swap = "0x7426072f30841b586761b57a6578b2cd2019975f67176319545d55db0b09036e" + +# 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" + diff --git a/mover/fish-yan/code/task5/fish_yan_swap/call.sh b/mover/fish-yan/code/task5/fish_yan_swap/call.sh new file mode 100644 index 000000000..bdd6356a7 --- /dev/null +++ b/mover/fish-yan/code/task5/fish_yan_swap/call.sh @@ -0,0 +1,19 @@ +sui client call --gas-budget 100000000 \ +--package "0x7426072f30841b586761b57a6578b2cd2019975f67176319545d55db0b09036e" \ +--module fish_yan_swap \ +--function add_liquidity \ +--args 0x348606e8baed02611cc1fcd9ad6602ea3703048bba05ae3100b246556c785742 0x150f3205caab288c6449bf5806900aadf33807832d3d038159e009789ecf6bfa 0x4b3527bd1b0e69168b3729b161167a5f225c87cf38fa242c304b79ab04806f12 + + +sui client call --gas-budget 100000000 \ +--package "0x7426072f30841b586761b57a6578b2cd2019975f67176319545d55db0b09036e" \ +--module fish_yan_swap \ +--function a_swap_b \ +--args 0x348606e8baed02611cc1fcd9ad6602ea3703048bba05ae3100b246556c785742 0x3837ca39d17052dc6d6722215abc332502a833beedc3bd59d3cdc771d50f76b2 + + +sui client call --gas-budget 100000000 \ +--package "0x7426072f30841b586761b57a6578b2cd2019975f67176319545d55db0b09036e" \ +--module fish_yan_swap \ +--function b_swap_a \ +--args 0x348606e8baed02611cc1fcd9ad6602ea3703048bba05ae3100b246556c785742 0xc218b5021dde5ab8d7912d89a984222032cc12d0c478d571015eaa8bc624dab6 \ No newline at end of file diff --git a/mover/fish-yan/code/task5/fish_yan_swap/log.txt b/mover/fish-yan/code/task5/fish_yan_swap/log.txt new file mode 100644 index 000000000..9c33f7b9b --- /dev/null +++ b/mover/fish-yan/code/task5/fish_yan_swap/log.txt @@ -0,0 +1,147 @@ +Transaction Digest: Ca1ASWqQuGoe3tkBNpa1noyri9VoTBebqF5rTzmko3Va +╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Transaction Data │ +├──────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ Gas Owner: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ Gas Budget: 100000000 MIST │ +│ Gas Price: 750 MIST │ +│ Gas Payment: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Version: 343239258 │ +│ │ Digest: AzP71j1EFjh6A268DcpxapposeiURmKiq4fmxNfnUihS │ +│ └── │ +│ │ +│ Transaction Kind: Programmable │ +│ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ +│ │ Input Objects │ │ +│ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ +│ │ 0 Pure Arg: Type: address, Value: "0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd" │ │ +│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ +│ ╭─────────────────────────────────────────────────────────────────────────╮ │ +│ │ Commands │ │ +│ ├─────────────────────────────────────────────────────────────────────────┤ │ +│ │ 0 Publish: │ │ +│ │ ┌ │ │ +│ │ │ Dependencies: │ │ +│ │ │ 0x0000000000000000000000000000000000000000000000000000000000000001 │ │ +│ │ │ 0x0000000000000000000000000000000000000000000000000000000000000002 │ │ +│ │ │ 0x8b356127915437d3a1f2b80e3209775e79aeb08d4a0c5bcfba36187913912726 │ │ +│ │ │ 0x46a5b42763675e5032e2e89bcb8ed0944d1e7b2e39138e784813178ec1a18e51 │ │ +│ │ └ │ │ +│ │ │ │ +│ │ 1 TransferObjects: │ │ +│ │ ┌ │ │ +│ │ │ Arguments: │ │ +│ │ │ Result 0 │ │ +│ │ │ Address: Input 0 │ │ +│ │ └ │ │ +│ ╰─────────────────────────────────────────────────────────────────────────╯ │ +│ │ +│ Signatures: │ +│ QrQTkLDShBF+ioOVprUPyn1vdXt2OIWxGGR1LkD16j/GWgf9GpsorVhdezVezH1G1QAKhk0L3XVA69TZ4ZxcCQ== │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Transaction Effects │ +├───────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Digest: Ca1ASWqQuGoe3tkBNpa1noyri9VoTBebqF5rTzmko3Va │ +│ Status: Success │ +│ Executed Epoch: 606 │ +│ │ +│ Created Objects: │ +│ ┌── │ +│ │ ID: 0x348606e8baed02611cc1fcd9ad6602ea3703048bba05ae3100b246556c785742 │ +│ │ Owner: Shared( 343239259 ) │ +│ │ Version: 343239259 │ +│ │ Digest: BUwoHvxjrqSrz44ACBi716tXCTZzg5Pk8csEhkZioA3G │ +│ └── │ +│ ┌── │ +│ │ ID: 0x7426072f30841b586761b57a6578b2cd2019975f67176319545d55db0b09036e │ +│ │ Owner: Immutable │ +│ │ Version: 1 │ +│ │ Digest: 2RJDG4fR4SW7LRyDZhBJNC4LT7vHWWmJyk7Z5jx5xjiD │ +│ └── │ +│ ┌── │ +│ │ ID: 0x9ced68c514be2805bee57a3d5bb7aef2ff1a3b5d9f86d19359042aa92ec8decf │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 343239259 │ +│ │ Digest: 9troxzWHf861kLKvEvi1DChaCN3r7WtQi1KgPQz21Cty │ +│ └── │ +│ Mutated Objects: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 343239259 │ +│ │ Digest: F2uMaUgrjARUCtt3QDd3iE6L2WxUTuRHXwTbVLJzRHsd │ +│ └── │ +│ Gas Object: │ +│ ┌── │ +│ │ ID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ Version: 343239259 │ +│ │ Digest: F2uMaUgrjARUCtt3QDd3iE6L2WxUTuRHXwTbVLJzRHsd │ +│ └── │ +│ Gas Cost Summary: │ +│ Storage Cost: 15215200 MIST │ +│ Computation Cost: 750000 MIST │ +│ Storage Rebate: 978120 MIST │ +│ Non-refundable Storage Fee: 9880 MIST │ +│ │ +│ Transaction Dependencies: │ +│ xUMpxP7rb3sPrAZ3oyMHi15iv35nkPgL4kSTFEAWtzq │ +│ BENBv574puWHg5RBitKhJHrrRK8E46mc3nKejBLU6Evu │ +│ DavFCciN4XLHrSW5SqWtgKMkccNFNjqwbL29qSWZqpyi │ +│ FPQJirZF6XaBX9wcmQbPUPPX9CzbpymnF3c8vtnpHqWt │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭─────────────────────────────╮ +│ No transaction block events │ +╰─────────────────────────────╯ + +╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Object Changes │ +├─────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Created Objects: │ +│ ┌── │ +│ │ ObjectID: 0x348606e8baed02611cc1fcd9ad6602ea3703048bba05ae3100b246556c785742 │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Shared( 343239259 ) │ +│ │ ObjectType: 0x7426072f30841b586761b57a6578b2cd2019975f67176319545d55db0b09036e::fish_yan_swap::Pool │ +│ │ Version: 343239259 │ +│ │ Digest: BUwoHvxjrqSrz44ACBi716tXCTZzg5Pk8csEhkZioA3G │ +│ └── │ +│ ┌── │ +│ │ ObjectID: 0x9ced68c514be2805bee57a3d5bb7aef2ff1a3b5d9f86d19359042aa92ec8decf │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::package::UpgradeCap │ +│ │ Version: 343239259 │ +│ │ Digest: 9troxzWHf861kLKvEvi1DChaCN3r7WtQi1KgPQz21Cty │ +│ └── │ +│ Mutated Objects: │ +│ ┌── │ +│ │ ObjectID: 0x84882b33a9158b097d4cd7d8df832a09d680124ed7a27dcbe20abbc52c2c033c │ +│ │ Sender: 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ ObjectType: 0x2::coin::Coin<0x2::sui::SUI> │ +│ │ Version: 343239259 │ +│ │ Digest: F2uMaUgrjARUCtt3QDd3iE6L2WxUTuRHXwTbVLJzRHsd │ +│ └── │ +│ Published Objects: │ +│ ┌── │ +│ │ PackageID: 0x7426072f30841b586761b57a6578b2cd2019975f67176319545d55db0b09036e │ +│ │ Version: 1 │ +│ │ Digest: 2RJDG4fR4SW7LRyDZhBJNC4LT7vHWWmJyk7Z5jx5xjiD │ +│ │ Modules: fish_yan_swap │ +│ └── │ +╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ +╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ Balance Changes │ +├───────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ ┌── │ +│ │ Owner: Account Address ( 0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd ) │ +│ │ CoinType: 0x2::sui::SUI │ +│ │ Amount: -14987080 │ +│ └── │ +╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ diff --git a/mover/fish-yan/code/task5/fish_yan_swap/sources/fish_yan_swap.move b/mover/fish-yan/code/task5/fish_yan_swap/sources/fish_yan_swap.move new file mode 100644 index 000000000..0791d1875 --- /dev/null +++ b/mover/fish-yan/code/task5/fish_yan_swap/sources/fish_yan_swap.move @@ -0,0 +1,77 @@ +/* +/// Module: fish_yan_swap +module fish_yan_swap::fish_yan_swap; +*/ +module fish_yan_swap::fish_yan_swap { + + use fish_yan_coin::fish_yan_coin::FISH_YAN_COIN; + use fish_yan_faucet::fish_yan_faucet::FISH_YAN_FAUCET; + use sui::balance; + use sui::balance::{Balance}; + use sui::coin; + use sui::coin::Coin; + + const E_INSUFFICIENT_BALANCE: u64 =0; + const E_ZERO_AMOUNT: u64 = 1; + + public struct Pool has key { + id: UID, + balance_a: Balance, + balance_b: Balance, + } + + fun init(ctx: &mut TxContext) { + let pool = Pool { + id: object::new(ctx), + balance_a: balance::zero(), + balance_b: balance::zero(), + }; + + transfer::share_object(pool); + } + + + // 添加流动性 + public entry fun add_liquidity( + pool: &mut Pool, + coin_a: Coin, + coin_b: Coin, + ctx: &mut TxContext, + ) { + + let coin_a_amount = coin_a.value(); + let coin_b_amount = coin_b.value(); + + assert!(coin_a_amount > 0 && coin_b_amount > 0, E_ZERO_AMOUNT); + + pool.balance_a.join(coin_a.into_balance()); + pool.balance_b.join(coin_b.into_balance()); + + } + + public entry fun a_swap_b( + pool: &mut Pool, + coin_a: Coin, + ctx: &mut TxContext + ) { + let amount = coin_a.value(); + assert!(amount <= pool.balance_b.value(), E_INSUFFICIENT_BALANCE); + + pool.balance_a.join(coin_a.into_balance()); + transfer::public_transfer(coin::take(&mut pool.balance_b, amount, ctx), ctx.sender()); + } + + public entry fun b_swap_a( + pool: &mut Pool, + coin_b: Coin, + ctx: &mut TxContext + ) { + let amount = coin_b.value(); + assert!(amount <= pool.balance_a.value(), E_INSUFFICIENT_BALANCE); + + pool.balance_b.join(coin_b.into_balance()); + transfer::public_transfer(coin::take(&mut pool.balance_a, amount, ctx), ctx.sender()); + + } +} + diff --git a/mover/fish-yan/code/task5/fish_yan_swap/tests/fish_yan_swap_tests.move b/mover/fish-yan/code/task5/fish_yan_swap/tests/fish_yan_swap_tests.move new file mode 100644 index 000000000..b626e10d2 --- /dev/null +++ b/mover/fish-yan/code/task5/fish_yan_swap/tests/fish_yan_swap_tests.move @@ -0,0 +1,18 @@ +/* +#[test_only] +module fish_yan_swap::fish_yan_swap_tests; +// uncomment this line to import the module +// use fish_yan_swap::fish_yan_swap; + +const ENotImplemented: u64 = 0; + +#[test] +fun test_fish_yan_swap() { + // pass +} + +#[test, expected_failure(abort_code = ::fish_yan_swap::fish_yan_swap_tests::ENotImplemented)] +fun test_fish_yan_swap_fail() { + abort ENotImplemented +} +*/ diff --git a/mover/fish-yan/images/sui_nft.jpg b/mover/fish-yan/images/sui_nft.jpg new file mode 100644 index 000000000..16fcb886a Binary files /dev/null and b/mover/fish-yan/images/sui_nft.jpg differ diff --git a/mover/fish-yan/images/sui_package_id.jpg b/mover/fish-yan/images/sui_package_id.jpg new file mode 100644 index 000000000..a2684564c Binary files /dev/null and b/mover/fish-yan/images/sui_package_id.jpg differ diff --git a/mover/fish-yan/images/sui_wallet.jpg b/mover/fish-yan/images/sui_wallet.jpg new file mode 100644 index 000000000..70ac0eb28 Binary files /dev/null and b/mover/fish-yan/images/sui_wallet.jpg differ diff --git a/mover/fish-yan/notes/readme.md b/mover/fish-yan/notes/readme.md new file mode 100644 index 000000000..e69de29bb diff --git a/mover/fish-yan/readme.md b/mover/fish-yan/readme.md new file mode 100644 index 000000000..b4d61083f --- /dev/null +++ b/mover/fish-yan/readme.md @@ -0,0 +1,55 @@ +## 基本信息 +- Sui钱包地址: `0xc20186205fdb38b890dd6167a784341fd22dd0bf6cc3bfa11dfc75a5338bafcd` +> 首次参与需要完成第一个任务注册好钱包地址才被合并,并且后续学习奖励会打入这个地址 +- github: `fish-yan` + +## 个人简介 +- 工作经验: 10年 +- 技术栈: `Swift` `Objective-c` `js` +> 重要提示 请认真写自己的简介 +- 7年web2开发经验,3年web3钱包开发经验,对Move特别感兴趣,想通过Move入门区块链 +- 联系方式: tg: `@fish_yan` + +## 任务 + +## 01 hello move +- [] Sui cli version: sui 1.38.3-homebrew +- [] Sui钱包截图: ![Sui钱包截图](./images/sui_wallet.jpg) +- [] package id: `0x3fb3fb0e02f78528803fdd392e77f0bc9312ef7c97203db29fe1f6d002b2d8ca` +- [] package id 在 scan上的查看截图:![Scan截图](./images/sui_package_id.jpg) + +## 02 move coin +- [] My Coin package id : `0x8b356127915437d3a1f2b80e3209775e79aeb08d4a0c5bcfba36187913912726` +- [] Faucet package id : `0x46a5b42763675e5032e2e89bcb8ed0944d1e7b2e39138e784813178ec1a18e51` +- [] 转账 `My Coin` hash: `6eZihPMkGHR6i8gSJ9zPWzkt9VZdkBVxkFrG8yX7N7R6` +- [] `Faucet Coin` address1 mint hash: `4YCwXNb2ShaqN56GzRzcprzjM2Pv3xuKbFp22EyTfSM7` +- [] `Faucet Coin` address2 mint hash: `4tJT4mtby1YMvrACrbJ7NSjZKqqHKsUjUunLNnpocnWM` + +## 03 move NFT +- [] nft package id : `0x476675acd2bdf6688c357a317455de30cadf74fcbeb04d57428b60afab697ac3` +- [] nft object id : `0xf145d4653e39feaaa09870ba6d0022085cb447a37bcf3f13f300b29b9618362d` +- [] 转账 nft hash: `3xe4qKxdJ4MWc8NwF96STPnsJWiKNhTYpor2VrwUmAiA` +- [] scan上的NFT截图:![Scan截图](./images/sui_nft.jpg) + +## 04 Move Game +- [] game package id : `0xd184632ebf05fa28b23e46ae5d6306c70a7badbe4a01a45896608e197ac8fe52` +- [] deposit Coin hash: `5figMDazXxpjEBAX7yit3M88JKBth7yqakv8Ak5wwrEz` +- [] withdraw `Coin` hash: `GzGU66rRJMXhSw4oS5bfDLfixbtGhHYhpgWCqSMyZSVD` +- [] play game hash: `DavFCciN4XLHrSW5SqWtgKMkccNFNjqwbL29qSWZqpyi` + +## 05 Move Swap +- [] swap package id : `0x7426072f30841b586761b57a6578b2cd2019975f67176319545d55db0b09036e` +- [] call swap CoinA-> CoinB hash : `8dM6cxz8atADhFBxkm78bqUmay8SxxMXyPTNG5KBJiBd` +- [] call swap CoinB-> CoinA hash : `AWhuB4mH7ymkXRSRt7BDdKkcBSxZMKCU7xbGjxFktn2m` + +## 06 Dapp-kit SDK PTB +- [] save hash : + +## 07 Move CTF Check In +- [] CLI call 截图 : ![截图](./images/你的图片地址) +- [] flag hash : + +## 08 Move CTF Lets Move +- [] proof : +- [] flag hash : + diff --git a/mover/fish-yan/scan/readme.md b/mover/fish-yan/scan/readme.md new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/mover/fish-yan/scan/readme.md @@ -0,0 +1 @@ +