The _beforeInitialize function checks key.currency1 twice instead of validating both currency0 and currency1, allowing pools without the ReFi token to bypass validation or incorrectly rejecting valid pools where ReFi is currency0.
The hook is designed to only allow pools containing the ReFi token to be initialized with this hook, ensuring the fee logic applies correctly.
The validation contains a copy-paste error where key.currency1 is checked twice, completely ignoring key.currency0.
Likelihood:
This occurs on every pool initialization attempt where ReFi is currency0
The condition currency1 != ReFi && currency1 != ReFi is logically equivalent to just currency1 != ReFi
Impact:
Pools where ReFi is currency0 will always revert with ReFiNotInPool() even when ReFi IS in the pool
The hook becomes non-functional for half of all valid pool configurations
When initializing a pool with ETH/ReFi where ReFi is currency1, the check passes. However, when initializing ReFi/USDC where ReFi is currency0, the check fails because it only examines currency1 (which is USDC), incorrectly reverting.
Fix the condition to check both currencies:
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.