forked from WTFAcademy/WTF-Dapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIPool.sol
100 lines (79 loc) · 2.25 KB
/
IPool.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.24;
interface IMintCallback {
function mintCallback(
uint256 amount0Owed,
uint256 amount1Owed,
bytes calldata data
) external;
}
interface ISwapCallback {
function swapCallback(
int256 amount0Delta,
int256 amount1Delta,
bytes calldata data
) external;
}
interface IPool {
struct Position {
uint128 liquidity;
uint128 tokensOwed0;
uint128 tokensOwed1;
}
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function fee() external view returns (uint24);
function tickLower() external view returns (int24);
function tickUpper() external view returns (int24);
function sqrtPriceX96() external view returns (uint160);
function tick() external view returns (int24);
function liquidity() external view returns (uint128);
function initialize(uint160 sqrtPriceX96) external;
event Mint(
address sender,
address indexed owner,
uint128 amount,
uint256 amount0,
uint256 amount1
);
function mint(
address recipient,
uint128 amount,
bytes calldata data
) external returns (uint256 amount0, uint256 amount1);
event Collect(
address indexed owner,
address recipient,
uint128 amount0,
uint128 amount1
);
function collect(
address recipient
) external returns (uint128 amount0, uint128 amount1);
event Burn(
address indexed owner,
uint128 amount,
uint256 amount0,
uint256 amount1
);
function burn(
uint128 amount
) external returns (uint256 amount0, uint256 amount1);
event Swap(
address indexed sender,
address indexed recipient,
int256 amount0,
int256 amount1,
uint160 sqrtPriceX96,
uint128 liquidity,
int24 tick
);
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external returns (int256 amount0, int256 amount1);
}