bool isReFiBuy = _isReFiBuy(key, params.zeroForOne);
uint256 swapAmount = params.amountSpecified < 0
? uint256(-params.amountSpecified)
: uint256(params.amountSpecified);
uint24 fee;
if (isReFiBuy) {
fee = buyFee;
emit ReFiBought(sender, swapAmount);
} else {
fee = sellFee;
// @> BUG: Integer division rounds down → dust is lost forever
uint256 feeAmount = (swapAmount * sellFee) / 100000; // @> truncation here
emit ReFiSold(sender, swapAmount, feeAmount);
}
Likelihood:
Occurs on every sell swap below the threshold of ~33.33 tokens (at default 3% fee)
Small swaps are common in production (especially from wallets, bots, or aggregators)
Impact:
Hook earns zero revenue on a significant portion of sell volume
ReFiSold event emits misleading/incorrect fee amounts (reports 0 when user actually paid a fee)
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.