Fee on transfer tokens transfer less tokens than what is stored in the receipt on deposits
Description
Some tokens have a fee on transfer, such as USDT, although it is disabled currently (line 127 and 177).
This means that on deposits, the actually deposited amount to the smart contract will not be the one passed as argument, but its value minus the fee.
Thus, for example, the Batch.sol contract will hold less funds than stored, potentially leading to withdrawal failure.
Recommendation
The actual transferred amount is the balance after minus the balance before the transfer. Modify this line to:
uint256 previousBalance = IERC20(depositToken).balanceOf(address(batch));
IERC20(depositToken).safeTransferFrom(msg.sender, address(batch), depositAmount);
depositAmount = IERC20(depositToken).balanceOf(address(batch)) previousBalance;Also, place the lines above before calling batch.deposit().
Status
Acknowledged