currency1The _beforeInitialize validation in RebateFiHook checks currency1 twice and completely ignores currency0. This effectively reduces the intended check
“ReFi must be present in either currency0 OR currency1” to “ReFi must be currency1”. As a result:
Valid pools where ReFi is currency0 are incorrectly rejected (DoS on initialization).
Pools where ReFi is currency1 pass (as intended).
Pools with neither token being ReFi still revert (which is correct but incidental).
This breaks the protocol invariant that ReFi presence should be accepted regardless of side and makes initialization behavior asymmetric and misleading.
Intended behavior: prevent pool initialization unless ReFi is present as either currency0 or currency1.
Actual code in src/RebateFiHook.sol:122-128:
Implications (truth table):
currency0 == ReFi, currency1 != ReFi → condition true → reverts → WRONG (should allow).
currency0 != ReFi, currency1 == ReFi → condition false → allows → RIGHT.
currency0 != ReFi, currency1 != ReFi → condition true → reverts → RIGHT (but not due to proper dual-side check).
Some earlier descriptions claimed “reversion will NEVER occur” due to the duplicated check. That is incorrect. The duplicated check simplifies to if (currency1 != ReFi), which still reverts whenever currency1 is not ReFi—including the valid case where ReFi sits in currency0.
Likelihood:
High: Triggered on every pool initialization. Any setup where ReFi resolves to currency0 will fail systematically.
Impact:
Medium to High: Causes denial-of-service for valid pool initializations (ReFi as currency0), breaks the invariant that ReFi presence on either side must be accepted, confuses integrators and deployment tooling. It does not broadly “bypass validation to allow pools without ReFi”, but it does make validation one-sided and wrong.
The goal of this PoC is to demonstrate that the initialization validation only checks currency1 and ignores currency0. We show three realistic cases:
Case 1: ReFi is currency0 → initialization wrongly reverts (should allow).
Case 2: Neither side is ReFi → initialization reverts (as intended, but coincidental).
Case 3: ReFi is currency1 → initialization allows (as intended).
This proves the check is one-sided and breaks the invariant “ReFi can be on either side”.
Expected behavior:
Case 1 should pass but reverts due to checking only currency1.
Case 2 correctly reverts.
Case 3 correctly passes.
This restores the intended invariant: initialization is only permitted if ReFi is present as either currency0 or currency1.
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.