Skip to content

Commit

Permalink
3 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
advock committed Dec 15, 2022
1 parent 7c9928f commit f6a01a1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "/Users/advock/arda-sol/lib/v3-periphery"]
branch = 0.8
[submodule "/Users/advock/arda-sol/lib/v3-core"]
branch = 0.8
1 change: 1 addition & 0 deletions remappings.txt → remapping.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ forge-std/=lib/forge-std/src/
openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/
solady/=lib/solady/src/
solmate/=lib/solmate/src/
v3-core/=lib/v3-core/contracts/
v3-periphery/=lib/v3-periphery/contracts/
5 changes: 1 addition & 4 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ import {Script} from "forge-std/Script.sol";

import {LPTracker} from "src/LPTracker.sol";

/// @notice A very simple deployment script
contract Deploy is Script {
/// @notice The main script entrypoint
/// @return greeter The deployed contract
function run() external returns (LPTracker lptracker) {
vm.startBroadcast();
lptracker = new LPTracker("GM");
lptracker = new LPTracker(0xC36442b4a4522E871399CD717aBDD847Ab11FE88);
vm.stopBroadcast();
}
}
23 changes: 14 additions & 9 deletions src/LPTracker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ contract LPTracker {
positionManager = INonfungiblePositionManager(_positionManager);
}

function Position(uint256 TokenId)
public
function Position(uint128 TokenId)
external
view
returns (
int24,
uint160,
Expand Down Expand Up @@ -59,13 +60,15 @@ contract LPTracker {
);
}

function wid(
uint256 tokenId,
uint128 liquidity,
uint256 amount0Min,
uint256 amount1Min,
uint256 deadline
) external {
function wid(uint256 tokenId) external returns (bool) {
uint256 amount0Min = type(uint256).max;
uint256 amount1Min = type(uint256).max;
uint256 deadline = block.number + 2;

(, , , , , , , uint128 liquidity, , , , ) = positionManager.positions(
tokenId
);

INonfungiblePositionManager.DecreaseLiquidityParams
memory params = INonfungiblePositionManager
.DecreaseLiquidityParams({
Expand All @@ -77,5 +80,7 @@ contract LPTracker {
});

positionManager.decreaseLiquidity(params);

return true;
}
}
42 changes: 0 additions & 42 deletions test/Greeter.t.sol

This file was deleted.

0 comments on commit f6a01a1

Please sign in to comment.