The protocol's fee calculation mechanism fails to handle small tier prices correctly due to integer division. When prices are small (e.g., 4) or not properly scaled to token decimals, the fee calculation can result in zero, causing the protocol to lose revenue. Additionally, test cases use unscaled values, potentially masking decimal precision issues.
Fee calculation in MembershipFactory.sol:
1. If tierPrice = 4
platformFees = (20 * 4) / 100 = 0
Protocol receives no fee
2. For USDC (6 decimals):
tierPrice = 4 should be 4_000000
Current tests use unscaled values
Small-value transactions generate no fees
Incorrect scaling leads to undercharging
Accumulating revenue loss over time
Manual review
Implement decimal-aware fee calculation based on token precision
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.