Uniswap

Uniswap is an EVM Token Approval, Swap Confirmation, and Balance-Check Workflow

Uniswap is an EVM swap interface workflow where you match the wallet network to the token, inspect the route, pool fee, price impact, minimum output, and network cost, authorize any ERC-20 spending, confirm the transaction, and compare the onchain receipt with the resulting balance.

Updated on
A pool-routed ERC-20 input without approval requires two gas-bearing transactions; its Permit2 signature adds no network cost.

Reading the route and fee preview

The Uniswap fee preview separates pool charges, route effects, and the wallet’s network cost. Read those fields together because a better quoted output can require more gas.

Pool fees come out of the swap path before the displayed output. Uniswap v3 defines four pool fee tiers: 0.01%, 0.05%, 0.30%, and 1.00%. A v2 pool uses a 0.30% trading fee, while v4 routes may use static or dynamic fees. The interface can split one order across multiple pools, so the fee line and route diagram explain which liquidity contributes. Price impact measures the movement caused by the order itself. Maximum slippage controls acceptable movement between quote and execution; minimum received turns that setting into the enforceable output floor.

Network cost belongs to blockchain execution, not pool pricing. On Ethereum, an EIP-1559 type 2 transaction carries a base-fee component and a priority-fee component. Its intrinsic calculation begins at 21 000 gas, then adds 16 gas for each nonzero calldata byte and 4 gas for each zero byte, before contract execution. Wallet estimates incorporate the route’s contract calls and current fee conditions. An approval and a swap therefore show separate network costs when both require transactions.

Route labels also separate pool execution from UniswapX. On an eligible UniswapX order, a filler pays most execution gas and incorporates that cost into the offered output; initial onchain approvals still charge the swapper.

Matching the network and spendable balance

The wallet must use the token’s network and hold enough native currency for execution.

Chain identity is exact, even when two networks use ETH for gas. Among supported EVM networks, Ethereum uses chain ID 1, OP Mainnet uses 10, Base uses 8453, Polygon PoS uses 137, BNB Smart Chain uses 56, and Avalanche C-Chain uses 43114. A ticker on one chain represents a different contract balance from the same ticker elsewhere. Each balance stays local to its chain. Keep a native reserve when selling ETH, POL, BNB, or AVAX; the Max control must leave enough for the network charge when the input itself pays gas.

Setting the ERC-20 approval

An ERC-20 approval authorizes a named spender to transfer up to a stated token amount.

The standard defines six core methods, including approve, allowance, and transferFrom, plus the Transfer and Approval events. Calling approve assigns the spender a uint256 allowance, while allowance reports the remaining amount. The wallet request should name the token, spender, chain, and spending cap. An amount below the proposed input cannot authorize the complete swap.

For a pool-routed ERC-20 input with no suitable approval, the Uniswap flow has two gas-bearing transactions and one gas-free signature: one onchain approval to Permit2, one Permit2 signature for the Universal Router, and one swap transaction. The Uniswap app limits its Permit2 signature authorization to 30 days. The onchain allowance and signature remain separate permissions. Native ETH bypasses ERC-20 approval because it has no token-contract allowance.

An exact approval bounds the spend to this input, while a larger cap reduces repeat approval transactions. Compare that convenience with the amount the spender retains after execution.

What should you verify before confirming a Uniswap swap?

Before confirmation, the Uniswap review must match the intended assets, route, limits, and network.

Start with the input and output contract addresses rather than symbols alone. An EVM address contains 20 bytes and appears as 40 hexadecimal characters after the 0x prefix. Then read the sell amount, quoted output, pool route, pool fee, price impact, maximum slippage, minimum received, and network estimate. The interface’s automatic slippage setting runs between 0.5% and 5%, based on network cost and swap size; a custom setting replaces that automatic choice.

Price impact and slippage answer different questions. Price impact reflects movement caused by this order against available liquidity. Slippage covers movement between the displayed quote and execution. The minimum received value is therefore the decisive floor: the router reverts the swap when the executable output falls below it, while the network still charges for processing the transaction.

A worked confirmation example

A worked example shows how the quote, allowance, minimum output, and balances fit together.

In this hypothetical example, every starting balance, quote, fee tier, slippage setting, and final network charge is an invented input. The wallet starts with 1 500 USDC, 0.100 WETH, and 0.030 ETH. The review sells 1 000 USDC through a 0.05% pool tier, quotes 0.400 WETH, sets maximum slippage at 0.50%, and later records a 0.004 ETH network charge. Minimum output equals 0.400 × (1 − 0.005), or 0.398 WETH. After receipt status 1, balances become 500 USDC, at least 0.498 WETH, and 0.026 ETH.

