> ## Documentation Index
> Fetch the complete documentation index at: https://voltaire.tevm.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Permit / Permit2

> Gasless token approvals using EIP-2612 permit and Uniswap Permit2

<Warning>
  **Looking for Contributors!** This Skill needs an implementation.

  Contributing a Skill involves:

  1. Writing a reference implementation with full functionality
  2. Adding comprehensive tests
  3. Writing documentation with usage examples

  See the [ethers-provider Skill](https://github.com/evmts/voltaire/tree/main/examples/ethers-provider) for an example of a complete Skill implementation.

  Interested? Open an issue or PR at [github.com/evmts/voltaire](https://github.com/evmts/voltaire).
</Warning>

<Info>
  **Skill** — Copyable reference implementation. Use as-is or customize. See [Skills Philosophy](/concepts/skills).
</Info>

Gasless token approvals using EIP-2612 permit signatures and Uniswap's Permit2 contract.

## Why Permit?

Traditional ERC-20 approvals require two transactions:

1. `approve()` — User pays gas to approve spender
2. `transferFrom()` — Protocol transfers tokens

With permit, users sign a gasless message instead:

1. User signs permit message (free, off-chain)
2. Protocol calls `permit()` + `transferFrom()` in one transaction

This improves UX significantly—users don't pay for approvals.

## Planned Implementation

This Skill should cover:

### EIP-2612 Permit

```typescript theme={null}
// Sign a permit for ERC-20 tokens that support EIP-2612
const permit = await signPermit({
  token: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
  owner: walletAddress,
  spender: protocolAddress,
  value: parseUnits('1000', 6),
  deadline: Math.floor(Date.now() / 1000) + 3600, // 1 hour
  signer
});

// permit contains { v, r, s, deadline, value }
// Protocol can now call token.permit(...) + token.transferFrom(...)
```

### Permit2 (Uniswap)

```typescript theme={null}
// Permit2 works with ANY ERC-20, not just EIP-2612 tokens
const permit2 = await signPermit2({
  token: '0x...', // Any ERC-20
  amount: parseUnits('1000', 18),
  expiration: Math.floor(Date.now() / 1000) + 86400, // 24 hours
  nonce: 0,
  spender: protocolAddress,
  signer
});

// Protocol calls Permit2.permitTransferFrom(...)
```

### Batch Permits

```typescript theme={null}
// Approve multiple tokens in one signature
const batchPermit = await signBatchPermit2({
  tokens: [
    { token: USDC, amount: parseUnits('1000', 6) },
    { token: WETH, amount: parseUnits('1', 18) },
  ],
  spender: protocolAddress,
  signer
});
```

## Tokens Supporting EIP-2612

Most major tokens support native permit:

* USDC
* DAI
* UNI
* AAVE
* Most new tokens

For tokens without native permit, use Permit2.

## Resources

* [EIP-2612 Specification](https://eips.ethereum.org/EIPS/eip-2612)
* [Permit2 Documentation](https://docs.uniswap.org/contracts/permit2/overview)
* [Permit2 Contract](https://github.com/Uniswap/permit2)

## Related

* [eip712-typed-data](/skills/eip712-typed-data) — EIP-712 signing (permit uses this)
* [ethers-signer](/skills/ethers-signer) — Signing messages
