Ripe Sage Ant
High
EthosVouch.sol overestimates fees to pay, so users always pay higher fees. That's because fee formula overestimates result when called multiple times with partial fee.
-The choice to use calcFee()
multiple times makes final fees higher than expected. As it is formula used in calcFee()
is OK, however by design it will calculate higher fees when called multiple times for partial fee.
No response
No response
- Suppose
protocolFee = 3%
,donationFee = 3%
,vouchersPoolFee = 4%
. So total fee is 10%. - User calls
vouchByProfileId()
and submits 1 ETH. According to formula incalcFee()
it must calculate1 - 1 * 100% / 110%
= 0.091 ETH. - However in 3 different calls it will calculate 0.096 ETH. Which is 5.5% higher fee rate than expected.
Protocol always overcharges users with additional fee due to incorrect calculation. For example extra 10.05% instead of 10%.
No response
Calculate fee amount at once, and than divide it into different fee types according to weights.