Use safe transfer for ERC20 tokens
The protocol intends to support all ERC20 tokens but the implementation uses the original transfer functions. Some tokens (like USDT) do not implement the EIP20 standard correctly and their transfer/transferFrom function return void instead of a success boolean. Calling these functions with the correct EIP20 function signatures will revert.\\n```\\nTransferUtils.sol\\n    function _transferERC20(address token, address to, uint256 amount) internal {\\n        IERC20 erc20 = IERC20(token);\\n        require(erc20 != IERC20(address(0)), "Token Address is not an ERC20");\\n        uint256 initialBalance = erc20.balanceOf(to);\\n        require(erc20.transfer(to, amount), "ERC20 Transfer failed");//@audit-issue will revert for USDT\\n        uint256 balance = erc20.balanceOf(to);\\n        require(balance >= (initialBalance + amount), "ERC20 Balance check failed");\\n    }\\n```\\n
We recommend using OpenZeppelin's SafeERC20 versions with the safeTransfer and safeTransferFrom functions that handle the return value check as well as non-standard-compliant tokens.
Tokens that do not correctly implement the EIP20 like USDT, will be unusable in the protocol as they revert the transaction because of the missing return value.
```\\nTransferUtils.sol\\n    function _transferERC20(address token, address to, uint256 amount) internal {\\n        IERC20 erc20 = IERC20(token);\\n        require(erc20 != IERC20(address(0)), "Token Address is not an ERC20");\\n        uint256 initialBalance = erc20.balanceOf(to);\\n        require(erc20.transfer(to, amount), "ERC20 Transfer failed");//@audit-issue will revert for USDT\\n        uint256 balance = erc20.balanceOf(to);\\n        require(balance >= (initialBalance + amount), "ERC20 Balance check failed");\\n    }\\n```\\n