.claude/skills/permit2-sdk/SKILL.md
Uniswap Permit2 SDK for gasless token transfers in IndexedEx. Use when implementing swap/deposit/withdraw with signature-based or allowance-based authorization.
npx skillsauth add cyotee/crane permit2-sdkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive guide for using Permit2 in the frontend for vault operations.
import { PERMIT2_ADDRESS, SignatureTransfer } from '@uniswap/permit2-sdk'
Gasless, no pre-approval needed beyond initial Permit2 allowance.
permit2-signature-transferPersistent approvals - user approves once, protocol spends repeatedly.
permit2-allowance-transfer| Exchange | Selector | Witness Data |
|----------|----------|--------------|
| exchangeIn | 0x89d61912 | tokenIn, tokenOut, vault, amountIn |
| exchangeOut | 0x612d4427 | tokenIn, tokenOut, vault, amountOut, maxAmountIn |
| swapSingleTokenExactOut | (Balancer) | pool, tokenIn, tokenOut, amountOut |
permit2-nonce-managementpermit2-wagmi-integrationpermit2-typespermit2-addresses// 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
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
documentation
Write to contracts and send transactions. Use when executing state-changing contract functions.
development
HTTP and WebSocket transports for blockchain connectivity. Use when configuring network connections.
data-ai
Read contract data with type-safe ABI. Use when querying smart contract view/pure functions.