Swap on Uniswap v3 using ENS text records to enforce user-defined slippage and fee settings.
ENS Swap is a full-stack Ethereum dApp that lets users execute Uniswap v3 swaps using preferences stored directly on their ENS name. Instead of manually selecting slippage tolerance and pool fee tiers each time, the app resolves an ENS name on the Sepolia testnet and reads user-defined slippage and fee text records. These values are then enforced on-chain by a custom Solidity smart contract that wraps Uniswap v3’s SwapRouter02, ensuring swaps execute strictly within the ENS-defined constraints. The project demonstrates ENS as a configuration layer for DeFi, combining Next.js, wagmi, and a rigorously tested smart contract to deliver trust-minimized, user-controlled swap execution.
The project is built as a full-stack Ethereum dApp with a clean separation between frontend logic, ENS resolution, and on-chain enforcement. The frontend uses Next.js 16, React 19, TypeScript, Tailwind CSS, wagmi v2, RainbowKit, and viem to handle wallet connections, ENS name resolution, and contract interactions on Sepolia. ENS text records are read client-side via viem, parsed into concrete swap parameters, and surfaced to the user before execution. On the backend, a custom Solidity 0.8.20 smart contract wraps Uniswap v3’s SwapRouter02 and enforces slippage checks derived from ENS data, rather than trusting frontend input. Hardhat is used for deployment and a comprehensive test suite with mocks to validate slippage boundaries, reverts, and fee tiers. The “hacky” insight is treating ENS as a decentralized configuration layer for DeFi behavior, allowing human-readable names to drive enforceable on-chain logic.

