diff --git a/36_MerkleTree/readme.md b/36_MerkleTree/readme.md index 978d35e58..f01652ad1 100644 --- a/36_MerkleTree/readme.md +++ b/36_MerkleTree/readme.md @@ -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`白名单 diff --git a/Languages/en/03_Function_en/readme.md b/Languages/en/03_Function_en/readme.md index e5f9401df..5f0d569c7 100644 --- a/Languages/en/03_Function_en/readme.md +++ b/Languages/en/03_Function_en/readme.md @@ -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) diff --git a/Languages/en/13_Inheritance_en/readme.md b/Languages/en/13_Inheritance_en/readme.md index 45932ee68..0f2658e51 100644 --- a/Languages/en/13_Inheritance_en/readme.md +++ b/Languages/en/13_Inheritance_en/readme.md @@ -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`. diff --git a/Languages/en/21_CallContract_en/readme.md b/Languages/en/21_CallContract_en/readme.md index b80349cf5..23702cb54 100644 --- a/Languages/en/21_CallContract_en/readme.md +++ b/Languages/en/21_CallContract_en/readme.md @@ -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. diff --git a/Languages/en/23_Delegatecall_en/readme.md b/Languages/en/23_Delegatecall_en/readme.md index 35112bbd4..5fbd3b42d 100644 --- a/Languages/en/23_Delegatecall_en/readme.md +++ b/Languages/en/23_Delegatecall_en/readme.md @@ -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 { @@ -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`. diff --git a/Languages/en/24_Create_en/readme.md b/Languages/en/24_Create_en/readme.md index afb8c0ffa..6f5f5ecc0 100644 --- a/Languages/en/24_Create_en/readme.md +++ b/Languages/en/24_Create_en/readme.md @@ -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`. @@ -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`? > diff --git a/Languages/en/README.md b/Languages/en/README.md index e23e24eca..497aab89c 100644 --- a/Languages/en/README.md +++ b/Languages/en/README.md @@ -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) diff --git a/S01_ReentrancyAttack/readme.md b/S01_ReentrancyAttack/readme.md index 73d9d8303..10be523d6 100644 --- a/S01_ReentrancyAttack/readme.md +++ b/S01_ReentrancyAttack/readme.md @@ -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`,重入攻击成功。 diff --git a/S02_SelectorClash/readme.md b/S02_SelectorClash/readme.md index 3baf05440..0f0c74f76 100644 --- a/S02_SelectorClash/readme.md +++ b/S02_SelectorClash/readme.md @@ -88,7 +88,7 @@ Poly Network黑客事件中,黑客碰撞出的`_method`为 `f1121318093`,即 1. 部署`SelectorClash`合约。 2. 调用`executeCrossChainTx()`,参数填`0x6631313231333138303933`,`0x`,`0x`,`0`,发起攻击。 -3. 查看`solved`变量的值,被修改为`ture`,攻击成功。 +3. 查看`solved`变量的值,被修改为`true`,攻击成功。 ## 总结