The _beforeInitialize hook is designed to ensure that the ReFi token must be present in every pool as either currency0 or currency1 before the pool can be initialized. This validates that all pools using this hook include ReFi as one of the trading pair currencies.
The validation logic incorrectly checks key.currency1 twice instead of checking both key.currency0 and key.currency1. This causes the function to only accept pools where ReFi is specifically in the currency1 position, rejecting valid pools where ReFi is in the currency0 position.
Likelihood:
Approximately 50% of potential trading pairs will place ReFi in the currency0 position based on address sorting, making this issue occur frequently
Users attempting to create pools with ReFi as the lower address token will always encounter reverts
Impact:
Legitimate pools (ReFi/USDC where ReFi's address < USDC's address) cannot be created
Users and liquidity providers cannot access intended functionality, blocking protocol adoption
This PoC is showing how the vulnerability can be provoked.
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.