Integration engineering

Permit2 integration has two authorization layers

Separate token approval to Permit2 from Permit2 permission to a downstream spender and track their different lifetimes.

A Permit2 signature cannot move a token that has never authorized Permit2 to spend it. There are two permission layers, and a production client should track both.

The Permit2 overview describes a prerequisite ERC-20 approval to the Permit2 contract. Permit2 then manages downstream permissions using its own modules. A wallet showing a signed message does not prove that the prerequisite transaction has occurred.

Represent the layers explicitly

LayerWhat to inspect
Token permissionERC-20 allowance from owner to deployed Permit2
Permit2 permissionModule, spender, amount, nonce and time limits

AllowanceTransfer manages stored permissions with expiration. SignatureTransfer uses a signature-based one-use transfer model. Do not mix their nonce or expiration rules.

Handle a fresh wallet

Check the token's allowance to Permit2 first. If insufficient, request the documented approval and wait for confirmation. Then refresh any quote or typed-data payload that may have expired. Validate the downstream spender and signed amount before asking for the permit signature.

Use the provider's supported deployment information for the selected chain. An address seen on another network is not enough evidence. The token approval also has a lifetime independent of the one-use signature; consuming that signature does not necessarily remove the token's standing allowance to Permit2.

A focused test starts with zero token allowance, signs valid typed data, and verifies that the application still blocks execution. A second fixture starts with ample token allowance but an expired downstream permission. These two failures should reach different recovery steps rather than a generic approve-again loop.

Sources & verification (3)

Source-check date is recorded in the article details. URLs are provided for manual verification. Use Copy to keep this page open.

  1. Permit2 Overview

    ERC20 prerequisite and two Permit2 modules

    https://developers.uniswap.org/docs/protocols/permit2/overview
  2. Allowance Transfer

    Persistent time-bound spender permissions

    https://developers.uniswap.org/docs/protocols/permit2/concepts/allowance-transfer
  3. Signature Transfer

    One-use signature nonce model

    https://developers.uniswap.org/docs/protocols/permit2/concepts/signature-transfer

Continue reading

Swap API integration: quote, approve, simulate, submit