INT-002INTERMEDIATE8 min read

How Permit2 Works

Every time you swap on a DEX, you need to "approve" the contract to spend your tokens. Traditionally, this is an on-chain transaction that costs gas. Permit2 changes that. Let me explain how — and why it matters to your bottom line.

THE_PROBLEM

The old way: on-chain approvals

Before you can swap USDC for WETH on Uniswap, you need to approve the Uniswap router to spend your USDC. This approval is an on-chain transaction. On Base, it costs ~$0.01 in gas. On Ethereum, it costs $5-30.

That's right — you pay gas just to give permission. Then you pay gas again for the actual swap. Two transactions, two gas payments, for one swap.

And if you want to swap through a different DEX later? Another approval. Another gas payment. It adds up.

THE_SOLUTION

EIP-2612: The first attempt

Some tokens (USDC, DAI, UNI) support EIP-2612 permits. Instead of an on-chain approval, you sign a gasless message that says "I authorize this contract to spend my tokens." The spender submits the approval on-chain when they execute the swap.

Problem: not every token supports EIP-2612. You still need on-chain approvals for tokens that don't. Half the problem.

THE_FIX

Permit2: Universal gasless approvals

Uniswap Labs built Permit2 to solve this once and for all. Here's how it works:

  1. 01

    One-time on-chain approval

    You approve the Permit2 contract (0x000000000022D473030F116dDEE9F6B43aC78BA3) to spend your token. This is ONE on-chain transaction. After this, you never need another on-chain approval for this token.

  2. 02

    Gasless signatures for everything else

    When you want to swap, you sign a Permit2 message that authorizes a specific spender (e.g., the Orkid solver) to use your tokens via the Permit2 contract. This is a gasless signature — no on-chain transaction.

  3. 03

    The spender submits on-chain

    When the solver executes your swap, it submits the Permit2 signature on-chain as part of the transaction. The Permit2 contract verifies your signature and transfers your tokens to the solver.

The result: one on-chain approval per token, ever. All subsequent swaps are gasless signatures. Orkid handles the one-time approval for you — you just sign.

SECURITY

Security considerations

  • Allowance limits: Permit2 approvals can be limited to a specific amount. Orkid requests unlimited allowance for the token you're swapping, but you can revoke at any time.
  • Expiry: Permit2 approvals can have an expiry. Orkid's swap intents expire if not executed within a deadline.
  • Revocation: Use revoke.cash to revoke any Permit2 allowance. This is an on-chain transaction.
  • Audited: Permit2 is built by Uniswap Labs and audited by OpenZeppelin, Trail of Bits, and others.

FAQ

Is Permit2 safe?

Yes. Permit2 is built by Uniswap Labs and audited by multiple firms. The signature only authorizes a specific spender (the Orkid solver) to access a specific token up to a specific amount. It cannot drain your wallet.

Can someone drain my wallet with Permit2?

No. Permit2 only allows spending of tokens you explicitly approved, up to the amount you specified, by the spender you authorized. It does not give access to tokens you did not approve.

How do I revoke a Permit2 approval?

Go to revoke.cash or Etherscan/Basescan, find the Permit2 contract (0x000000000022D473030F116dDEE9F6B43aC78BA3), and revoke the allowance for the Orkid spender. This is an on-chain transaction that costs gas.

Does every token support Permit2?

Yes. Unlike EIP-2612 permits (which require token-level support), Permit2 works with ANY ERC-20 token. You deposit your approval into the Permit2 contract once, then all future approvals are gasless signatures.