Swap Router Contract
Multi-DEX swap router with fee-recipient monetization. Routes trades across Uniswap V2/V3 and any DEX adapter.
Product 1 of the defi-router store. Part of the CryptoForge DeFi toolkit.
Price: $14.99 | License: MIT | Solidity: ^0.8.24 | Framework: Foundry
Overview
CryptoForgeRouter is a production-ready multi-DEX swap router that monetizes trade routing via a configurable protocol fee (0.05%-1%) sent to a fee recipient address. Built on OpenZeppelin v5 with defense-in-depth security patterns.
Key Features
- Multi-DEX routing -- Adapter pattern supports Uniswap V2/V3, SushiSwap, Curve, Balancer, and any custom DEX
- Fee-recipient monetization -- Configurable protocol fee (5-100 bps) collected on every swap
- Multi-hop swaps -- Route through intermediate tokens (A -> B -> C) with mixed adapters per hop
- Permit2 support -- Gasless token approvals via Uniswap's Permit2 signatures
- 24-hour timelock -- Fee rate changes are delayed, giving users predictability
- Emergency controls -- Pause all swaps + sweep stuck tokens
- Ownable2Step -- Two-step ownership transfer prevents accidental loss of admin control
- ReentrancyGuard + CEI -- All swap functions are reentrant-safe
- Deadline enforcement -- All swaps revert if deadline has passed
🔒 Available in full product
Architecture
🔒 Available in full product
Fee Model
You’ve reached the end of the free preview
Get the full Swap Router Contract and unlock everything.
All Chapters
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Full Tool Suite
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Source Files
Downloadable source code, configuration files, and working examples from every chapter.
Lifetime Updates
Free updates for life. Every new chapter, tool, and improvement included.
Buy Now — $15 →
📦 Free sample included — download another copy for the full product.
Swap Router Contract v1.0.0 — Free Preview