Normally a user needs two transactions to let a contract use their tokens: an approve, then the actual action. Permit signatures replace the first transaction with an off-chain signature. The user signs a readable EIP-712 message, and the application submits that signature together with the action in a single transaction. Fewer steps, less gas, and no need for the user to hold gas for the approval.
EIP-2612: Permit Built Into the Token
EIP-2612 adds a permit function to an ERC-20 token. The signature contains the owner, spender, amount, a nonce and a deadline. Anyone can submit it; the token checks the signature and sets the allowance. It only works for tokens that implement it: many newer tokens and USDC do, but not every major token, and DAI uses an older, slightly different permit format.
Permit2: Signature Approvals for Any Token
Permit2 is a contract from Uniswap that brings signature-based approvals to every ERC-20 token. The user approves Permit2 once per token; after that, applications request signatures for specific amounts and time windows. Permit2 offers two modes: one-off signed transfers, and time-limited allowances. It is widely used by DEXs and aggregators, see DEX integrations.
Pitfalls We Handle
- Token support: detect whether a token supports EIP-2612, and fall back to Permit2 or a normal approval if not.
- Front-running of permits: someone can submit a user's permit first, making your transaction revert; contracts should tolerate an already-used permit.
- Exact amounts and short deadlines instead of unlimited, permanent permits.
- Phishing: permits are a popular drainer technique, so the signing request must be clear. See blind signing prevention.
Frequently Asked Questions
What is the difference between permit and EIP-3009?
Permit sets an allowance; EIP-3009 authorises a specific transfer directly. EIP-3009 is supported by fewer tokens, including USDC.
Does permit make transactions fully gasless?
It removes the approval transaction. Someone still pays gas for the action itself: the user, or your application through a relayer or paymaster. See gasless transactions.
Should our own token support EIP-2612?
Usually yes. It is a small addition, well supported by standard libraries, and makes your token easier to use in applications.
Who owns the code?
Ownership of the source code is set out in the contract, and the code can be fully yours, including documentation and tests.
Part of our work on signatures and signing. See also meta-transactions.
Cut the Approval Step
Tell us which tokens and flows your users go through. We will implement permits that save a step and stay safe.