You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the suggested feature and problem it solves.
I have two hooks:
HookA, HookB and both of them derives from BaseHook and also initialize BaseHook. Now I want to create ComboHook which derives from HookA and HookB, however solidity complains that BaseHook is initialized twice (through HookA and HookB).
Describe the desired implementation.
Maybe make the BaseHook stateless and move out the _poolManager to the actual hook? Or just leave _poolManager in the BaseHook, but don't initialize it in the constructor.
Describe alternatives.
No response
Additional context.
No response
The text was updated successfully, but these errors were encountered:
ferencdg
changed the title
BaseHook makes hook hard to combine
current BaseHook implementation makes hooks hard to combine
Jan 2, 2024
inheritance in solidity is pretty ugly so the tradeoffs are really tricky and you tend to end up in the same place again.
I see a world of multi-featured hooks, but I'm uncertain if that'll be achieved by inheriting abstract contracts. Inheriting two hook contracts means you'll need to need resolve and override function collisions
I'm under the impression that library-ifying hook logic (LimitOrder, GeomeanOracle) will provide better devex for building multi-featured hooks
Component
Pool Interaction, Hooks
Describe the suggested feature and problem it solves.
I have two hooks:
HookA, HookB and both of them derives from BaseHook and also initialize BaseHook. Now I want to create ComboHook which derives from HookA and HookB, however solidity complains that BaseHook is initialized twice (through HookA and HookB).
Describe the desired implementation.
Maybe make the BaseHook stateless and move out the _poolManager to the actual hook? Or just leave _poolManager in the BaseHook, but don't initialize it in the constructor.
Describe alternatives.
No response
Additional context.
No response
The text was updated successfully, but these errors were encountered: