v4-periphery icon indicating copy to clipboard operation
v4-periphery copied to clipboard

[Bug]: when a pool with FullRange hook gets drained, removeLiquidity calls fail

Open atiselsts opened this issue 2 years ago • 1 comments

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

atiselsts avatar Dec 10 '23 17:12 atiselsts

i was unable to reproduce this issue. removeLiquidity works fine in a drained pool.

Jun1on avatar Jul 01 '24 03:07 Jun1on

Hi! thanks for flagging -- going to close this issue because:

  1. hook examples no longer live in the main branch

  2. custom accounting will allow for a more v2-style curve with v2 interfaces. reference implementation https://github.com/hensha256/v2-on-v4

saucepoint avatar Sep 04 '24 22:09 saucepoint