Integer division in VVVVCInvestmentLedger's fee calculation can cause a bypass of the fee mechanism as users can structure their investment amounts to result in zero fees while still investing.
Root Cause
In VVVVCInvestmentLedger.sol the fee calculation can result in zero due to integer division when preFeeStableAmountEquivalent * feeNumerator is less than FEE_DENOMINATOR:
Motomoto
Medium
Users can pay 0 fees while investing
Summary
Integer division in VVVVCInvestmentLedger's fee calculation can cause a bypass of the fee mechanism as users can structure their investment amounts to result in zero fees while still investing.
Root Cause
In
VVVVCInvestmentLedger.sol
the fee calculation can result in zero due to integer division whenpreFeeStableAmountEquivalent * feeNumerator
is less thanFEE_DENOMINATOR
:Instead of paying the intended fee, users can pay 0% by splitting their investments into smaller amounts.
Internal pre-conditions
External pre-conditions
None
Attack Path
amount
*feeNumerator
) <FEE_DENOMINATOR
feeNumerator
= 100:preFeeStableAmountEquivalent
= 99Impact
Users can bypass fees
PoC
Described in the attack path
Mitigation
Modify the fee calculation to handle small amounts