/permit2:permit2-allowance-transferfrom permit2
Uses AllowanceTransfer for persistent token approvals. Use when user grants recurring spend authority to the protocol.
Ships in permit2. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Two-step approval pattern: (1) ERC20→Permit2, (2) Permit2→spender. Used when you want persistent allowance without per-tx signatures.
This is what the frontend currently uses for swaps:
import { useWriteContract, useReadContract, useAccount } from 'wagmi'
import { erc20Abi } from 'viem'
// Step 1: ERC20 → Permit2 (one-time or recurring)
const tokenApproveWrite = useWriteContract()
await tokenApproveWrite.writeContractAsync({
address: tokenAddress,
abi: erc20Abi,
functionName: 'approve',
args: [PERMIT2_ADDRESS, BigInt(amount)]
})
// Step 2: Permit2 → Router (persistent)
const permit2Write = useWriteContract()
await permit2Write.writeContractAsync({
address: PERMIT2_ADDRESS,
abi: permit2ApproveAbi,
functionName: 'approve',
args: [
tokenAddress,
routerAddress,
BigInt(amount),
BigInt(expiration)
]
})
// ERC20 allowance (token → Permit2)
const tokenAllowance = await publicClient.readContract({
address: tokenAddress,
abi: erc20Abi,
functionName: 'allowance',
args: [owner, PERMIT2_ADDRESS]
})
// Permit2 allowance (Permit2 → router)
const permit2Allowance = await publicClient.readContract({
address: PERMIT2_ADDRESS,
abi: [{
inputs: [
{ name: 'owner', type: 'address' },
{ name: 'token', type: 'address' },
{ name: 'spender', type: 'address' }
],
name: 'allowance',
outputs: [
{ name: 'amount', type: 'uint160' },
{ name: 'expiration', type: 'uint48' },
{ name: 'nonce', type: 'uint48' }
],
stateMutability: 'view',
type: 'function'
}],
functionName: 'allowance',
args: [owner, tokenAddress, routerAddress]
})
| Scenario | Use |
|---|---|
| User doing frequent trades | AllowanceTransfer |
| One-time signature-based swap | SignatureTransfer |
| Gas optimization for repeated ops | AllowanceTransfer |
| Max security / no pre-approval | SignatureTransfer |
See permit2-allowance-flow skill for complete implementation with reset-to-zero pattern.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (cyotee/cyotee-claude-plugins) — no native marketplace selected
npx claudepluginhub p/cyotee-permit2-plugins-permit210 skills in this plugin
/permit2-addressesCanonical Permit2 contract addresses by chain. Use when configuring multi-chain support./permit2-allowance-flowComplete approval flow with reset-to-zero pattern. Use when implementing full ERC20 and Permit2 approval workflow./permit2-nonce-managementBitmap nonce patterns for Permit2 signature replay protection. Use when generating nonces for SignatureTransfer permits./permit2-router-witnessPermit2 Router Witness (Balancer V3)````skill/permit2-sdkUniswap Permit2 SDK for gasless token transfers in IndexedEx. Use when implementing swap/deposit/withdraw with signature-based or allowance-based authorization./permit2-signature-transferUses permitWitnessTransferFrom for gasless token transfers with EIP-712 signatures. Use when implementing swap/deposit/withdraw with Permit2 signature-based authorization.2 plugins ship this exact skill · first indexed Jul 20, 2026