Permit2 Vault Adapter
One-tx deposit flows using Permit2 for non-EIP-2612 tokens — no separate approve needed.
📁 File Structure 1166 files
📖 Documentation Preview README excerpt
permit2-vault-adapter
One-transaction ERC-4626 vault deposits via Uniswap Permit2 — no separate approve needed.
Price: $6.99 | Store: vault-forge | Product #7
Overview
Permit2VaultAdapter is a stateless adapter contract that enables users to deposit into any ERC-4626 vault in a single transaction, even for tokens that don't support EIP-2612 permit (like USDC, USDT, DAI on mainnet).
The Problem
Standard ERC-20 token deposits into vaults require two transactions:
1. token.approve(vault, amount) — user pays gas, waits for confirmation
2. vault.deposit(amount, receiver) — user pays gas again
This is the #1 UX complaint in DeFi. Users abandon flows, gas is wasted, and protocols lose depositors.
The Solution
With Permit2, the flow becomes:
1. One-time: User approves Permit2 contract for the token (or it's already approved)
2. Off-chain: User signs a Permit2 message (gasless, instant)
3. One tx: Adapter pulls tokens via Permit2 signature → deposits into vault → user receives shares
User signs Permit2 message (off-chain, gasless)
│
▼
┌─────────────────────────┐
│ Permit2VaultAdapter │
│ 1. Pull tokens via P2 │
│ 2. Approve vault │
│ 3. vault.deposit() │
│ 4. Reset approval │
│ 5. Emit event │
└─────────────────────────┘
│
▼
User receives vault shares ✓
Features
| Feature | Description |
|---|---|
| Single deposit | depositWithPermit2() — one vault, one signature |
| Batch deposit | depositWithPermit2Batch() — multiple vaults in one tx |
| Slippage protection | minSharesOut parameter prevents sandwich attacks |
| Stateless | No funds held between transactions |
| Token-agnostic | Works with any ERC-20 token via Permit2 |
| Safe approvals | Exact-amount approve + reset to 0 after deposit |
Architecture
... continues with setup instructions, usage examples, and more.