The deductFee function assumes that the split value is equal to feeAmount when multiplied by 2 which is not the case as Solidity suffers from mathematical truncation. This will lead to funds being permanently locked in any MarketHandlerBase contract.
MHB-02M: Improper Fee Deduction
Description:
The
deductFee
function assumes that thesplit
value is equal tofeeAmount
when multiplied by2
which is not the case as Solidity suffers from mathematical truncation. This will lead to funds being permanently locked in anyMarketHandlerBase
contract.Example:
Recommendation:
We advise the second
transfer
to instead usefeeAmount - split
rather thansplit
to ensure truncated funds are accounted for.