RebateFi Hook

First Flight #53
Beginner FriendlyDeFi
100 EXP
View results
Submission Details
Severity: low
Valid

Fee Calculation Denominator Mismatch in Event

Root + Impact

The feeAmount in ReFiSold event uses a 100,000 denominator while Uniswap V4 fees use 1,000,000 scale, causing the event to report 10x higher fees than actually charged.

Description

  • Uniswap V4 fees are expressed in hundredths of a basis point (1e-6), so sellFee=3000 means 0.3%.

  • The event calculation uses /100000, interpreting the same value as 3%.

// Root cause in RebateFiHook.sol line 166
} else {
fee = sellFee;
@> uint256 feeAmount = (swapAmount * sellFee) / 100000; // @> Should be /1000000
emit ReFiSold(sender, swapAmount, feeAmount);
}

Risk

Likelihood:

  • Occurs on every sell transaction

  • All off-chain analytics, dashboards, and integrations will show incorrect fee data

Impact:

  • Misleading fee information to users and integrators

  • Potential regulatory/compliance issues from inaccurate reporting

  • User confusion about actual costs

Proof of Concept

Let suppose if user wants to sale 1000 tokens and the sale fee is 0.3%, then 3 tokens will be charged but in current logic it is charging 3% (30 tokens) 10x the actual fee

// sellFee = 3000 (0.3% in Uniswap V4 scale)
// swapAmount = 1000 tokens
//
// Event reports: (1000 * 3000) / 100000 = 30 tokens (3%)
// Actual fee: (1000 * 3000) / 1000000 = 3 tokens (0.3%)
//
// Event shows 10x the actual fee

Recommended Mitigation

Use the correct denominator matching Uniswap V4's fee scale:

} else {
fee = sellFee;
- uint256 feeAmount = (swapAmount * sellFee) / 100000;
+ uint256 feeAmount = (swapAmount * sellFee) / 1000000;
emit ReFiSold(sender, swapAmount, feeAmount);
}
Updates

Lead Judging Commences

chaossr Lead Judge 12 days ago
Submission Judgement Published
Validated
Assigned finding tags:

Incorrect denominator (100000 instead of likely 1000000 or 10000) in fee calculation for ReFiSold event.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!