wip
This commit is contained in:
parent
07c9347741
commit
40f72cfff5
12 changed files with 39 additions and 12 deletions
|
|
@ -1 +0,0 @@
|
|||
Subproject commit b6a506db2262cad5ff982a87789ee6d1558ec861
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit dbb6104ce834628e473d2173bbc9d47f81a9eec3
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit c892309933b25c03d32b1b0d674df7ae292ba925
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 1e2e1b35c1720518dec222e3f531fb82375c0881
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit e3589b192d0be27e100cd0daaf6c97204fdb1899
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 80f26c86c57b8a5e4b913f42844d4c8bd274d058
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
@openzeppelin/=lib/openzeppelin-contracts/contracts/
|
||||
@uniswap/v3-core/=lib/v3-core/
|
||||
@uniswap/v3-periphery/=lib/v3-periphery/
|
||||
@uniswap-v3-core/=lib/v3-core/
|
||||
@aperture/uni-v3-lib/=lib/uni-v3-lib/src/
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import './lib/PositionKey.sol';
|
||||
import './lib/FixedPoint128.sol';
|
||||
import './lib/FixedPoint96.sol';
|
||||
import '@uniswap-v3-core/contracts/interfaces/IUniswapV3Pool.sol';
|
||||
import '@aperture/uni-v3-lib/TickMath.sol';
|
||||
import '@aperture/uni-v3-lib/LiquidityAmounts.sol';
|
||||
import '@aperture/uni-v3-lib/PoolAddress.sol';
|
||||
import '@aperture/uni-v3-lib/CallbackValidation.sol';
|
||||
import '@uniswap/v3-periphery/contracts/libraries/PositionKey.sol';
|
||||
import '@uniswap/v3-core/contracts/libraries/FixedPoint128.sol';
|
||||
import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol';
|
||||
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
|
||||
/**
|
||||
|
|
|
|||
8
onchain/src/lib/FixedPoint128.sol
Normal file
8
onchain/src/lib/FixedPoint128.sol
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
pragma solidity >=0.4.0;
|
||||
|
||||
/// @title FixedPoint128
|
||||
/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)
|
||||
library FixedPoint128 {
|
||||
uint256 internal constant Q128 = 0x100000000000000000000000000000000;
|
||||
}
|
||||
10
onchain/src/lib/FixedPoint96.sol
Normal file
10
onchain/src/lib/FixedPoint96.sol
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
pragma solidity >=0.4.0;
|
||||
|
||||
/// @title FixedPoint96
|
||||
/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)
|
||||
/// @dev Used in SqrtPriceMath.sol
|
||||
library FixedPoint96 {
|
||||
uint8 internal constant RESOLUTION = 96;
|
||||
uint256 internal constant Q96 = 0x1000000000000000000000000;
|
||||
}
|
||||
13
onchain/src/lib/PositionKey.sol
Normal file
13
onchain/src/lib/PositionKey.sol
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
pragma solidity >=0.5.0;
|
||||
|
||||
library PositionKey {
|
||||
/// @dev Returns the key of the position in the core library
|
||||
function compute(
|
||||
address owner,
|
||||
int24 tickLower,
|
||||
int24 tickUpper
|
||||
) internal pure returns (bytes32) {
|
||||
return keccak256(abi.encodePacked(owner, tickLower, tickUpper));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue