Balance of msg.sender Is Used Instead of the from Address
The `TransferHelper` library has methods that allow transferring tokens directly or on behalf of a different wallet that previously approved the transfer. Those functions also check the sender balance before conducting the transfer. In the second case, where the transfer happens on behalf of someone the code is checking not the actual token spender balance, but the `msg.sender` balance instead.\\n```\\nfunction transferTokens(\\n address token,\\n address from,\\n address to,\\n uint256 amount\\n) internal {\\n uint256 priorBalance = IERC20(token).balanceOf(address(to));\\n require(IERC20(token).balanceOf(msg.sender) >= amount, 'THL01');\\n```\\n
Use the `from` parameter instead of `msg.sender`.
```\\nfunction transferTokens(\\n address token,\\n address from,\\n address to,\\n uint256 amount\\n) internal {\\n uint256 priorBalance = IERC20(token).balanceOf(address(to));\\n require(IERC20(token).balanceOf(msg.sender) >= amount, 'THL01');\\n```\\n