In RebateFiHook.sol, the _beforeInitialize() function checks to ensure that the ReFi token is in the pool.
However, it erroneously checks key.currency1 twice instead of checking both key.currency0and key.currency1.
As a result, even if currency0 is ReFi, the function will revert, preventing the creation of pools where the ReFi token is currency0 rather than currency1.
Since UniswapV4's PoolManager.sol reverts if currency0 >= currency1 (forcing trading pairs to be sorted properly), developers cannot simply force the ReFi token address into currency1 each time. If a token's address is greater than the ReFi token address, every attempt to pair them in a pool together with the RebateFi Hook will fail.
Likelihood: High
Depends on the ReFi token contract's address (could be very high or very low), but on average half of all possible pools would fail to initialize.
Impact: Medium
Denial of service. The RebateFi hook simply cannot be used with some tokens.
Paste the following into RebateFiHookTest.t.sol:
Check both currency1 and currency0 for the ReFi token.
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.