Skip to content

Commit

Permalink
feat: update contract design doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yutingzhao1991 committed Aug 5, 2024
1 parent ebb6840 commit c49fc43
Show file tree
Hide file tree
Showing 15 changed files with 107 additions and 417 deletions.
12 changes: 6 additions & 6 deletions P002_WhatIsUniswap/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,21 @@ function createAndInitializePoolIfNecessary(

创建交易池调用的是 `UniswapV3Factory` 合约的 [createPool](https://github.com/Uniswap/v3-core/blob/main/contracts/UniswapV3Factory.sol#L35),参数为:

- tokenA:token0 的地址
- tokenB 地址:token1 的地址;
- token0:token0 的地址
- token1 地址:token1 的地址;
- fee:手续费费率。

代码为:

```solidity
/// @inheritdoc IUniswapV3Factory
function createPool(
address tokenA,
address tokenB,
address token0,
address token1,
uint24 fee
) external override noDelegateCall returns (address pool) {
require(tokenA != tokenB);
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != token1);
(address token0, address token1) = token0 < token1 ? (token0, token1) : (token1, token0);
require(token0 != address(0));
int24 tickSpacing = feeAmountTickSpacing[fee];
require(tickSpacing != 0);
Expand Down
29 changes: 0 additions & 29 deletions P101_ContractsDesign/code/IFactory.sol

This file was deleted.

98 changes: 0 additions & 98 deletions P101_ContractsDesign/code/IPool.sol

This file was deleted.

51 changes: 0 additions & 51 deletions P101_ContractsDesign/code/IPoolManager.sol

This file was deleted.

58 changes: 0 additions & 58 deletions P101_ContractsDesign/code/IPositionManager.sol

This file was deleted.

59 changes: 0 additions & 59 deletions P101_ContractsDesign/code/ISwapRouter.sol

This file was deleted.

Binary file added P101_ContractsDesign/img/uml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c49fc43

Please sign in to comment.