← ClaudeAtlas

permit2-patternslisted

Detect Permit2 / EIP-2612 lifecycle bugs — signature lifecycle, allowance transfer vs signature transfer confusion, nonce reuse, deadline manipulation, witness-data misuse. Activate on `permit`, `permitTransferFrom`, `IPermit2`, `SignatureTransfer`, `AllowanceTransfer`, `PermitWitnessTransferFrom`, `PermitBatchTransferFrom`.
iktok90-design/ai-smart-contract-auditor · ★ 36 · AI & Automation · score 80
Install: claude install-skill iktok90-design/ai-smart-contract-auditor
# Permit2 / EIP-2612 detection ## Background EIP-2612 (`permit`) — token-native gasless approval, per-token nonce. Permit2 (Uniswap) — canonical contract bridging legacy ERC20s into the permit world; two APIs: - **SignatureTransfer** — one-shot, sig consumed atomically. - **AllowanceTransfer** — persistent allowance with nonce + expiration. ## When this applies - Routers, swap aggregators, vaults using Permit2 / EIP-2612 for gasless approve flows - Custom permit implementations - Apps calling `IPermit2.permitTransferFrom`, `permitWitnessTransferFrom`, `permit` ## Detection patterns ### Permit2 `permitTransferFrom` without amount check (CRITICAL) ```solidity permit2.permitTransferFrom(permit, transferDetails, owner, signature); // uses `transferDetails.requestedAmount` — caller-controlled ``` Caller can request `permit.permitted.amount` (the max), regardless of intent. App must enforce the actual transfer amount. ### Witness data ignored (HIGH) `permitWitnessTransferFrom` includes a user-signed `witness` blob. App must validate it matches the intended action; otherwise sig can be reused with different context. ### SignatureTransfer vs AllowanceTransfer confusion (HIGH) SignatureTransfer is one-shot. AllowanceTransfer is persistent with nonce + expiration. Mixing → over-approval or replay. ### Allowance not invalidated after one-shot use (HIGH) Some implementations using AllowanceTransfer don't increment nonce after consumption. ### Missing deadline (HIGH) Permit sigs