[Bug]: when a pool with FullRange hook gets drained, removeLiquidity calls fail
Describe the bug
It's difficult to drain (or almost drain) a FullRange pool, but nevertheless possible. When that happens, i.e. balance of one of the tokens approaches zero, some functions like removeLiquidity are going to revert. Did not test the other functions.
Expected Behavior
removeLiquidity and other functions works as usual even in a drained pool.
To Reproduce
git clone https://github.com/atiselsts/v4-periphery
git checkout bug/rebalance-dos
forge test --match-path test/FullRange.t.sol --match-test ".*DrainAndRebalance.*" -vvvv
Additional context
No response
i was unable to reproduce this issue. removeLiquidity works fine in a drained pool.
Hi! thanks for flagging -- going to close this issue because:
-
hook examples no longer live in the main branch
-
custom accounting will allow for a more v2-style curve with v2 interfaces. reference implementation https://github.com/hensha256/v2-on-v4