Different fee calculation approaches between buy and sell paths:• Buy path → assigns fee = buyFee directly, no fee amount calculation or logging. Sell path → calculates feeAmount = (swapAmount * sellFee) / 100000 but does not use it for actual fee application.
The _beforeSwap() implementation applies fees inconsistently. The buy path applies the fee directly from buyFee without computing or emitting the actual fee amount, while the sell path performs a calculation but only logs it in an event without enforcing it. This mismatch creates a vulnerable and confusing fee structure, undermining protocol economics, auditability, and maintainability.
Likelihood:
Inconsistent implementation is already present
Multiple attack vectors identified
High probability of exploitation
Impact:
High potential financial impact
Significant security implications
Major operational concerns
Add below code to RebateFiHookTest.t.sol
Implement unified fee calculation logic for both paths
Eliminate unused feeAmount in the sell path unless it’s explicitly applied or emitted.
Saves gas and reduces confus
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.