Normal behavior: When a user buys the designated ReFi token, the hook should apply the configured buyFee (typically 0%) so buys are subsidized. When a user sells ReFi, the hook should apply the higher sellFee (e.g., 0.3%) to discourage dumping.
Actual behavior: _isReFiBuy misclassifies every swap whenever ReFi is currency0, so sells are treated as buys (no fee) and buys are treated as sells (penalized). This flips the intended economics and lets dumpers bypass the premium fee entirely.
Likelihood:
Any pool where ReFi is listed as currency0 (50% of all pool creations) will immediately experience inverted fees.
Users only need to execute a normal zeroForOne swap to buy/sell; no special setup or permissions are required.
Impact:
Sellers never pay the configured premium fee, eliminating protocol revenue and removing the anti-dump mechanism.
Buyers are overcharged the sellFee, discouraging accumulation and wrecking the hook’s purpose.
Explanation: Deploy a pool with currency0 == ReFi, perform a standard sell swap (zeroForOne == true), and log the fee value returned by the hook—you’ll observe it equals buyFee instead of sellFee.
Explanation: Flip the logic so “buy” means the user receives ReFi; when ReFi is currency0, that happens only when zeroForOne == false.
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.