Skip to content

Commit

Permalink
Merge pull request #796 from YuanBoXie/main
Browse files Browse the repository at this point in the history
fix: fix typo
  • Loading branch information
AmazingAng authored Oct 19, 2024
2 parents 8244302 + ca8880d commit c83d76c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion 51_ERC4626/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ tags:

### ERC4626 要点

ERC4626 标准主要实现了一下几个逻辑
ERC4626 标准主要实现了以下几个逻辑

1. ERC20: ERC4626 继承了 ERC20,金库份额就是用 ERC20 代币代表的:用户将特定的 ERC20 基础资产(比如 WETH)存进金库,合约会给他铸造特定数量的金库份额代币;当用户从金库中提取基础资产时,会销毁相应数量的金库份额代币。`asset()` 函数会返回金库的基础资产的代币地址。
2. 存款逻辑:让用户存入基础资产,并铸造相应数量的金库份额。相关函数为 `deposit()``mint()``deposit(uint assets, address receiver)` 函数让用户存入 `assets` 单位的资产,并铸造相应数量的金库份额给 `receiver` 地址。`mint(uint shares, address receiver)` 与它类似,只不过是以将铸造的金库份额作为参数。
Expand Down
1 change: 1 addition & 0 deletions 56_DEX/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function addLiquidity(uint amount0Desired, uint amount1Desired) public returns(u
接下来,我们需要实现移除流动性的功能。当用户从池子中移除流动性 $\Delta{L}$ 时,合约要销毁LP份额代币,并按比例将代币返还给用户。返还代币的计算公式如下:

$$\Delta{x}={\frac{\Delta{L}}{L} * x}$$

$$\Delta{y}={\frac{\Delta{L}}{L} * y}$$

下面的 `removeLiquidity()` 函数实现移除流动性的功能,主要步骤如下:
Expand Down

0 comments on commit c83d76c

Please sign in to comment.