Skip to content

Commit 39121a6

Browse files
committed
test: add invariant_CannotTradeUnderLowerSlug invariant check
1 parent de26d48 commit 39121a6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/invariant/DopplerInvariants.sol

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@ contract DopplerInvariantsTest is BaseTest {
102102
}
103103
}
104104

105+
function invariant_CannotTradeUnderLowerSlug() public view {
106+
(int24 tickLower,,,) = hook.positions(bytes32(uint256(1)));
107+
int24 currentTick = hook.getCurrentTick(poolId);
108+
109+
if (isToken0) {
110+
assertTrue(currentTick >= tickLower);
111+
} else {
112+
assertTrue(currentTick <= tickLower);
113+
}
114+
}
115+
105116
/// forge-config: default.invariant.fail-on-revert = true
106117
function invariant_PositionsDifferentTicks() public view {
107118
uint256 slugs = hook.getNumPDSlugs();

0 commit comments

Comments
 (0)