Skip to content
Back to skills

2539 Smart Account Swap 85d21c6f

ASecurity

Build a swap integration that executes through an ERC-4337 smart account on Base.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
developmenttypescriptnodeapibackend

Works with

  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2539-smart-account-swap_85d21c6f --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2539 Smart Account Swap 85d21c6f?

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

Security grade badge for 2539 Smart Account Swap 85d21c6f
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2539-smart-account-swap-85d21c6f/badge)](https://www.skillsdirectory.com/skills/tools-only-2539-smart-account-swap-85d21c6f)

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

SKILL.md
# Smart Account Swap Integration Test Case

Build a swap integration that executes through an ERC-4337 smart account on Base.

## Context

- TypeScript/Node.js backend service
- Need to swap USDC to ETH on Base (chain ID 8453)
- Using the Uniswap Trading API through an ERC-4337 smart account
- The smart account uses delegation for executing swaps
- After swap, ETH should be native ETH (not WETH)

## Requirements

1. Get swap calldata from Trading API (3-step flow)
2. Wrap swap calldata in a delegation redemption execution
3. Submit via bundler as a UserOperation
4. Handle WETH unwrapping after swap (Base often returns WETH instead of native ETH)
5. Implement rate limiting with exponential backoff for API calls
6. Use legacy approval (direct to Universal Router) instead of Permit2

## Constraints

- Must use viem for all blockchain interactions
- Must handle the Trading API 3-step flow correctly
- Must explain the approval target choice (legacy vs Permit2 for smart accounts)
- Must include WETH detection and unwrap logic for L2
- Must include retry logic with exponential backoff for 429 responses
- Should include error handling for bundler-specific errors

## Expected Output

A working TypeScript implementation that demonstrates executing Uniswap swaps through an ERC-4337 smart account with delegation, including L2 WETH handling and rate limiting.

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.