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

[Bug]: access modifier should be internal for _rebalance in the FullRange example (security related)

Open ferencdg opened this issue 1 year ago • 2 comments

Describe the bug

https://github.com/Uniswap/v4-periphery/blob/581d96dfd8b281cafe351205bf6d2d65efb4df90/contracts/hooks/examples/FullRange.sol#L317

is public

Expected Behavior

should be internal

To Reproduce

No response

Additional context

No response

ferencdg avatar Nov 23 '23 11:11 ferencdg

the function starts with _ and hence looks like an internal function. However, the developer put it external because rebalance can happen in more cases and may need be triggerable directly for external caller. it seems that the developer hasn't fully handled this, so he put it as public first. (that's how I feel).

xben12 avatar Nov 27 '23 02:11 xben12

We also discussed that. I believe they first made it internal and then decided to make it public but forgot to update the name.

damianrusinek avatar Dec 05 '23 11:12 damianrusinek

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