Skip to content

Commit

Permalink
adhere to CEI when unsubscribing on burn (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
saucepoint authored Sep 4, 2024
1 parent 4899de7 commit f9cf32b
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .forge-snapshots/PositionManager_burn_empty.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
47320
47276
2 changes: 1 addition & 1 deletion .forge-snapshots/PositionManager_burn_empty_native.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
47137
47094
Original file line number Diff line number Diff line change
@@ -1 +1 @@
123966
123923
Original file line number Diff line number Diff line change
@@ -1 +1 @@
123464
123420
Original file line number Diff line number Diff line change
@@ -1 +1 @@
131044
131001
Original file line number Diff line number Diff line change
@@ -1 +1 @@
130542
130499
2 changes: 1 addition & 1 deletion .forge-snapshots/PositionManager_decrease_burnEmpty.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
135120
135076
Original file line number Diff line number Diff line change
@@ -1 +1 @@
127859
127816
4 changes: 3 additions & 1 deletion src/PositionManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,13 @@ contract PositionManager is
(liquidityDelta - feesAccrued).validateMinOut(amount0Min, amount1Min);
}

if (positionConfigs[tokenId].hasSubscriber()) _unsubscribe(tokenId, config);
bool hasSubscriber = positionConfigs[tokenId].hasSubscriber();

delete positionConfigs[tokenId];
// Burn the token.
_burn(tokenId);

if (hasSubscriber) _unsubscribe(tokenId, config);
}

function _settlePair(Currency currency0, Currency currency1) internal {
Expand Down

0 comments on commit f9cf32b

Please sign in to comment.