Skip to content

Commit

Permalink
Update decrease-liquidity.md to fix a bug in the demo code (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-the-pug authored Jan 17, 2025
1 parent 61d1435 commit d5ce3fa
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@ Here we decrease the liquidity of our position without withdrawing all of it.
deadline: block.timestamp
});
(amount0, amount1) = nonfungiblePositionManager.decreaseLiquidity(params);
nonfungiblePositionManager.decreaseLiquidity(params);
(amount0, amount1) = nonfungiblePositionManager.collect(
INonfungiblePositionManager.CollectParams({
tokenId: tokenId,
recipient: address(this),
amount0Max: type(uint128).max,
amount1Max: type(uint128).max
})
);
//send liquidity back to owner
_sendToOwner(tokenId, amount0, amount1);
Expand Down

0 comments on commit d5ce3fa

Please sign in to comment.