The _isReFiBuy function has inverted logic when ReFi is currency0, causing buy fees to be applied on sells and sell fees on buys, breaking the core fee mechanism.
The hook applies different fees for buying ReFi (0%) vs selling ReFi (0.3%) to incentivize holding.
In Uniswap V4, zeroForOne=true means swapping currency0 FOR currency1. When ReFi is currency0, zeroForOne=true means SELLING ReFi, not buying.
Likelihood:
Occurs on every swap in pools where ReFi is currency0
Users attempting to buy ReFi pay sell fees (0.3%) while sellers pay no fee
Impact:
Complete reversal of intended economic incentives
Buyers are penalized instead of sellers, discouraging accumulation
Protocol loses fee revenue on actual sells
Here is the basic steps to understand the issue in the logic
Invert the return value when ReFi is currency0:
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.