Skip to content
Back to skills

Permit2 Sdk

ASecurity

Uniswap Permit2 SDK for gasless token transfers in IndexedEx. Use when implementing swap/deposit/withdraw with signature-based or allowance-based authorization.

  • 9 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 10, 2026
businesstypescriptfrontendsecurity

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add cyotee/indexedex --skill permit2-sdk --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Permit2 Sdk?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Permit2 Sdk
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/cyotee-permit2-sdk/badge)](https://www.skillsdirectory.com/skills/cyotee-permit2-sdk)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: permit2-sdk
description: Uniswap Permit2 SDK for gasless token transfers in IndexedEx. Use when implementing swap/deposit/withdraw with signature-based or allowance-based authorization.
---

# Permit2 SDK for IndexedEx

Comprehensive guide for using Permit2 in the frontend for vault operations.

## Quick Start

```typescript
import { PERMIT2_ADDRESS, SignatureTransfer } from '@uniswap/permit2-sdk'
```

## Two Patterns

### 1. Signature Transfer (Recommended)

Gasless, no pre-approval needed beyond initial Permit2 allowance.

- **Skill**: `permit2-signature-transfer`
- **Use for**: One-time signatures per swap/deposit/withdraw
- **Security**: Signature bound to specific action via witness

### 2. Allowance Transfer

Persistent approvals - user approves once, protocol spends repeatedly.

- **Skill**: `permit2-allowance-transfer`
- **Use for**: Frequent trading, recurring deposits

## Exchange Types (Witness Context)

| Exchange | Selector | Witness Data |
|----------|----------|--------------|
| `exchangeIn` | 0x89d61912 | tokenIn, tokenOut, vault, amountIn |
| `exchangeOut` | 0x612d4427 | tokenIn, tokenOut, vault, amountOut, maxAmountIn |
| `swapSingleTokenExactOut` | (Balancer) | pool, tokenIn, tokenOut, amountOut |

## Key Topics

- **Nonce handling**: `permit2-nonce-management`
- **Wagmi integration**: `permit2-wagmi-integration`
- **TypeScript types**: `permit2-types`
- **Chain addresses**: `permit2-addresses`

## Example: Swap with Witness

```typescript
// Witness binds signature to this exact swap
const witness = {
  actionId: keccak256(encodePacked(
    ['address', 'address', 'address', 'uint256'],
    [tokenIn, tokenOut, vaultAddress, amountIn]
  ))
}

// Get permit data (EIP-712 ready)
const { domain, types, values } = SignatureTransfer.getPermitData(
  permit,           // amount, nonce, deadline
  PERMIT2_ADDRESS,
  chainId,
  { witness, witnessTypeName: 'Witness', witnessType: WITNESS_TYPE }
)

// User signs, then your contract calls Permit2
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…