Skip to content

Commit

Permalink
Merge pull request #496 from qiweiii/qw-changes
Browse files Browse the repository at this point in the history
fix: code highlight
  • Loading branch information
AmazingAng committed May 11, 2023
2 parents b9b26a9 + 9c9903e commit 1727039
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 37_Signature/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ ethereum.request({method: "personal_sign", params: [account, hash]})
![浏览器console调用metamask进行签名](./img/37-4.jpg)

**3-2. 利用web3.py签名:** 批量调用中更倾向于使用代码进行签名,以下是基于web3.py的实现。
```
```py
from web3 import Web3, HTTPProvider
from eth_account.messages import encode_defunct

Expand Down
2 changes: 1 addition & 1 deletion 38_NFTSwap/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ discord:[WTF Academy](https://discord.gg/5akcruXrsk)

`ERC721`的安全转账函数会检查接收合约是否实现了`onERC721Received()`函数,并返回正确的选择器`selector`。用户下单之后,需要将`NFT`发送给`NFTSwap`合约。因此`NFTSwap`继承`IERC721Receiver`接口,并实现`onERC721Received()`函数:

```
```solidity
contract NFTSwap is IERC721Receiver{
// 实现{IERC721Receiver}的onERC721Received,能够接收ERC721代币
Expand Down
2 changes: 1 addition & 1 deletion 41_WETH/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ discord:[WTF Academy](https://discord.gg/5akcruXrsk)

2. 取款:拆包装,用户销毁`WETH`,并获得等量的`ETH`

```
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
Expand Down
1 change: 0 additions & 1 deletion 43_TokenVesting/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ tags:
- `ERC20Released`:提币事件,当受益人提取释放代币时释放。

```solidity
contract TokenVesting {
// 事件
event ERC20Released(address indexed token, uint256 amount); // 提币事件
Expand Down

0 comments on commit 1727039

Please sign in to comment.