The quoted 0.400 WETH already reflects the selected route and pool fee, so subtracting 0.05% again would double-count it. The confirmation decision uses 0.398 WETH as the enforceable minimum and 0.026 ETH as the final gas balance for this case.

The state change behind a completed swap

A completed Uniswap swap changes token balances only after the network executes the transaction.

The router pulls the authorized input with transferFrom, calls the selected pool path, and sends output to the recipient. Those calls execute atomically within the swap transaction. An EVM receipt records status 1 for success and status 0 for failure. Status 1 commits the transfers and pool updates. Status 0 discards those state changes, although the network cost remains. A successful approval receipt proves only the allowance update; it does not prove a later swap executed.

Token contracts store balances in base units. USDC uses 6 decimals, so 10 displayed USDC corresponds to 10 000 000 base units. WETH uses 18 decimals, making 1 WETH equal to 10 18 base units. ERC-20 balanceOf returns the raw uint256 balance, and the token’s decimals value tells an interface where to place the decimal point.

Proving the receipt and resulting balance

Balance verification starts with the transaction receipt, then checks the wallet address and token contract.

Open the swap from Uniswap activity or a network explorer such as Etherscan. A transaction hash contains 32 bytes and appears as 64 hexadecimal characters after 0x. Match the hash, chain, sender, recipient, status, input transfer, and output transfer. The block number confirms inclusion, while the receipt’s effective gas price and gas used explain the final network charge. Approval and swap actions have separate hashes, so inspect the swap hash for the balance change.

A successful receipt settles the onchain balance even when the wallet view has not refreshed. The common setup error is a network mismatch: the wallet displays another chain while the output exists on the receipt’s chain. Switch to the exact chain ID, select the same account, and add the output token by its 20-byte contract address when the wallet does not list it automatically.

Once the explorer and balanceOf reading agree, the onchain state provides the definitive record for the completed swap.

Uniswap FAQ

Does disconnecting a wallet remove its ERC-20 spending allowance?

Disconnecting a wallet does not remove an ERC-20 allowance because the token contract stores that permission onchain. Disconnection only ends the interface session. To remove the allowance, submit an onchain approval setting the spender’s amount to 0 through a compatible approval manager or network explorer. That change has its own transaction hash and network cost.

Which step charges gas in a pool-routed ETH-to-token swap?

A pool-routed ETH-to-token swap charges gas for the swap transaction without a separate ERC-20 approval for the ETH input. ETH is the native asset on Ethereum, so it does not use approve or transferFrom. The output token also needs no approval merely to arrive in the wallet. The confirmation should therefore show the swap’s network estimate.

Is a Permit2 signature the same record as an onchain approval?

A Permit2 signature is not the same record as the initial onchain token approval. The approval transaction changes the token contract’s allowance and produces a receipt with a network charge. The later typed-data signature authorizes a defined Uniswap action without broadcasting another transaction or paying gas. The eventual swap still receives its own onchain transaction hash.

When should I search by token contract address instead of token symbol?

Use the token contract address whenever a symbol appears on multiple networks or represents several contracts on one network. Symbols are display labels, while the 20-byte contract address identifies the asset used by the route. Match the address and chain together before confirmation. A correct address on Ethereum does not identify a balance on Base, Polygon, or another chain.

Does pressing Max reserve enough ETH for a USDC swap?

Pressing Max on USDC does not create the ETH needed for Ethereum network costs. USDC pays the swap input, while ETH pays the approval and swap transactions. The wallet must already hold enough ETH for every gas-bearing step. When ETH itself is the input, the interface leaves room for network cost rather than allocating the entire native balance to the swap.

Where should I look when the swap receipt succeeds but the output balance stays hidden?

Check the output token’s balance on the same chain and account recorded in the successful swap receipt. A wallet may still display another network, omit an unfamiliar token, or need a refresh. Switch to the receipt’s chain ID and add the token using its contract address. The contract’s balanceOf value remains authoritative even when the wallet presentation lags.

How long must an approval wait before the swap can proceed?

An approval needs no fixed waiting period; the swap can proceed after the network includes the approval with receipt status 1. Inclusion makes the allowance available to the router. The interface then requests the Permit2 signature or swap confirmation. If the approval remains pending, a later action cannot rely on its state yet, so check the approval hash before repeating the request.