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

week1 #41

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
Empty file removed fullstack/0000/week4/readme.md
Empty file.
Binary file added fullstack/MisakiNemo/images/bl-follow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Binary file added fullstack/MisakiNemo/images/study-week1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fullstack/MisakiNemo/images/week1-work.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fullstack/MisakiNemo/images/x-follow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fullstack/MisakiNemo/images/xuanchuan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 10 additions & 9 deletions fullstack/0000/readme.md → fullstack/MisakiNemo/readme.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
## 个人简介
- 工作经验: x年
- 技术栈: `Rust` `C++`
- 工作经验: 1年
- 技术栈: `React` `go` `vue`
> 重要提示 请认真写自己的简介
- 多年web2开发经验,对web3特别感兴趣,想通过Sui入门区块链
- 联系方式: tg: `xxx`
- 区块链爱好者,想通过学习move了解区块链
- 联系方式: tg: @roboziatri



## 作业
- [] 第一周:
- [] 第一周:![关注截图](./images/week1-work.png)
- [] 第二周:
- [] 第三周:
- [] 第四周:
Expand All @@ -17,15 +17,17 @@

## b站,推特关注

- [] b站,推特关注截图: ![关注截图](./images/你的图片地址)
- [] b站,推特关注截图: ![关注截图](./images/bl-follow.png)

![关注截图](./images/x-follow.png)

## 为共学营宣传(在朋友圈或者群聊中转发海报/文章)

- [] 宣传截图:![宣传截图](./images/你的图片地址)
- [] 宣传截图:![宣传截图](./images/xuanchuan.png)

## 每周课程学习

- [] 第一周:![学习记录截图](./images/你的图片地址)
- [] 第一周:![学习记录截图](./images/study-week1.png)
- [] 第二周:![学习记录截图](./images/你的图片地址)
- [] 第三周:![学习记录截图](./images/你的图片地址)
- [] 第四周:![学习记录截图](./images/你的图片地址)
Expand Down Expand Up @@ -66,4 +68,3 @@

- [] 项目提交![项目截图](./images/你的图片地址)


34 changes: 34 additions & 0 deletions fullstack/MisakiNemo/week1/source_manage/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# @generated by Move, please check-in and do not edit manually.

[move]
version = 2
manifest_digest = "02838D02D5137040EF5A377E99643165867624BFDC26F286A62016E6FFBCAEE1"
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
dependencies = [
{ name = "Sui" },
]

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

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

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

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

[env]

[env.testnet]
chain-id = "4c78adac"
original-published-id = "0x1430a26fd4ea0ab8d24a168617e04d01a27d11f1d211052fbce251872d6aacf4"
latest-published-id = "0x1430a26fd4ea0ab8d24a168617e04d01a27d11f1d211052fbce251872d6aacf4"
published-version = "1"
37 changes: 37 additions & 0 deletions fullstack/MisakiNemo/week1/source_manage/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "source_manage"
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]
source_manage = "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"

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/// Module: source_manage
module source_manage::source_manage {
use std::string::{String};
use sui::table::{Self, Table};
use sui::event;

const ProfileExit: u64 = 1;

public struct State has key {
id: UID,
users: Table<address, address>,
}

public struct Profile has key {
id: UID,
name: String,
description: String,
}

public struct ProfileCreated has copy, drop {
profile: address,
owner: address,
}

fun init(ctx: &mut TxContext) {
transfer::share_object(State{
id: object::new(ctx),
users: table::new(ctx),
});
}

public entry fun create_profile(name: String, description: String, state: &mut State, ctx: &mut TxContext) {
let owner = tx_context::sender(ctx);
assert!(!table::contains(&state.users, owner), ProfileExit);
let uid = object::new(ctx);
let id = object::uid_to_inner(&uid);

let new_profile = Profile {
id: uid,
name: name,
description: description,
};

transfer::transfer(new_profile, owner);
table::add(&mut state.users, owner, object::id_to_address(&id));

event::emit(ProfileCreated {
profile: object::id_to_address(&id),
owner,
});
}

public fun check_has_profile(state: &State, user: address): Option<address> {
if(table::contains(&state.users, user)) {
option::some(*table::borrow(&state.users, user))
}else {
option::none()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
#[test_only]
module source_manage::source_manage_tests {
// uncomment this line to import the module
// use source_manage::source_manage;

const ENotImplemented: u64 = 0;

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

#[test, expected_failure(abort_code = ::source_manage::source_manage_tests::ENotImplemented)]
fun test_source_manage_fail() {
abort ENotImplemented
}
}
*/
24 changes: 24 additions & 0 deletions fullstack/MisakiNemo/week1/web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
4 changes: 4 additions & 0 deletions fullstack/MisakiNemo/week1/web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# React + TypeScript + Vite


a react+ typescript+vite+tailwindcss+antd+redux+routes project template.
21 changes: 21 additions & 0 deletions fullstack/MisakiNemo/week1/web/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
28 changes: 28 additions & 0 deletions fullstack/MisakiNemo/week1/web/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
13 changes: 13 additions & 0 deletions fullstack/MisakiNemo/week1/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading