Normal Behavior:
The _isReFiBuy function is intended to determine whether a swap is a buy of ReFi based on which token is currency0 and the zeroForOne flag:
zeroForOne = true → swapping currency0 for currency1
zeroForOne = false → swapping currency1 for currency0
Observed Issue:
The current implementation returns the wrong boolean values, effectively inverting buy/sell logic for ReFi swaps:
If ReFi is currency0, _isReFiBuy incorrectly returns true when zeroForOne = true (selling ReFi instead of buying).
If ReFi is currency1, _isReFiBuy incorrectly flips the logic as well.
Likelihood:
Any swap involving ReFi will trigger the incorrect buy/sell flag.
Automated scripts, frontend integrations, or liquidity pools will all rely on this logic.
Impact:
Users buying ReFi are incorrectly charged a 0.3% fee, which should be 0%.
Users selling ReFi are incorrectly charged 0% fee, which should be 0.3%.
Breaks intended economic design of the protocol and could cause loss of trust or financial imbalance.
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.