Skip to content

Commit

Permalink
publish review chapter 1-2
Browse files Browse the repository at this point in the history
  • Loading branch information
AmazingAng committed May 22, 2023
1 parent e7a616f commit c7b5e26
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
10 changes: 5 additions & 5 deletions 01_HelloWeb3/readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: 1. HelloWeb3 (三行代码)
title: 1. Hello Web3 (三行代码)
tags:
- solidity
- basic
- wtfacademy
---

# WTF Solidity极简入门: 1. HelloWeb3 (三行代码)
# WTF Solidity极简入门: 1. Hello Web3 (三行代码)

我最近在重新学solidity,巩固一下细节,也写一个“WTF Solidity极简入门”,供小白们使用(编程大佬可以另找教程),每周更新1-3讲。

Expand All @@ -29,9 +29,9 @@ tags:

## 开发工具:Remix

本教程中,我们将使用 `Remix` 运行 `Solidity` 合约。`Remix` 是以太坊官方推荐的智能合约集成开发环境(IDE),适合新手,在浏览器中快速部署和测试智能合约,无需在本地安装任何程序。
本教程中,我们将使用 `Remix` 运行 `Solidity` 合约。`Remix` 是以太坊官方推荐的智能合约集成开发环境(IDE),适合新手,可以在浏览器中快速开发和部署合约,无需在本地安装任何程序。

网址:[remix.ethereum.org](https://remix.ethereum.org)
网址:[https://remix.ethereum.org](https://remix.ethereum.org)

`Remix` 中,左侧菜单有三个按钮,分别对应文件(编写代码)、编译(运行代码)和部署(将合约部署到链上)。点击“创建新文件”(`Create New File`)按钮,即可创建一个空白的 `Solidity` 合约。

Expand Down Expand Up @@ -90,6 +90,6 @@ contract HelloWeb3{
本节课程中,我们简要介绍了 `Solidity``Remix` 工具,并完成了第一个 `Solidity` 程序 —— `HelloWeb3`。接下来,我们将继续深入学习 `Solidity`

### 中文 Solidity 资料推荐:
1. [Solidity中文文档](https://solidity-cn.readthedocs.io/zh/develop/introduction-to-smart-contracts.html)(官方文档的中文翻译)
1. [Solidity中文文档](https://docs.soliditylang.org/zh/v0.8.19/index.html)(官方文档的中文翻译)

2. [崔棉大师solidity教程](https://space.bilibili.com/286084162) web3技术教学博主,我看他视频学到了很多
16 changes: 7 additions & 9 deletions 02_ValueTypes/readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: 2. 数值类型
title: 2. 值类型
tags:
- solidity
- basic
- wtfacademy
---

# WTF Solidity极简入门: 2. 数值类型
# WTF Solidity极简入门: 2. 值类型

我最近在重新学solidity,巩固一下细节,也写一个“WTF Solidity极简入门”,供小白们使用(编程大佬可以另找教程),每周更新1-3讲。

Expand All @@ -19,17 +19,15 @@ tags:
-----

## Solidity中的变量类型
1. **数值类型(Value Type)**:包括布尔型,整数型等等,这类变量赋值时候直接传递数值。
1. **值类型(Value Type)**:包括布尔型,整数型等等,这类变量赋值时候直接传递数值。

2. **引用类型(Reference Type)**:包括数组和结构体,这类变量占空间大,赋值时候直接传递地址(类似指针)。

3. **映射类型(Mapping Type)**: `Solidity`里的哈希表。

4. **函数类型(Function Type)**`Solidity`文档里把函数归到数值类型,但我觉得他跟其他类型差别很大,所以单独分一类
我们将仅介绍常用类型,不常用的类型不会涉及,本篇将介绍值类型

我们将仅介绍常用类型,不常用的类型不会涉及,本篇将介绍数值类型。

## 数值类型
## 值类型
### 1. 布尔型
布尔型是二值变量,取值为 `true``false`

Expand Down Expand Up @@ -104,7 +102,7 @@ tags:

字节数组分为定长和不定长两种:

- 定长字节数组: 属于数值类型,数组长度在声明之后不能改变。根据字节数组的长度分为 `bytes1`, `bytes8`, `bytes32` 等类型。定长字节数组最多存储 32 bytes 数据,即`bytes32`
- 定长字节数组: 属于值类型,数组长度在声明之后不能改变。根据字节数组的长度分为 `bytes1`, `bytes8`, `bytes32` 等类型。定长字节数组最多存储 32 bytes 数据,即`bytes32`
- 不定长字节数组: 属于引用类型(之后的章节介绍),数组长度在声明之后可以改变,包括 `bytes` 等。

```solidity
Expand Down Expand Up @@ -144,4 +142,4 @@ tags:

## 总结

在这一讲,我们介绍了 Solidity 中数值类型,包括布尔型、整型、地址、定长字节数组和枚举。在后续章节,我们将继续介绍 Solidity 的其他变量类型,包括函数类型、引用类型和映射类型
在这一讲,我们介绍了 Solidity 中值类型,包括布尔型、整型、地址、定长字节数组和枚举。在后续章节,我们将继续介绍 Solidity 的其他变量类型,包括引用类型和映射类型

0 comments on commit c7b5e26

Please sign in to comment.