Skip to content

Commit

Permalink
Add PCSV3 NPM interface and resolve test contract build warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarlycow committed Mar 23, 2024
1 parent 1a3c2f1 commit f806020
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aperture_finance/uni-v3-lib",
"description": "A suite of Solidity libraries that have been imported and rewritten from Uniswap's v3-core and v3-periphery",
"version": "2.0.0",
"version": "2.0.1",
"author": "Aperture Finance",
"homepage": "https://aperture.finance/",
"license": "GPL-2.0-or-later",
Expand Down
8 changes: 8 additions & 0 deletions src/interfaces/INonfungiblePositionManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,11 @@ interface INonfungiblePositionManager is
/// @param tokenId The ID of the token that is being burned
function burn(uint256 tokenId) external payable;
}

/// @title Non-fungible token for PancakeSwap V3 positions
/// @notice Wraps PCSV3 positions in a non-fungible token interface which allows for them to be transferred
/// and authorized.
interface IPCSV3NonfungiblePositionManager is INonfungiblePositionManager {
/// @return Returns the address of the PancakeSwap V3 deployer
function deployer() external view returns (address);
}
4 changes: 2 additions & 2 deletions test/SafeCast.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract SafeCastTest is Test {
SafeCast.toInt128(-int256(1 << 127) - 1);
}

function testToInt128() public {
function testToInt128() public pure {
assertEq(SafeCast.toInt128(uint256(int256(type(int128).max))), type(int128).max);
}

Expand All @@ -69,7 +69,7 @@ contract SafeCastTest is Test {
SafeCast.toInt256(1 << 255);
}

function testToInt256() public {
function testToInt256() public pure {
assertEq(SafeCast.toInt256(uint256(type(int256).max)), type(int256).max);
}

Expand Down
4 changes: 2 additions & 2 deletions test/TickBitmap.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ contract TickBitmapTest is BaseTest {
wrapper = new TickBitmapWrapper();
}

function testFuzz_Position(int24 tick) public {
function testFuzz_Position(int24 tick) public pure {
int16 wordPos;
uint8 bitPos;
assembly {
Expand All @@ -51,7 +51,7 @@ contract TickBitmapTest is BaseTest {
assertEq(bitPos, uint8(int8(tick % 256)));
}

function testFuzz_Compress(int24 tick, int24 _tickSpacing) public {
function testFuzz_Compress(int24 tick, int24 _tickSpacing) public pure {
_tickSpacing = int24(bound(_tickSpacing, 1, 200));
int24 compressed = tick / _tickSpacing;
if (tick < 0 && tick % _tickSpacing != 0) compressed--;
Expand Down
4 changes: 2 additions & 2 deletions test/TickMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ contract TickMathTest is Test {
}

/// @notice Test the equivalence of the original and new `getSqrtRatioAtTick`
function testFuzz_GetSqrtRatioAtTick(int24 tick) public {
function testFuzz_GetSqrtRatioAtTick(int24 tick) public view {
tick = int24(bound(tick, TickMath.MIN_TICK, TickMath.MAX_TICK));
uint160 sqrtPriceX96 = TickMath.getSqrtRatioAtTick(tick);
assertEq(tick, TickMath.getTickAtSqrtRatio(sqrtPriceX96));
Expand Down Expand Up @@ -82,7 +82,7 @@ contract TickMathTest is Test {
}

/// @notice Test the equivalence of `getTickAtSqrtRatio` and the original library
function testFuzz_GetTickAtSqrtRatio(uint160 sqrtPriceX96) public {
function testFuzz_GetTickAtSqrtRatio(uint160 sqrtPriceX96) public view {
sqrtPriceX96 = uint160(bound(sqrtPriceX96, TickMath.MIN_SQRT_RATIO, TickMath.MAX_SQRT_RATIO - 1));
assertEq(TickMath.getTickAtSqrtRatio(sqrtPriceX96), ogWrapper.getTickAtSqrtRatio(sqrtPriceX96));
}
Expand Down

0 comments on commit f806020

Please sign in to comment.