-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathIPositionManager.sol
66 lines (58 loc) · 1.57 KB
/
IPositionManager.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
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.24;
pragma abicoder v2;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
interface IPositionManager is IERC721 {
struct PositionInfo {
uint256 id;
address owner;
address token0;
address token1;
uint32 index;
uint24 fee;
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
uint128 tokensOwed0;
uint128 tokensOwed1;
// feeGrowthInside0LastX128 和 feeGrowthInside1LastX128 用于计算手续费
uint256 feeGrowthInside0LastX128;
uint256 feeGrowthInside1LastX128;
}
function getAllPositions()
external
view
returns (PositionInfo[] memory positionInfo);
struct MintParams {
address token0;
address token1;
uint32 index;
uint256 amount0Desired;
uint256 amount1Desired;
address recipient;
uint256 deadline;
}
function mint(
MintParams calldata params
)
external
payable
returns (
uint256 positionId,
uint128 liquidity,
uint256 amount0,
uint256 amount1
);
function burn(
uint256 positionId
) external returns (uint256 amount0, uint256 amount1);
function collect(
uint256 positionId,
address recipient
) external returns (uint256 amount0, uint256 amount1);
function mintCallback(
uint256 amount0,
uint256 amount1,
bytes calldata data
) external;
}