Pools, where ReFi is currency1 and SwapParams::zeroForOne is true: ReFiSwapRebateHook::_isReFiBuy will return false and ReFiSwapRebateHook::_beforeSwap will emit ReFiSold event even if ReFi was bought and sellFee will be applied instead of buyFee.
Pools, where ReFi is currency0 and SwapParams::zeroForOne is false: ReFiSwapRebateHook::_isReFiBuy will return true and ReFiBought will emit but the ReFi was sold and buyFee is applied instead of sellFee.
Likelihood:
The issue occurs in both cases:
when the ReFi token is currency1 in the pool and zeroForOne is true in SwapParams.
when the ReFi token is currency0 in the pool and zeroForOne is false in SwapParams.
Impact:
The wrong fee is applied during swap
Add the following test and HookWrapper contract to RebateFiHookTest.t.sol
Add the following changes to the code:
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.