Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adhere to CEI when unsubscribing on burn #333

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading