_beforeInitialize checks currency1 twice. Any pool initialization reverts unless currency1 == ReFi (which is almost never the case).
This makes the entire hook completely unusable on any real deployment.
Likelihood:
The function intends to validate that either currency0 or currency1 of the pool equals the ReFi token address. The code checks currency1 twice and never checks currency0. The net condition simplifies to if (currency1 != ReFi) revert; - meaning initialization only succeeds when currency1 == ReFi.
Impact:
Pools where the ReFi token is token0 (i.e., currency0 == ReFi) fail to initialize with the hook attached. This prevents legitimate pool creation for half of token-pair orderings.
If tooling or scripts assume ReFi may be currency0 (common if tokens are listed by address ordering), automated pool launches will fail.
The hook’s _beforeInitialize checks only key.currency1 twice:
When reFiToken is currency0, the condition becomes:
solidity
if (token != reFiToken && token != reFiToken) -> true -> revert!
So even though ReFi is in the pool, it reverts → bug confirmed.
Patch _beforeInitialize as shown below, then run the provided Forge PoC. Update tests to expect success for both token orderings.
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.