Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(repo name): fix repo name #168

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 01_HelloVitalik/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tags:

**推特**:[@0xAA_Science](https://twitter.com/0xAA_Science)

**WTF Academy社群:** [官网 wtf.academy](https://wtf.academy) | [WTF Solidity教程](https://github.com/AmazingAng/WTFSolidity) | [discord](https://discord.gg/5akcruXrsk) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link)
**WTF Academy社群:** [官网 wtf.academy](https://wtf.academy) | [WTF Solidity教程](https://github.com/AmazingAng/WTF-Solidity) | [discord](https://discord.gg/5akcruXrsk) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link)

所有代码和教程开源在github: [github.com/WTFAcademy/WTF-Ethers](https://github.com/WTFAcademy/WTF-Ethers)

Expand Down
2 changes: 1 addition & 1 deletion 02_Provider/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tags:

### 创建节点服务商的API Key

首先,你需要去节点服务商的网站注册并创建`API Key`。在`WTF Solidity极简教程`的工具篇,我们介绍了[Infura](https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL02_Infura/readme.md)和[Alchemy](https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md)两家公司`API Key`的创建方法,大家可以参考。
首先,你需要去节点服务商的网站注册并创建`API Key`。在`WTF Solidity极简教程`的工具篇,我们介绍了[Infura](https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL02_Infura/readme.md)和[Alchemy](https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md)两家公司`API Key`的创建方法,大家可以参考。

![Infura API Key](img/2-1.png)

Expand Down
2 changes: 1 addition & 1 deletion 03_ReadContract/ReadContract.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { ethers } from "ethers";

// 利用Alchemy的rpc节点连接以太坊网络
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_MAINNET_URL = 'https://eth-mainnet.g.alchemy.com/v2/oKmOQKbneVkxgHZfibs-iFhIlIAl6HDN';
const provider = new ethers.JsonRpcProvider(ALCHEMY_MAINNET_URL);

Expand Down
2 changes: 1 addition & 1 deletion 03_ReadContract/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const contract = new ethers.Contract(`address`, `abi`, `signer`);
```javascript
import { ethers } from "ethers";
// 利用Infura的rpc节点连接以太坊网络
// 准备Infura API Key, 教程:https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL02_Infura/readme.md
// 准备Infura API Key, 教程:https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL02_Infura/readme.md
const INFURA_ID = ''
// 连接以太坊主网
const provider = new ethers.JsonRpcProvider(`https://mainnet.infura.io/v3/${INFURA_ID}`)
Expand Down
2 changes: 1 addition & 1 deletion 04_SendETH/SendETH.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { ethers } from "ethers";

// 利用Alchemy的rpc节点连接以太坊测试网络
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_GOERLI_URL = 'https://eth-goerli.alchemyapi.io/v2/GlaeWuylnNM3uuOo-SAwJxuwTdqHaY5l';
const provider = new ethers.JsonRpcProvider(ALCHEMY_GOERLI_URL);

Expand Down
2 changes: 1 addition & 1 deletion 04_SendETH/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const wallet3 = ethers.Wallet.fromPhrase(mnemonic.phrase)
import { ethers } from "ethers";

// 利用Alchemy的rpc节点连接以太坊测试网络
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_GOERLI_URL = 'https://eth-goerli.alchemyapi.io/v2/GlaeWuylnNM3uuOo-SAwJxuwTdqHaY5l';
const provider = new ethers.JsonRpcProvider(ALCHEMY_GOERLI_URL);
```
Expand Down
2 changes: 1 addition & 1 deletion 05_WriteContract/WriteContract.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ethers } from "ethers";
// import { ethers } from "https://cdn-cors.ethers.io/lib/ethers-5.6.9.esm.min.js";

// 利用Alchemy的rpc节点连接以太坊网络
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_GOERLI_URL = 'https://eth-goerli.alchemyapi.io/v2/GlaeWuylnNM3uuOo-SAwJxuwTdqHaY5l';
const provider = new ethers.JsonRpcProvider(ALCHEMY_GOERLI_URL);

Expand Down
2 changes: 1 addition & 1 deletion 05_WriteContract/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ await tx.wait()

## 例子:与测试网`WETH`合约交互

`WETH` (Wrapped ETH)是`ETH`的带包装版本,将以太坊原生代币用智能合约包装成了符合`ERC20`的代币。对`WETH`合约更详细的内容可以参考WTF Solidity极简合约的[第41讲 WETH](https://github.com/AmazingAng/WTFSolidity/blob/main/41_WETH/readme.md)。
`WETH` (Wrapped ETH)是`ETH`的带包装版本,将以太坊原生代币用智能合约包装成了符合`ERC20`的代币。对`WETH`合约更详细的内容可以参考WTF Solidity极简合约的[第41讲 WETH](https://github.com/AmazingAng/WTF-Solidity/blob/main/41_WETH/readme.md)。

1. 创建`provider`,`wallet`变量。

Expand Down
2 changes: 1 addition & 1 deletion 06_DeployContract/DeployContract.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions 06_DeployContract/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tags:

## 部署智能合约

在以太坊上,智能合约的部署是一种特殊的交易:将编译智能合约得到的字节码发送到0地址。如果这个合约的构造函数有参数的话,需要利用`abi.encode`将参数编码为字节码,然后附在在合约字节码的尾部一起发送。对于ABI编码的介绍见WTF Solidity极简教程[第27讲 ABI编码](https://github.com/AmazingAng/WTFSolidity/blob/main/27_ABIEncode/readme.md)。
在以太坊上,智能合约的部署是一种特殊的交易:将编译智能合约得到的字节码发送到0地址。如果这个合约的构造函数有参数的话,需要利用`abi.encode`将参数编码为字节码,然后附在在合约字节码的尾部一起发送。对于ABI编码的介绍见WTF Solidity极简教程[第27讲 ABI编码](https://github.com/AmazingAng/WTF-Solidity/blob/main/27_ABIEncode/readme.md)。

## 合约工厂

Expand All @@ -55,7 +55,7 @@ await contractERC20.waitForDeployment();

## 例子:部署ERC20代币合约

`ERC20`标准代币合约的介绍见WTF Solidity极简教程[第31讲 ERC20](https://github.com/AmazingAng/WTFSolidity/blob/main/31_ERC20/readme.md)。
`ERC20`标准代币合约的介绍见WTF Solidity极简教程[第31讲 ERC20](https://github.com/AmazingAng/WTF-Solidity/blob/main/31_ERC20/readme.md)。

1. 创建`provider`和`wallet`变量。
```js
Expand Down
2 changes: 1 addition & 1 deletion 07_Event/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ethers } from "ethers";
// import { ethers } from "https://cdn-cors.ethers.io/lib/ethers-5.6.9.esm.min.js";

// 利用Alchemy的rpc节点连接以太坊网络
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_GOERLI_URL = 'https://eth-goerli.alchemyapi.io/v2/GlaeWuylnNM3uuOo-SAwJxuwTdqHaY5l';
const provider = new ethers.JsonRpcProvider(ALCHEMY_GOERLI_URL);

Expand Down
4 changes: 2 additions & 2 deletions 07_Event/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tags:

提示:本教程基于ethers.js 6.3.0 ,如果你使用的是v5,可以参考[ethers.js v5文档](https://docs.ethers.io/v5/)。

这一讲,我们将介绍如何使用`ethers.js`读取智能合约释放的事件。如果你不了解`Solidity`的事件,可以阅读WTF Solidity极简教程中[第12讲:事件](https://github.com/AmazingAng/WTFSolidity/blob/main/12_Event/readme.md)。
这一讲,我们将介绍如何使用`ethers.js`读取智能合约释放的事件。如果你不了解`Solidity`的事件,可以阅读WTF Solidity极简教程中[第12讲:事件](https://github.com/AmazingAng/WTF-Solidity/blob/main/12_Event/readme.md)。

具体可参考[ethers.js文档](https://docs.ethers.org/v6/api/contract/#ContractEvent)。

Expand Down Expand Up @@ -61,7 +61,7 @@ const transferEvents = await contract.queryFilter('事件名', 起始区块, 结
```js
import { ethers } from "ethers";
// 利用Alchemy的rpc节点连接以太坊网络
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_GOERLI_URL = 'https://eth-goerli.alchemyapi.io/v2/GlaeWuylnNM3uuOo-SAwJxuwTdqHaY5l';
const provider = new ethers.JsonRpcProvider(ALCHEMY_GOERLI_URL);
```
Expand Down
2 changes: 1 addition & 1 deletion 08_ContractListener/ContractListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { ethers } from "ethers";

// 准备 alchemy API
// 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
// 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_MAINNET_URL = 'https://eth-mainnet.g.alchemy.com/v2/oKmOQKbneVkxgHZfibs-iFhIlIAl6HDN';
// 连接主网 provider
const provider = new ethers.JsonRpcProvider(ALCHEMY_MAINNET_URL);
Expand Down
4 changes: 2 additions & 2 deletions 08_ContractListener/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ contract.once("eventName", function)

## 监听`USDT`合约

1. 声明`provider`:Alchemy是一个免费的ETH节点提供商。需要先申请一个,后续会用到。你可以参考这篇攻略来申请Alchemy API[Solidity极简入门-工具篇4:Alchemy](https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md )
1. 声明`provider`:Alchemy是一个免费的ETH节点提供商。需要先申请一个,后续会用到。你可以参考这篇攻略来申请Alchemy API[Solidity极简入门-工具篇4:Alchemy](https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md )

```js
import { ethers } from "ethers";
// 准备 alchemy API
// 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
// 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_MAINNET_URL = 'https://eth-mainnet.g.alchemy.com/v2/oKmOQKbneVkxgHZfibs-iFhIlIAl6HDN';
// 连接主网 provider
const provider = new ethers.JsonRpcProvider(ALCHEMY_MAINNET_URL);
Expand Down
2 changes: 1 addition & 1 deletion 09_EventFilter/EventFilter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ethers } from "ethers";

// 利用Alchemy的rpc节点连接以太坊网络
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
// 准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_MAINNET_URL = 'https://eth-mainnet.g.alchemy.com/v2/oKmOQKbneVkxgHZfibs-iFhIlIAl6HDN';
const provider = new ethers.JsonRpcProvider(ALCHEMY_MAINNET_URL);

Expand Down
2 changes: 1 addition & 1 deletion 09_EventFilter/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tags:

**推特**:[@0xAA_Science](https://twitter.com/0xAA_Science)

**WTF Academy社群:** [官网 wtf.academy](https://wtf.academy) | [WTF Solidity教程](https://github.com/AmazingAng/WTFSolidity) | [discord](https://discord.gg/5akcruXrsk) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link)
**WTF Academy社群:** [官网 wtf.academy](https://wtf.academy) | [WTF Solidity教程](https://github.com/AmazingAng/WTF-Solidity) | [discord](https://discord.gg/5akcruXrsk) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link)

所有代码和教程开源在github: [github.com/WTFAcademy/WTFEthers](https://github.com/WTFAcademy/WTFEthers)

Expand Down
4 changes: 2 additions & 2 deletions 11_StaticCall/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tags:

**推特**:[@0xAA_Science](https://twitter.com/0xAA_Science)

**WTF Academy社群:** [官网 wtf.academy](https://wtf.academy) | [WTF Solidity教程](https://github.com/AmazingAng/WTFSolidity) | [discord](https://discord.gg/5akcruXrsk) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link)
**WTF Academy社群:** [官网 wtf.academy](https://wtf.academy) | [WTF Solidity教程](https://github.com/AmazingAng/WTF-Solidity) | [discord](https://discord.gg/5akcruXrsk) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link)

所有代码和教程开源在github: [github.com/WTFAcademy/WTFEthers](https://github.com/WTFAcademy/WTFEthers)

Expand Down Expand Up @@ -61,7 +61,7 @@ tags:
```js
import { ethers } from "ethers";

//准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
//准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_MAINNET_URL = 'https://eth-mainnet.g.alchemy.com/v2/oKmOQKbneVkxgHZfibs-iFhIlIAl6HDN';
const provider = new ethers.JsonRpcProvider(ALCHEMY_MAINNET_URL);

Expand Down
2 changes: 1 addition & 1 deletion 11_StaticCall/staticCall.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// contract.函数名.staticCall(参数, {override})
import { ethers } from "ethers";

//准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
//准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_MAINNET_URL = 'https://eth-mainnet.g.alchemy.com/v2/oKmOQKbneVkxgHZfibs-iFhIlIAl6HDN';
const provider = new ethers.JsonRpcProvider(ALCHEMY_MAINNET_URL);

Expand Down
2 changes: 1 addition & 1 deletion 12_ERC721Check/ERC721Check.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ethers } from "ethers";

//准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
//准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_MAINNET_URL = 'https://eth-mainnet.g.alchemy.com/v2/oKmOQKbneVkxgHZfibs-iFhIlIAl6HDN';
const provider = new ethers.JsonRpcProvider(ALCHEMY_MAINNET_URL);

Expand Down
6 changes: 3 additions & 3 deletions 12_ERC721Check/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tags:

**推特**:[@0xAA_Science](https://twitter.com/0xAA_Science)

**WTF Academy社群:** [官网 wtf.academy](https://wtf.academy) | [WTF Solidity教程](https://github.com/AmazingAng/WTFSolidity) | [discord](https://discord.gg/5akcruXrsk) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link)
**WTF Academy社群:** [官网 wtf.academy](https://wtf.academy) | [WTF Solidity教程](https://github.com/AmazingAng/WTF-Solidity) | [discord](https://discord.gg/5akcruXrsk) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link)

所有代码和教程开源在github: [github.com/WTFAcademy/WTFEthers](https://github.com/WTFAcademy/WTFEthers)

Expand All @@ -26,7 +26,7 @@ tags:

## `ERC721`

`ERC721`是以太坊上流行的非同质化代币(NFT)标准,如果对这个标准不熟悉,可以阅读[WTF Solidity第34讲 ERC721](https://github.com/AmazingAng/WTFSolidity/blob/main/34_ERC721/readme.md)。在做NFT相关产品时,我们需要筛选出符合`ERC721`标准的合约。例如Opensea,他会自动识别`ERC721`,并爬下它的名称、代号、metadata等数据用于展示。要识别`ERC721`,我们先要理解`ERC165`。
`ERC721`是以太坊上流行的非同质化代币(NFT)标准,如果对这个标准不熟悉,可以阅读[WTF Solidity第34讲 ERC721](https://github.com/AmazingAng/WTF-Solidity/blob/main/34_ERC721/readme.md)。在做NFT相关产品时,我们需要筛选出符合`ERC721`标准的合约。例如Opensea,他会自动识别`ERC721`,并爬下它的名称、代号、metadata等数据用于展示。要识别`ERC721`,我们先要理解`ERC165`。

## `ERC165`

Expand Down Expand Up @@ -62,7 +62,7 @@ interface IERC165 {

1. 创建`provider`,连接以太坊主网。
```js
//准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
//准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_MAINNET_URL = 'https://eth-mainnet.g.alchemy.com/v2/oKmOQKbneVkxgHZfibs-iFhIlIAl6HDN';
const provider = new ethers.JsonRpcProvider(ALCHEMY_MAINNET_URL);
```
Expand Down
2 changes: 1 addition & 1 deletion 13_EncodeCalldata/EncodeCalldata.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// const interface2 = contract.interface
import { ethers } from "ethers";

//准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
//准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_GOERLI_URL = 'https://eth-goerli.alchemyapi.io/v2/GlaeWuylnNM3uuOo-SAwJxuwTdqHaY5l';
const provider = new ethers.JsonRpcProvider(ALCHEMY_GOERLI_URL);

Expand Down
6 changes: 3 additions & 3 deletions 13_EncodeCalldata/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tags:

**推特**:[@0xAA_Science](https://twitter.com/0xAA_Science)

**WTF Academy社群:** [官网 wtf.academy](https://wtf.academy) | [WTF Solidity教程](https://github.com/AmazingAng/WTFSolidity) | [discord](https://discord.gg/5akcruXrsk) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link)
**WTF Academy社群:** [官网 wtf.academy](https://wtf.academy) | [WTF Solidity教程](https://github.com/AmazingAng/WTF-Solidity) | [discord](https://discord.gg/5akcruXrsk) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link)

所有代码和教程开源在github: [github.com/WTFAcademy/WTFEthers](https://github.com/WTFAcademy/WTFEthers)

Expand All @@ -25,7 +25,7 @@ tags:

## 接口类 Interface

`ethers.js`的接口类抽象了与以太坊网络上的合约交互所需的`ABI`编码和解码。`ABI`(Application Binary Interface)与`API`类似,是一格式,用于对合约可以处理的各种类型的数据进行编码,以便它们可以交互。更多内容见[WTF Solidity教程第27讲 ABI编码](https://github.com/AmazingAng/WTFSolidity/tree/main/27_ABIEncode)。
`ethers.js`的接口类抽象了与以太坊网络上的合约交互所需的`ABI`编码和解码。`ABI`(Application Binary Interface)与`API`类似,是一格式,用于对合约可以处理的各种类型的数据进行编码,以便它们可以交互。更多内容见[WTF Solidity教程第27讲 ABI编码](https://github.com/AmazingAng/WTF-Solidity/tree/main/27_ABIEncode)。

我们可以利用`abi`生成或者直接从合约中获取`interface`变量:

Expand Down Expand Up @@ -68,7 +68,7 @@ const interface2 = contract.interface
1. 创建`provider`,`wallet`变量。

```js
//准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
//准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_GOERLI_URL = 'https://eth-rinkeby.alchemyapi.io/v2/GlaeWuylnNM3uuOo-SAwJxuwTdqHaY5l';
const provider = new ethers.JsonRpcProvider(ALCHEMY_GOERLI_URL);

Expand Down
2 changes: 1 addition & 1 deletion 15_MultiTransfer/MultiTransfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const amounts = Array(20).fill(ethers.parseEther("0.0001"))
console.log(`发送数额:${amounts}`)

// 3. 创建provider和wallet,发送代币用
//准备 alchemy API 可以参考https://github.com/AmazingAng/WTFSolidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
//准备 alchemy API 可以参考https://github.com/AmazingAng/WTF-Solidity/blob/main/Topics/Tools/TOOL04_Alchemy/readme.md
const ALCHEMY_GOERLI_URL = 'https://eth-goerli.alchemyapi.io/v2/GlaeWuylnNM3uuOo-SAwJxuwTdqHaY5l';
const provider = new ethers.JsonRpcProvider(ALCHEMY_GOERLI_URL);

Expand Down
Loading