_beforeInitialize should enforce that any pool initialized with this hook MUST include the ReFi token as either currency0 or currency1. This ensures the hook only runs on pools relevant to ReFi and prevents unintended behavior on unrelated pools.
Problem:
The current implementation incorrectly checks currency1 twice and never checks currency0, leading to a broken invariant that allows initialization of pools that do not include the ReFi token at all.
Likelihood:
Pools are often initialized in automated scripts or via external integrators, causing this broken check to routinely allow pools without ReFi.
The hook applies dynamic fees and emits ReFi-specific events; when used on the wrong pool, execution paths depending on ReFi will misbehave or revert inconsistently during swaps.
Impact:
Non-ReFi pools can be initialized with this hook, enabling incorrect dynamic fee behavior and wrong event emission.
Downstream logic assuming the presence of ReFi may malfunction, leading to inconsistent state, unexpected reverts, or incorrect accounting.
A pool with tokens (ReFi, TokenB) (neither is ReFi) still initializes successfully:
Check both currencies explicitly:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.