Skip to content

Commit fb34069

Browse files
authored
Merge pull request #146 from invariant-labs/refactor-positions-counter
make contract return alph when the only position on the list is removed
2 parents 1388c67 + ea2b43e commit fb34069

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contracts/collections/positions.ral

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ Abstract Contract Positions(clamm: CLAMM) extends PositionHelper(clamm) {
6464
positions[key] = lastPosition
6565
positions.remove!(caller, lastKey)
6666
}
67-
positionsCounter[caller] = length - 1
67+
if(length > 1) {
68+
positionsCounter[caller] = length - 1
69+
} else {
70+
positionsCounter.remove!(caller, caller)
71+
}
6872
}
6973

7074
@using(preapprovedAssets = true)

0 commit comments

Comments
 (0)