Uniswap Error TRANSFER_FROM_FAILED (STF) Swap Revert Resolution
Uniswap error "TRANSFER_FROM_FAILED" (often abbreviated as "STF") is thrown by Uniswap V2/V3 pair pools, Router02, and Universal Router contracts when an IERC20.transferFrom call returns false or reverts. This error occurs when the user has not granted sufficient allowance to the Uniswap router, lacks the necessary token balance, or is attempting to swap a fee-on-transfer token without using specialized swapExactTokensForTokensSupportingFeeOnTransferTokens router functions. Grant approval or adjust slippage settings.
# Root Cause & Technical Architecture
Inside `TransferHelper.sol` or `SafeTransferLib`, Uniswap wraps standard ERC-20 transfers with: `require(success && (data.length == 0 || abi.decode(data, (bool))), "STF")`. If a token contract returns `false` (standard for failure in older ERC-20 tokens), reverts due to zero allowance, or fails due to address blacklists or deflationary fee deductions that reduce received amounts below expectations, the helper reverts with `STF`.
# 4-Step Actionable Diagnostic Protocol
Step-by-Step ResolutionVerify Token Allowance to Exact Uniswap Router Address
Ensure you have approved the active router (e.g. Universal Router or Permit2), not an older deprecated router contract address.
Check Token Balance Against Input Amount
Confirm the user's wallet holds the entire amountIn plus any potential transfer fees before calling the swap function.
Use SupportingFeeOnTransferTokens Functions for Tax Tokens
For tokens with transaction taxes, use swapExactTokensForTokensSupportingFeeOnTransferTokens to accommodate balance deductions during transfer.
Inspect Permit2 Nonce and Signature Validity
On Uniswap V3/Universal Router, check that the Permit2 signature did not expire or collide with an already-used permit nonce.
# Diagnostic Verification Code / Command
solidity// Uniswap V3 TransferHelper: The Origin of "STF" Reverts
library TransferHelper {
function safeTransferFrom(address token, address from, address to, uint256 value) internal {
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value)
);
// If transfer fails or returns false -> Reverts with "STF"!
require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');
}
} Launch ERC-4337 UserOp Decoder
Execute client-side cryptographic simulation and parameter checks safely in your browser via native WebCrypto without sending private keys or mnemonics over the wire.
Read Full Investigation & Recovery Workflow
Explore complete architectural diagrams, edge-case failure trees, and detailed post-mortem analysis in our verified deep guide.
# Related Diagnostic Codes in EVM & JSON-RPC
Related Hex StatusesJSON-RPC Error -32000: Insufficient Funds for Gas * Price + Value
Fix JSON-RPC error -32000 insufficient funds for gas * price + value. Resolve native token balance shortages, fee estimation surges, and gas caps.
JSON-RPC Error -32000: Replacement Transaction Underpriced Fix
Fix JSON-RPC error -32000 replacement transaction underpriced. Apply mandatory 10%+ maxPriorityFeePerGas bump on same nonce to replace stuck mempool txs.
JSON-RPC Error -32000: Nonce Too Low Stale Wallet State Fix
Fix JSON-RPC error -32000 nonce too low. Troubleshoot stale local wallet nonce caches, pending mempool transactions, and reset account state.
# Frequently Asked Questions
FAQ SchemaWhat does "STF" stand for in Uniswap error messages?
STF is the short 3-letter abbreviation used in Uniswap smart contracts for "SafeTransferFrom Failed".
Why do tax or reflection tokens always fail with STF?
Tax tokens take a fee on transfer, meaning the Uniswap pool receives fewer tokens than specified in the input parameter, violating the transfer invariant.
Can STF happen if gas limit is set too low?
Yes. If the gas allocated to the inner transferFrom call runs out, the call returns false, causing TransferHelper to revert with STF.