Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
AmazingAng committed Oct 15, 2023
1 parent 4bd40ff commit 74e5027
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion 36_MerkleTree/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ library MerkleProof {

3. `_hashPair()`函数:用`keccak256()`函数计算非根节点对应的两个子节点的哈希(排序后)。

我们将`地址0``root`和对应的`proof`输入到`verify()`函数,将返回`ture`。因为`地址0`在根为`root``Merkle Tree`中,且`proof`正确。如果改变了其中任意一个值,都将返回`false`
我们将`地址0``root`和对应的`proof`输入到`verify()`函数,将返回`true`。因为`地址0`在根为`root``Merkle Tree`中,且`proof`正确。如果改变了其中任意一个值,都将返回`false`

## 利用`Merkle Tree`发放`NFT`白名单

Expand Down
2 changes: 1 addition & 1 deletion Languages/en/03_Function_en/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The following statements are considered modifying the state:
8. Using inline assembly that contains certain opcodes.


I drew a Mario cartton to visualize `pure` and `view`. In the picture, the state variable is represented by Princess Peach, keywards are represented by three different characters.
I drew a Mario cartton to visualize `pure` and `view`. In the picture, the state variable is represented by Princess Peach, keywords are represented by three different characters.

![WHAT is pure and view in solidity?](https://images.mirror-media.xyz/publication-images/1B9kHsTYnDY_QURSWMmPb.png?height=1028&width=1758)

Expand Down
2 changes: 1 addition & 1 deletion Languages/en/13_Inheritance_en/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Inheritance is one of the core concepts in object-oriented programming, which ca

### Rules

There are two important keywards for inheritance in Solidity:
There are two important keywords for inheritance in Solidity:

- `virtual`: If the functions in the parent contract are expected to be overridden in its child contracts, they should be declared as `virtual`.

Expand Down
2 changes: 1 addition & 1 deletion Languages/en/21_CallContract_en/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Codes and tutorials are open source on GitHub: [github.com/AmazingAng/WTFSolidit

## Interact with deployed contract

Interactions between contracts not only make the programs re-usable on the blockchain, also enrich the Ethereum ecosystem. Many `web3` Dapps rely on other contract to work, for example `yield farming`. In this tutorial, we will talk about how to interact with contract that source code (or ABI) and address are available.
Interactions between contracts not only make the programs reusable on the blockchain, also enrich the Ethereum ecosystem. Many `web3` Dapps rely on other contract to work, for example `yield farming`. In this tutorial, we will talk about how to interact with contract that source code (or ABI) and address are available.

## Target Contract
Lets write a simple contract `OtherContract` to work with.
Expand Down
4 changes: 2 additions & 2 deletions Languages/en/23_Delegatecall_en/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ contract C {
}
```
### Call Initizalization Contract B
First, contract `B` must have the same state variable layout as target contract `C`, 2 variabels and the order is `num` and `sender`.
First, contract `B` must have the same state variable layout as target contract `C`, 2 variables and the order is `num` and `sender`.

```solidity
contract B {
Expand Down Expand Up @@ -137,5 +137,5 @@ While function `delegatecallSetVars` calls `setVars` via `delegatecall`. Similar
![resultdelegatecall.png](./img/23-8.png)

## Summary
In this lecture we introduce another low level function in `Solidity`, `delegatecall`. Similar to `call`, `delegatecall` can be used to call another contract; the difference of `delegatecall` and `call` is `execution context`, the `execution context` is `C` if `B` `call` `C`; but the `execution context` is `B` if `B` `delegatecall` `C`. The major use cases for delegatecall is `proxy contract` and `EIP-2535 Diamons`.
In this lecture we introduce another low level function in `Solidity`, `delegatecall`. Similar to `call`, `delegatecall` can be used to call another contract; the difference of `delegatecall` and `call` is `execution context`, the `execution context` is `C` if `B` `call` `C`; but the `execution context` is `B` if `B` `delegatecall` `C`. The major use cases for delegatecall is `proxy contract` and `EIP-2535 Diamonds`.

4 changes: 2 additions & 2 deletions Languages/en/24_Create_en/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Community: [Discord](https://discord.gg/5akcruXrsk)|[Wechat](https://docs.goog
Codes and tutorials are open source on GitHub: [github.com/AmazingAng/WTFSolidity](https://github.com/AmazingAng/WTFSolidity)
-----

On Ethereum, user (Externally-owned account, `EOA`) can create smart contracts, a smart contract can also create new smart contracts. The decentralized exchange `Uniswap` creates an infinite number of `Pair` contracts with its `Factory` contract. In this lecture, I will explain how to create new smart contracts in an existed smart contract by using a simplied version of `Uniswap`.
On Ethereum, user (Externally-owned account, `EOA`) can create smart contracts, a smart contract can also create new smart contracts. The decentralized exchange `Uniswap` creates an infinite number of `Pair` contracts with its `Factory` contract. In this lecture, I will explain how to create new smart contracts in an existed smart contract by using a simplified version of `Uniswap`.

## `create` and `create2`
There are two ways to create a new contract in an existed contract, `create` and `create2`, this lecture will introduce `create`, next lecture will introduce `create2`.
Expand Down Expand Up @@ -61,7 +61,7 @@ contract Pair{
```
`Pair` contract is very simple, including 3 state variables: `factory`, `token0` and `token1`.

The `constructor` assigns Factory contract's address to `factory` at the time of delpoyment. `initialize` function will be called once by the `Factory` contract when the `Pair` contract is created, and update `token0` and `token1` with the addresses of 2 tokens in the token pair.
The `constructor` assigns Factory contract's address to `factory` at the time of deployment. `initialize` function will be called once by the `Factory` contract when the `Pair` contract is created, and update `token0` and `token1` with the addresses of 2 tokens in the token pair.

> **Ask**: Why doesn't `Uniswap` set the addresses of `token0` and `token1` in the `constructor`?
>
Expand Down
2 changes: 1 addition & 1 deletion Languages/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Tutorials and codes are open-sourced on github: [github.com/AmazingAng/WTFSolidi

**Chapter 5: Data Location (storage/memory/calldata)**[Code](./05_DataStorage_en) | [Tutorial](./05_DataStorage_en/readme.md)

**Chapter 6: Array and Sruct**[Code](./06_ArrayAndStruct_en) | [Tutorial](./06_ArrayAndStruct_en/readme.md)
**Chapter 6: Array and Struct**[Code](./06_ArrayAndStruct_en) | [Tutorial](./06_ArrayAndStruct_en/readme.md)

**Chapter 7: Mapping**[Code](./07_Mapping_en) | [Tutorial](./07_Mapping_en/readme.md)

Expand Down
2 changes: 1 addition & 1 deletion S01_ReentrancyAttack/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ contract Attack {

1. 部署`Bank`合约,调用`deposit()`函数,转入`20 ETH`
2. 切换到攻击者钱包,部署`Attack`合约。
3. 调用`Atack`合约的`attack()`函数发动攻击,调用时需转账`1 ETH`
3. 调用`Attack`合约的`attack()`函数发动攻击,调用时需转账`1 ETH`
4. 调用`Bank`合约的`getBalance()`函数,发现余额已被提空。
5. 调用`Attack`合约的`getBalance()`函数,可以看到余额变为`21 ETH`,重入攻击成功。

Expand Down
2 changes: 1 addition & 1 deletion S02_SelectorClash/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Poly Network黑客事件中,黑客碰撞出的`_method`为 `f1121318093`,即

1. 部署`SelectorClash`合约。
2. 调用`executeCrossChainTx()`,参数填`0x6631313231333138303933``0x``0x``0`,发起攻击。
3. 查看`solved`变量的值,被修改为`ture`,攻击成功。
3. 查看`solved`变量的值,被修改为`true`,攻击成功。

## 总结

Expand Down

0 comments on commit 74e5027

Please sign in to comment.