Skip to main content

Permit2 Approvals

When you use Verified Pools to swap tokens or provide liquidity, you might notice approval transactions that use something called "Permit2." This guide explains what Permit2 is, how it works, and why it's safer and more efficient than traditional approvals.

What Are Token Approvals?

Before diving into Permit2, it's helpful to understand what token approvals are:

  • Token Approvals: When you interact with any DeFi application like Verified Pools, you need to give the application permission to use your tokens. This permission is called an "approval" and is a standard feature of ERC-20 tokens.
  • Traditional Approvals: In the traditional method, you submit a separate transaction for each token you want to use, granting the application permission to access those tokens.

What is Permit2?

Permit2 is an advanced token approval system developed by Uniswap Labs that improves on traditional token approvals in several important ways:

  • Unified Approvals: Permit2 allows approvals to be shared across different applications, creating a more streamlined and cost-effective experience.
  • Enhanced Security: It offers time-limited approvals and more granular control over what you're approving.
  • Gas Efficiency: By consolidating approvals, you'll spend less on transaction fees.

How Permit2 Works in Verified Pools

When you use Verified Pools, here's what happens with Permit2:

  1. Initial Approval: The first time you use a token with Verified Pools, you'll be asked to approve Permit2 to access that token. This is a one-time transaction per token.

  2. Signature-Based Permissions: After the initial approval, instead of requiring additional approval transactions, Permit2 uses your signature to authorize specific actions. This happens when you:

    • Swap tokens
    • Add liquidity to a pool
    • Remove liquidity from a pool
  3. Time-Bound Permissions: Unlike traditional infinite approvals, Permit2 signatures can have expiration times, making them more secure.

What You're Signing

When using Verified Pools, you'll encounter two main types of Permit2 operations:

1. Permit2 Approval Transaction

This is what you're approving in the initial transaction:

  • Access to your tokens: You're allowing the Permit2 contract to move a specific token on your behalf.
  • Amount: You'll typically approve the maximum amount (to avoid future transactions), but Permit2 makes this safer by allowing for time-limited authorizations later.

2. Permit2 Signatures

For subsequent operations, you'll sign messages that authorize:

  • Specific amount: Only the exact amount needed for your transaction.
  • Specific action: The precise operation (swap, add liquidity, etc.).
  • Time limitation: How long the authorization remains valid (typically minutes).
  • Specific recipient: The exact contract that can use your tokens.

Benefits of Using Permit2

For Users

  • Fewer Transactions: Save on gas fees by avoiding multiple approval transactions.
  • Better Security: Time-limited approvals reduce the risk of exposure if a contract is compromised.
  • Improved UX: Smoother user experience with fewer wallet prompts.

For Developers

  • Simplified Integration: Common approval interface across applications.
  • Flexible Implementation: Support for any ERC-20 token, even those without native permit functionality.

Security Considerations

Despite Permit2's improvements over traditional approvals, it's always good to remember:

  • Revoking Approvals: You can always revoke Permit2 approvals through tools like Revoke.cash if needed.
  • Check Details: Always verify the details of what you're approving or signing, especially the contract address and token amount.
  • Expiration Times: Be aware of how long your signature authorizations remain valid.

Frequently Asked Questions

Q: Do I need to approve each token every time I use Verified Pools? A: No, you only need to approve each token once. After the initial approval, operations use signatures instead of additional approval transactions.

Q: Is Permit2 more secure than traditional approvals? A: Yes, Permit2 can be more secure because it allows for time-limited authorizations and more granular permissions compared to traditional infinite approvals.

Q: What happens if I deny a Permit2 signature request? A: Your transaction simply won't proceed. You can always try again and approve the signature when you're ready.

Q: Can I use Permit2 approvals with other applications? A: Yes, as more applications integrate with Permit2, your approvals can be shared across them, further saving on transaction fees.

Additional Resources