← Back to home

ENSwap

Identity-verified DeFi swaps with ENS reputation & Hedera infrastructure

Problem Statement

ENSwap is a revolutionary Web3 platform that bridges decentralized identity with DeFi by combining ENS-based reputation systems with optimal token swapping. Built on Hedera Testnet, ENSwap enables users to create verified identities and build trust through transaction history, while accessing the best swap rates via comprehensive 1inch API integration. The platform introduces novel features like transaction-specific ENS subnames, reputation-based subname minting, and identity-verified swaps. Users establish ENS identities with DIDs, track their reputation scores, and execute secure token swaps powered by 1inch's 7 APIs (Quote, Swap, Price Feed, Balances, Metadata, Protocols, Health Check). The smart contract architecture includes ENSwapIdentity for core identity management, ENSSwapIntegration for creative ENS features, and HederaENSSwap for HTS integration. ENSwap's technical stack features React 18 + TypeScript frontend, Solidity smart contracts with OpenZeppelin standards, Wagmi + RainbowKit for Web3 integration, and deployment on Hedera Testnet (Contract: 0xEe58d185f59e01034527d95FDd85236fa245Ea9f). The platform creates the first reputation-based trading system in Web3, where users build credibility through verified transactions rather than anonymous trading, enhancing trust and security in DeFi while maintaining decentralization principles.

Solution

ENSwap was built using a modern full-stack Web3 architecture that seamlessly integrates multiple cutting-edge technologies. The frontend leverages React 18 with TypeScript and Vite for optimal performance, styled with Tailwind CSS for a professional futuristic interface. Web3 integration is handled through Wagmi and RainbowKit, providing smooth wallet connection across MetaMask and WalletConnect protocols. The smart contract layer uses Solidity with OpenZeppelin standards for security, deployed on Hedera Testnet using Hardhat for development and testing. The core ENSwapIdentity contract manages user identities and reputation scoring, while additional contracts handle ENS integration and Hedera-specific features. A particularly hacky but effective approach was implementing a multi-fallback system for 1inch API calls, using a local Express.js proxy server to bypass CORS issues, with fallbacks to CORS proxies and direct API calls when needed. The 1inch integration utilizes all 7 available APIs comprehensively - Quote, Swap, Price Feed, Wallet Balances, Token Metadata, Protocols, and Health Check - creating a robust trading experience with real-time data. ENS integration goes beyond basic usage by implementing transaction-specific subname minting, where each swap generates a unique ENS subname like "swap-0x1a2b...enswap.eth", and reputation-based subname creation for high-reputation users. Hedera's EVM compatibility enabled seamless deployment while leveraging HTS (Hedera Token Service) system contracts for native HBAR support and enhanced reputation bonuses. The architecture uses a monorepo structure with separate frontend and contracts directories, comprehensive environment variable management for API keys and contract addresses, and a sophisticated state management system using React Context for Web3 interactions. A notable technical achievement was implementing automatic network switching to Hedera Testnet when users create identities, ensuring smooth UX while maintaining cross-chain compatibility for future expansion to Ethereum mainnet.

Hackathon

ETHGlobal New Delhi

2025

Contributors