Uniswap security is strengthened When Permit2 Allowances Bound Token Spending
Uniswap security is strengthened when Permit2 divides token permission into two linked layers: an ERC-20 allowance to Permit2 and a narrower authorization for a specific spender. Amount limits, expirations, nonces, chain binding, and contract addresses define what moves. The narrower the signed authority, the less residual token exposure remains after a swap.
Assessing this arrangement means reading both layers separately. The decisive questions are how much a contract receives, how long that authority lasts, which chain accepts the signature, and what remains after expiry or revocation.
Choosing Between Stored and One-Time Permission
The choice between AllowanceTransfer and SignatureTransfer turns on reuse: repeated interactions favor a stored, expiring allowance, while an isolated transfer favors a one-time signature with a consumed nonce.
A stored allowance records a spending ceiling and expiry for a named contract, so it fits multiple Universal Router calls within a defined period. SignatureTransfer authorizes one execution and marks its unordered nonce as used. It suits a discrete UniswapX order or another single execution. Both routes still require the token’s ERC-20 contract to recognize Permit2 as a spender. That foundational approval takes 1 onchain transaction for each token on each chain, while an EIP-712 signature itself consumes no native network fee. The distinction matters after settlement ends.
Choose by asking whether the spender needs authority after the next settlement. Reuse justifies a modest stored limit with a near expiry. A single intended movement favors one-time permission, especially when the application binds order data through permitWitnessTransferFrom. Neither choice changes custody; token balances remain at the owner’s address until a valid transfer executes.
Set the Approval Boundary Before Signing
A Permit2 authorization should name the expected token, spender, amount, expiry, chain, and verifying contract before the wallet produces an EIP-712 signature.
The canonical Permit2 contract uses the address 0x000000000022D473030F116dDEE9F6B43aC78BA3 across supported EVM deployments. It is a 20-byte address written as 42 characters, including 0x. The spender is a separate address, commonly a Universal Router deployment. Treating those two addresses as interchangeable hides the central trust boundary.
The token contract is a third address. USDC uses 6 decimal places, while WETH and UNI use 18. Raw integer allowances therefore require token-aware formatting before they become meaningful amounts.
The following decision checklist keeps every field tied to the intended transaction.
- Match the connected chain to the intended settlement chain.
- Confirm the token contract, ticker, and decimal precision.
- Identify the spender as the expected router or order contract.
- Keep the amount close to the intended input requirement.
- Set the expiry and signature deadline around the expected execution window.
MetaMask, Uniswap Wallet, and WalletConnect integrations present these fields with different levels of detail. A Ledger device also relies on its connected wallet software to format typed data. Opaque bytes do not provide enough information to evaluate the permission. The next decision is whether the displayed amount and duration match the planned use.
How Does Permit2 Limit a Spender’s Authority?
Permit2 limits a spender through a three-key allowance record - owner, token, and spender - whose packed value holds a 160-bit amount, 48-bit expiration, and 48-bit nonce.
Those three values occupy 1 storage word of 256 bits. Permit2 treats 2^160 − 1 as unlimited in AllowanceTransfer. A traditional ERC-20 approval uses a 256-bit amount and commonly expresses unlimited authority as 2^256 − 1. Both ceilings dwarf ordinary token balances.
Permit2 subtracts each transfer from a finite allowance, while the uint160 maximum remains unchanged. The spender cannot transfer more than the stored ceiling or continue after the chain timestamp passes the expiration.
The ordered nonce defaults to 0 for each owner-token-spender tuple, and a successfully applied permit increases it by 1. The signature deadline controls submission of the signed update. The 48-bit expiration controls later transfers. Confusing those two clocks produces a signature that either cannot install an allowance or installs one for an unintended duration.
Two Permission Layers Require Separate Revocation Actions
Permit2 revocation works at two separate layers: zeroing the stored token-spender allowance stops that spender, while revoking the ERC-20 approval stops Permit2 for that token on that chain.
The lockdown function accepts a batch of token-spender pairs and sets each Permit2 amount to 0 in one transaction. It does not erase the token contract’s allowance to Permit2. Conversely, setting the ERC-20 allowance to 0 blocks every secondary Permit2 path for that token on that chain, including other spenders. Both actions need an onchain transaction and pay that network’s gas. Disconnecting MetaMask or WalletConnect changes interface connectivity only; contract storage continues unchanged.
Pending signatures require a different response. AllowanceTransfer lets the owner advance an ordered nonce by at most 65 535 positions in one transaction, preventing earlier signed updates from matching the current nonce. SignatureTransfer instead uses 256-bit bitmap words, each holding 256 one-time nonce positions. Its invalidation function marks selected bits as used. Neither nonce operation reduces an already stored allowance; lockdown or expiry handles that record.
Review the ERC-20 approval first, then the Permit2 allowance, then any unused signatures. Zero only the secondary record when future Permit2 use remains desirable. Remove the foundational approval when the token should no longer move through Permit2 on that chain. Permission state, rather than wallet connectivity, is the relevant Uniswap security record.
Typed Data Separates Chains and Contracts
EIP-712 directly binds each Permit2 signature to a three-field domain containing the name Permit2, the chain ID, and the verifying contract address.
Ethereum uses chain ID 1, Optimism uses 10, Polygon PoS uses 137, Arbitrum One uses 42161, and Base uses 8453. The same Permit2 address does not make signatures portable because the domain changes with the chain ID. Permit2’s typed-data digest combines a 32-byte domain separator with a 32-byte struct hash and the fixed 2-byte prefix 0x1901. A chain switch therefore produces a different digest even when the token, amount, and spender appear identical. This cryptographic separation remains durable and explicit across all supported EVM networks.
Externally owned accounts supply a 65-byte ECDSA signature or a 64-byte EIP-2098 compact signature. Contract accounts such as Safe use EIP-1271 validation, whose success value is the 4-byte selector 0x1626ba7e. Permit2 supports both paths. The signature format changes verification, while the signed amount, deadline, nonce, spender, and domain remain the controlling terms.
A wallet that displays the wrong chain, an unfamiliar verifying contract, or an unexpected spender is presenting a different authorization. Correcting the network or transaction construction comes before signing. For the closely related topic, continue with Uniswap in practice.
What Remains After a Permit2 Allowance Expires?
An expired AllowanceTransfer record leaves the underlying ERC-20 approval to Permit2 intact, while the named spender loses access through that expired secondary allowance.
AllowanceTransfer contains two time bounds with different jobs. The uint256 signature deadline limits when a signed permit can create or update the stored record. The uint48 expiration limits how long the spender can use that record after installation. Both are Unix timestamps measured in seconds. Once the chain timestamp passes the expiration, transferFrom rejects that allowance even if a finite amount remains stored. A later authorization must carry the tuple’s current nonce and establish a new amount and expiry.
SignatureTransfer leaves no reusable secondary allowance. Its deadline limits submission, and its unordered nonce becomes unusable after 1 successful transfer. Expiry needs no cleanup transaction because time closes the authorization. The ERC-20 approval to Permit2 still remains separately active, so the owner must decide whether future Permit2 use justifies keeping that first layer.
Stored and One-Time Permissions Fit Different Transaction Patterns
Stored AllowanceTransfer permissions suit recurring router calls, whereas SignatureTransfer suits isolated transfers that should leave no reusable Permit2 allowance for the spender.
Universal Router workflows benefit from a finite stored ceiling when several actions need the same token during a defined period. UniswapX uses permitWitnessTransferFrom so signed order data participates in authorization. Plain PermitTransferFrom signs 5 main values: token, maximum amount, spender, nonce, and deadline. The spender supplies the requested amount and recipient during execution, subject to that maximum. The witness variant adds an application-defined 32-byte hash and type description, allowing the signed intent to bind additional order fields.
Asset behavior remains another boundary. Permit2 calls the token’s transferFrom logic; it does not rewrite the token contract’s transfer rules or decimal precision.
USDT is a familiar zero-before-nonzero approval example, while USDC, WETH, and UNI illustrate different decimal and contract designs. A pause, transfer charge, or balance adjustment still comes from the asset contract, not the Permit2 allowance record.
Bounded authority works best when amount, duration, spender, chain, and asset behavior all match the intended settlement. Recurring activity supports a short stored allowance. A single order supports SignatureTransfer, with witness data when recipient or order terms need explicit binding. That choice turns Uniswap security into a concrete permission decision rather than a vague wallet setting.
Uniswap security: common questions
Do Permit2 signatures require a network fee?
Permit2 signatures themselves do not require a network fee because the wallet signs EIP-712 data offchain. The first ERC-20 approval to Permit2 is an onchain transaction, and the later swap or transfer is also onchain unless a separate settlement system submits it. Revoking an allowance or invalidating a nonce likewise requires an onchain transaction, so the network gas market sets those costs.
Can a hardware wallet authorize a Permit2 allowance?
Hardware wallets can authorize Permit2 when their companion wallet correctly displays and signs the requested EIP-712 typed data. A Ledger device connected through MetaMask is one common arrangement, although display detail differs across wallet software and device support. The essential fields remain the token, spender, amount, expiry, chain ID, and Permit2 contract. If those terms are not readable, the signer lacks enough information to assess the permission before producing the final device signature.
Why does a wallet show two approval prompts for one Uniswap swap?
A wallet shows two prompts because Permit2 separates the token-level ERC-20 approval from the spender-level signature authorization. The first prompt writes an onchain allowance from the token contract to Permit2. The second signs bounded EIP-712 data for a router or other spender. On a later swap, the first layer exists, so a fresh signature appears when renewal is required.
Does Permit2 support ERC-20 tokens without EIP-2612?
Permit2 supports ERC-20 tokens that do not implement EIP-2612 because authorization occurs in the separate Permit2 contract. The token still must expose the ordinary approve, allowance, and transferFrom behavior that Permit2 calls. This design lets USDC, WETH, UNI, and many other ERC-20 assets use typed signatures through an integrated spender. Token-specific transfer restrictions and decimal precision still apply unchanged during execution under the rules of the original token contract itself.
What happens when a token requires zero-before-nonzero approval?
A zero-before-nonzero token rejects a direct change from one positive ERC-20 allowance to another positive allowance. Set the existing allowance to 0 in an onchain transaction, then submit the new amount in a second transaction. USDT is a well-known example of this pattern. The sequence changes the foundational token approval; the secondary Permit2 allowance remains separate onchain.
Updated: