Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 72e87ec

Browse files
WGB5445Copilot
andauthored
[i18n] zh /build/smart-contracts/ (#948)
* Update Chinese documentation for Aptos development resources - Refactored and added translations for various sections in the build documentation, including "Get Started," "Smart Contracts," and "Developer Setup." - Introduced new cheat sheets for Ethereum and Solana to Aptos transitions. - Added detailed guides on creating packages, compiling Move code, and using the Move on Aptos compiler. - Included comprehensive information on the Confidential Asset standard and its implementation. - Enhanced the structure and organization of the documentation for better clarity and accessibility. * Add Chinese documentation for various smart contract topics - Introduced new pages covering cryptography, debugging, deployment, digital assets, error codes, fungible assets, linter, maps, modules, randomness, resource accounts, scripts, smart vectors, tables, third-party dependencies, tokens, and vectors. - Enhanced the structure and organization of the documentation to improve clarity and accessibility for developers. - Provided comprehensive guides and examples to facilitate understanding and usage of the Move programming language on the Aptos platform. * Update Chinese documentation for smart contracts - Refactored links in the smart contracts documentation to point to the Chinese versions for topics such as testing, structs, and added new sections for debugging and maps. - Removed outdated links and improved the overall structure for better navigation and accessibility. - Enhanced the documentation to support developers working with the Move programming language on the Aptos platform. * Update Chinese cheat sheets for Ethereum and Solana to Aptos - Revised titles and content for clarity and consistency in the Ethereum and Solana cheat sheets. - Enhanced descriptions and examples to improve understanding of differences and similarities between Ethereum/Solana and Aptos. - Improved formatting for better readability and accessibility in the documentation. * Update Chinese documentation for developer setup and smart contracts - Revised titles in the documentation for "Developer Setup," "Ethereum Cheatsheet," "Solana Cheatsheet," and various smart contract topics to include Chinese translations for improved clarity. - Enhanced the structure and organization of the documentation to better support Chinese-speaking developers working with the Move programming language on the Aptos platform. - Updated sections to ensure consistency and accessibility across the documentation. * Update apps/nextra/pages/zh/build/smart-contracts/maps.mdx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 0ce4ecc commit 72e87ec

39 files changed

+6845
-109
lines changed
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
export default {
2-
"get-started": "开始",
3-
"smart-contracts": {
4-
title: "Smart Contracts (Move)",
5-
href: "/en/build/smart-contracts",
6-
},
7-
cli: "CLI",
2+
"get-started": "Get Started",
3+
"smart-contracts": "Smart Contracts (Move)",
84
apis: "APIs",
9-
guides: "Guides",
10-
indexer: "Indexer",
115
sdks: "SDKs",
6+
indexer: "Indexer",
7+
cli: "CLI",
8+
"create-aptos-dapp": "create-aptos-dapp",
9+
guides: "Guides",
1210
};
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
export default {};
1+
export default {
2+
"developer-setup": {
3+
title: "Developer Setup | 开发者环境搭建",
4+
theme: {
5+
toc: false,
6+
layout: "full",
7+
},
8+
},
9+
"ethereum-cheatsheet": {
10+
title: "Ethereum to Aptos Cheatsheet | 以太坊到 Aptos 速查表",
11+
},
12+
"solana-cheatsheet": {
13+
title: "Solana to Aptos Cheatsheet | Solana 到 Aptos 速查表",
14+
},
15+
// TODO: Will uncomment when ready for use
16+
// "create-aptos-dapp": {
17+
// title: "create-aptos-dapp | 创建 Aptos Dapp",
18+
// href: "https://github.com/aptos-labs/create-aptos-dapp",
19+
// },
20+
};
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
---
2+
title: "开发者环境配置"
3+
---
4+
5+
import { Tabs, Steps } from 'nextra/components'
6+
import { Cards, Card } from '@components/index'
7+
8+
# 开发者环境配置
9+
10+
根据开发类型的不同,以下是配置环境的简易指南。
11+
12+
<Tabs items={['前端开发', '智能合约', '创建 Aptos Dapp']}>
13+
{/* 前端开发 */}
14+
<Tabs.Tab>
15+
<Steps>
16+
17+
### 初始化前端项目
18+
19+
以下是几种流行框架的示例:
20+
21+
<Tabs items={['Next.js', 'Vite (TS)']}>
22+
<Tabs.Tab>
23+
```bash filename="终端"
24+
pnpx create-next-app@latest
25+
```
26+
</Tabs.Tab>
27+
<Tabs.Tab>
28+
```bash filename="终端"
29+
pnpx create vite my-aptos-app --template react-ts
30+
```
31+
</Tabs.Tab>
32+
</Tabs>
33+
34+
### 安装 `@aptos-labs/ts-sdk`
35+
36+
```bash npm2yarn
37+
npm i @aptos-labs/ts-sdk
38+
```
39+
40+
### 配置 TS SDK
41+
42+
<Cards>
43+
<Card href="../sdks/ts-sdk/quickstart">
44+
<Card.Title>TS SDK 快速入门</Card.Title>
45+
<Card.Description>了解如何设置账户、网络、使用水龙头、发送/模拟交易等</Card.Description>
46+
</Card>
47+
</Cards>
48+
49+
### 开始构建应用!
50+
51+
现在已完成前端集成 Aptos 的开发环境配置。
52+
查看我们其他能优化开发流程的工具
53+
54+
<Cards>
55+
<Card href="../indexer">
56+
<Card.Title>索引器</Card.Title>
57+
<Card.Description>高效查询链上状态,如余额、交易活动、代币数据等</Card.Description>
58+
</Card>
59+
<Card
60+
href="https://github.com/aptos-labs/aptos-ts-sdk/tree/main/examples/typescript">
61+
<Card.Title linkType="external">TS SDK 示例</Card.Title>
62+
<Card.Description>20+ 个 TS SDK 使用示例</Card.Description>
63+
</Card>
64+
<Card href="https://build.aptoslabs.com/">
65+
<Card.Title linkType="external">Aptos Build</Card.Title>
66+
<Card.Description>遇到 Fullnode API/索引器速率限制?可在此获取API密钥</Card.Description>
67+
</Card>
68+
</Cards>
69+
70+
</Steps>
71+
</Tabs.Tab>
72+
73+
{/* 智能合约 */}
74+
<Tabs.Tab>
75+
<Steps>
76+
77+
### 安装 CLI
78+
79+
<Cards>
80+
<Card href="../cli">
81+
<Card.Title>Aptos CLI</Card.Title>
82+
<Card.Description>
83+
Aptos CLI 安装指南
84+
</Card.Description>
85+
</Card>
86+
</Cards>
87+
88+
### 配置编辑器或 IDE
89+
90+
为您的编辑器添加以下扩展以简化 Move 开发
91+
92+
<Tabs items={['JetBrains IDE', 'VSCode']}>
93+
<Tabs.Tab>
94+
<Cards>
95+
<Card
96+
href="https://plugins.jetbrains.com/plugin/14721-move-language">
97+
<Card.Title linkType="external">Move 语言插件</Card.Title>
98+
<Card.Description>语言服务器和语法高亮插件为
99+
JetBrains 系列 IDE(如 CLion、Rust Rover、WebStorm、
100+
IntelliJ)</Card.Description>
101+
</Card>
102+
</Cards>
103+
</Tabs.Tab>
104+
<Tabs.Tab>
105+
<Cards>
106+
<Card
107+
href="https://marketplace.visualstudio.com/items?itemName=MoveBit.aptos-move-analyzer">
108+
<Card.Title linkType="external">Aptos Move 分析器</Card.Title>
109+
<Card.Description>适用于 VSCode 的语言服务器和语法高亮工具</Card.Description>
110+
</Card>
111+
</Cards>
112+
</Tabs.Tab>
113+
</Tabs>
114+
115+
### 创建智能合约
116+
117+
导航到您的应用目录并通过以下命令初始化一个新的智能合约:
118+
119+
```sh filename="Terminal"
120+
aptos move init --name my_todo_list
121+
```
122+
123+
### 构建、编译和部署智能合约!
124+
125+
用于 Aptos 智能合约开发的设置现已完成。
126+
更多信息请查看下方 Dapp 教程链接
127+
128+
<Cards>
129+
<Card
130+
href="../guides/build-e2e-dapp/1-create-smart-contract#what-is-a-movetoml-file">
131+
<Card.Title>智能合约创建指南</Card.Title>
132+
<Card.Description>一个简易的待办事项列表指南,介绍如何使用 Move 设置智能合约</Card.Description>
133+
</Card>
134+
</Cards>
135+
136+
</Steps>
137+
</Tabs.Tab>
138+
{/* create-aptos-dapp */}
139+
<Tabs.Tab>
140+
<Steps>
141+
### 安装 `create-aptos-dapp`
142+
运行以下命令,几秒内即可从模板安装一个 dApp:
143+
<Tabs items={["npx", "pnpx"]}>
144+
{ /* npx */ }
145+
<Tabs.Tab>
146+
```bash filename="Terminal"
147+
npx create-aptos-dapp@latest
148+
```
149+
</Tabs.Tab>
150+
{ /* pnpx */ }
151+
<Tabs.Tab>
152+
```bash filename="Terminal"
153+
pnpx create-aptos-dapp@latest
154+
```
155+
</Tabs.Tab>
156+
</Tabs>
157+
158+
### 跟随提示操作
159+
根据 CLI 提示选择您新 dApp 的名称、[模板](../create-aptos-dapp#templates) 和网络。
160+
161+
![cad](/docs/cad-video.gif)
162+
163+
### 开始构建并定制您的新 dApp!
164+
导航到您的新项目并在您喜欢的 IDE 中打开以继续开发!
165+
166+
按照生成的 `README.md` 文件进行后续步骤。
167+
168+
### 继续阅读
169+
<Cards>
170+
<Card href="../create-aptos-dapp">
171+
<Card.Title>创建 Aptos Dapp</Card.Title>
172+
<Card.Description>获取关于该工具的更多信息</Card.Description>
173+
</Card>
174+
<Card href="../create-aptos-dapp#templates">
175+
<Card.Title>模板</Card.Title>
176+
<Card.Description>浏览预制模板</Card.Description>
177+
</Card>
178+
<Card href="../create-aptos-dapp/faq">
179+
<Card.Title>常见问题</Card.Title>
180+
<Card.Description>获取常见问题和解决方案</Card.Description>
181+
</Card>
182+
</Cards>
183+
184+
</Steps>
185+
</Tabs.Tab>
186+
</Tabs>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: "Ethereum 到 Aptos 速查表"
3+
---
4+
5+
# Ethereum 到 Aptos 速查表
6+
7+
如需了解更多差异与相似之处,请参阅 [Aptos Learn](https://learn.aptoslabs.com/en/tutorials/ethereum-to-aptos-guide/cheat-sheet?workshop=eth-to-aptos)
8+
9+
### 高层概览
10+
11+
| 功能 | Ethereum | Aptos |
12+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
13+
| **智能合约** | Solidity, EVM | Move, MoveVM |
14+
| **优势** | 成熟,广泛采用 | 可扩展性、高吞吐量、低延迟、可预测费用 |
15+
| **交易手续费** | 变化大,可能很高 | 更低且更可预测 |
16+
| **账户地址** | 160 位 | 256 位 |
17+
| **账户结构** | 余额存储于单一字段,使用 nonce | 模块与资源,使用序列号 |
18+
| **数据存储** | Patricia Merkle 树 | 通过资源和模块实现的全局存储 |
19+
| **存储思路** | 基于合约的存储 | 以账户为中心的代码与数据管理 |
20+
| **示例代码** | [ERC-20](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC20) | [Fungible Asset](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/fungible_asset.move) |
21+
| **调用者 ID** | `msg.sender` | `&signer` reference |
22+
| **可升级性** | 代理模式 | 直接模块升级 |
23+
| **安全性** | 易受重入等攻击 | 缓解常见漏洞 |
24+
| **调度类型** | 动态调度 | 静态调度 |
25+
| **FT 标准** | [ERC-20](https://docs.openzeppelin.com/contracts/4.x/erc20) | [Coin](../smart-contracts/aptos-coin.mdx)(传统)与 [Fungible Asset](../smart-contracts/fungible-asset.mdx) |
26+
| **NFT 标准** | [ERC-721](https://docs.openzeppelin.com/contracts/4.x/erc721), [ERC-1155](https://docs.openzeppelin.com/contracts/4.x/erc1155) | [Digital Asset](../smart-contracts/digital-asset.mdx) |
27+
| **区块链交互** | [Ethers.js library](https://docs.ethers.org/v6/) | [Aptos Typescript SDK](../sdks/ts-sdk.mdx) |
28+
29+
<br />
30+
31+
### 代币标准详细对比
32+
33+
| | Solidity | Move (Aptos) |
34+
| ---------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
35+
| **代币结构** | 每个代币是独立的合约。 | 每个代币是单一、可复用合约下的类型化 `Coin``FungibleAsset`|
36+
| **代币标准** | 必须符合如 ERC20 等标准,具体实现可变。 | 所有代币采用统一接口和实现。 |
37+
| **余额存储** | 余额通过合约内的 mapping 结构存储。 | **资源导向余额**:余额作为资源存储在用户账户中。资源不可随意创建,确保代币价值的完整性。 |
38+
| **转账机制** | 可在未获接收方明确授权的情况下转账。 | 除特定情况(如 AptosCoin)外,代币通常需要接收方 `signer` 权限进行转账。 |
39+
40+
<br />
41+
42+
### EVM 与 Move VM 详细对比
43+
44+
- **EVM**:以灵活性和动态调度著称,支持多样化的智能合约行为。但这种灵活性会导致并行执行和网络操作的复杂性提升。
45+
- **Move VM**:注重安全与高效,虚拟机与编程语言深度集成。其数据存储模型有助于更好地并行化,静态调度提升了安全性和可预测性。
46+
47+
<br />
48+
49+
| | EVM (Ethereum Virtual Machine) | Move VM (Move Virtual Machine) |
50+
| ------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
51+
| **数据存储** | 数据存储于智能合约的存储空间。 | 数据分布于智能合约、用户账户和对象。 |
52+
| **并行化** | 由于存储空间共享,并行执行受限。 | 灵活的分离式存储设计带来更强的并行执行能力。 |
53+
| **虚拟机与语言集成** | EVM 与智能合约语言(如 Solidity)为分层结构。 | 虚拟机层与 Move 语言无缝集成,原生函数以 Rust 可执行文件形式在 Move 中实现。 |
54+
| **关键网络操作** | 网络操作实现复杂且不够直接。 | 关键操作如验证者集管理在 Move 中原生实现,可直接执行。 |
55+
| **函数调用** | 动态调度支持任意智能合约调用。 | 静态调度更注重安全性和可预测性。 |
56+
| **类型安全** | 合约类型提供一定的类型安全。 | Move 的模块结构体与泛型提供更强的类型安全。 |
57+
| **交易安全** | 通过 nonce 实现交易排序与安全。 | 通过序列号实现交易排序与安全。 |
58+
| **认证存储** | 支持,基于智能合约存储。 | 支持,基于 Move 的资源模型。 |
59+
| **对象可访问性** | 对象不具备全局可访问性,仅限于智能合约作用域。 | 对象保证全局可访问性。 |

0 commit comments

Comments
 (0)