WTF-Solidity icon indicating copy to clipboard operation
WTF-Solidity copied to clipboard

我最近在重新学solidity,巩固一下细节,也写一个“WTF Solidity极简入门”,供小白们使用,每周更新1-3讲。Now supports English! 官网: https://wtf.academy

Results 143 WTF-Solidity issues
Sort by recently updated
recently updated
newest added

pr: #313 fix issue: #299

``` // 获取call data bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } ``` bytes4(keccak256(bytes(signature))) 获取function selector这个我能理解,但是这里为什么可以使用abi.encodePacked编码? 以下择取自27讲的原文: abi.encodePacked 将给定参数根据其所需最低空间编码。它类似...

Hi, I have translated chapter 32 into English.

As a cpp programmer, I think we should describe things essentially. The content from "2. `storage`赋值给`memory`,会创建独立的副本,修改其中一个不会影响另一个;反之亦然。例子:" should be collected into the content "4. 其他情况,变量赋值给`storage`,会创建独立的副本,修改其中一个不会影响另一个。"

translate chapter 31 to english

https://github.com/AmazingAng/WTF-Solidity/blob/4178a8c3f188a4a2fd5413bc7f20df5af6ca6be4/45_Timelock/Timelock.sol#L1 这里的license的话,应该是不能商业利用的哈?

修改interfaceId计算方式

// 教程里说,由于实参匹配,50既可以被转换为uint8,也可以被转换为uint256,因此报错。实际测试并没有报错 function f(uint8 _in) public pure returns (uint8 out) { out = _in; } function f(uint256 _in) public pure returns (uint256 out) { out = _in; } ![image](https://user-images.githubusercontent.com/61215384/210814405-981ba5e0-e7c7-4cf3-9a43-0489d754bfe3.png)

使SelectorClash.sol中的代码和文中的保持一致。

就类似进阶版里的一些实际应用,比如说compound,stablecoin,跨链桥的简化版本和大致的原理 就类似于介绍多签钱包那一节的模式,由一个有最基本功能的最简化版本切入,这种形式很赞