DeWrap
A cross-chain crypto smart payment collector platform with automated token swapping and investment.
Problem Statement
DeWrapis a Web3-native payment platform designed specifically for builders, creators, agencies, and freelancers who want to accept cryptocurrency payments with maximum flexibility and automation. The platform solves the fundamental problem of crypto payment fragmentation by providing a unified solution for cross-chain, multi-token payments with intelligent automation.Core Problem & SolutionProblem: Traditional crypto payment solutions are limited by:Single-chain restrictionsManual token conversion processesComplex cross-chain payment handlingLack of automated investment strategiesFragmented payment tracking across networksSolution: DeWrap provides a complete payment infrastructure that:Accepts payments in ANY ERC-20 token or native tokens across multiple blockchain networksAutomatically converts tokens using 1inch's cross-chain DEX aggregationProvides intelligent invoicing with flexible payment preferencesOffers automated investment and dollar-cost averaging (DCA) capabilities [COMING SOON]Maintains comprehensive payment tracking and analyticsKey Features & Capabilities1. Multi-Token Payment AcceptanceSupport for any ERC-20 token across all EVM chains that are supported by 1inch ProtocolNative token support (ETH, MATIC, etc.)Automatic payment validation and processing2. Cross-Chain InfrastructurePowered by 1inch's Fusion Plus cross-chain APISeamless token bridging and swapping across networksReal-time quote generation for optimal swap routesAutomated transaction execution with MEV protection3. Smart Invoicing SystemCreate professional invoices with flexible payment optionsSet preferred tokens and chains for each invoiceReal-time payment status trackingAutomated payment matching and processing4. Automated Token Management[COMING SOON]Auto-swap functionality to convert received tokens to preferred tokensDollar-cost averaging (DCA) for systematic investmentInvestment portfolio tracking and analyticsScheduled swap execution via cron jobs5. User Management & AnalyticsSecure authentication via ClerkComprehensive user profiles with payment preferencesReal-time balance tracking across all supported networks [USING 1INCH API]Detailed transaction history and analytics [USING 1INCH API]Performance metrics and insightsTechnical ArchitectureFrontend (Next.js 15)Modern React 19 with TypeScriptTailwind CSS 4 for responsive designRadix UI for accessible componentsWagmi + AppKit for Web3 integrationReal-time data fetching with TanStack QuerySmart Contracts (Solidity 0.8.27)DeWrap.sol: Core contract managing users, invoices, and payoutsDewrapPaymentCollector.sol: Payment collection and processingPaymentCollectorFactory.sol: Factory pattern for scalable deploymentOpenZeppelin contracts for security and best practicesBackend InfrastructurePostgreSQL database with Prisma ORM1inch Cross-Chain APIintegrationViem for Ethereum interactionsZod for runtime validationComprehensive API endpoints for all operationsKey API Endpoints/api/user- User management and profiles/api/invoice- Invoice creation and management/api/payment- Payment processing and tracking/api/quote- Real-time token price quotes/api/execute- Cross-chain transaction execution/api/supported-network- Network and token information/api/token- Descriptive detail regarding tokenTarget Users & Use CasesPrimary Users:Freelancers: Accept payments in any token, automatically convert to preferred tokensAgencies: Manage multiple client payments across different networksContent Creators: Monetize with crypto while maintaining payment flexibilityWeb3 Builders: Integrate DeWrap for project funding and revenue collectionUse Cases:Invoice-based payment collection with automatic token conversionCross-chain payment processing for international clientsAutomated investment strategies for received paymentsPortfolio diversification across multiple blockchain networksSystematic DCA for long-term investment goalsCompetitive AdvantagesTrue Cross-Chain Support: Unlike competitors limited to single chains, DeWrap operates seamlessly across 9+ major networks1inch Integration: Leverages the most advanced DEX aggregator for optimal swap routes and MEV protectionAutomation-First: Built-in auto-swap and DCA capabilities reduce manual interventionDeveloper-Friendly: Comprehensive API and smart contract architecture for easy integrationUser Experience: Modern, intuitive interface that abstracts away blockchain complexityBusiness Model & Revenue StreamsTransaction fees on cross-chain swapsPremium features for advanced usersAPI access for enterprise integrationsWhite-label solutions for businessesDeWrap essentially transforms the fragmented crypto payment landscape into a unified, automated, and user-friendly experience, making it as simple to accept crypto payments as traditional fiat payments while providing advanced features that only blockchain technology can enable.
Solution
How DeWrap Was Built: The Technical Deep DiveDeWrap is a sophisticated Web3 payment platform built with cutting-edge technologies and some clever architectural decisions. Here's the complete technical breakdown:Monorepo Architecture with TurborepoThe project uses aTurborepo monorepostructure for optimal development experience:apps/web: Next.js 15 frontend with React 19apps/contracts: Solidity smart contracts with Hardhatapps/docs: Documentation sitepackages/ui: Shared component librarypackages/eslint-config: Unified linting rulespackages/typescript-config: Shared TypeScript configsThis enables code sharing, consistent tooling, and parallel builds across the entire stack.Frontend: Next.js 15 + React 19 + Modern StackCore Technologies:Next.js 15with App Router for server-side rendering and API routesReact 19with concurrent features and improved performanceTypeScript 5.8for type safety across the entire applicationTailwind CSS 4with PostCSS for utility-first stylingRadix UIfor accessible, unstyled componentsTanStack Queryfor server state management and cachingWeb3 Integration:Wagmi v2+Reown's AppKitfor wallet connections and blockchain interactionsViem 2.xfor low-level Ethereum interactionsEthers.js 6.15for smart contract interactionsCustomAppKitProviderConnectorto bridge AppKit with 1inch ProtocolSmart Contracts: Solidity 0.8.27 + OpenZeppelinCore Contracts:DeWrap.sol: Main contract managing users, invoices, payouts, and investmentsDewrapPaymentCollector.sol: Payment collection and processing logicPaymentCollectorFactory.sol: Factory pattern for scalable deploymentKey Features:ReentrancyGuardfor security against reentrancy attacksOwnablepattern for administrative functionsEvent-driven architecturefor off-chain trackingEnum-based status managementfor invoices and payoutsStruct-based data organizationfor complex relationshipsCross-Chain Infrastructure: 1inch Fusion PlusThis is where DeWrap gets really interesting. The platform leverages1inch's Fusion Plus cross-chain APIfor seamless token bridging and swapping:Cross-Chain Flow:Quote Generation: Real-time pricing across 9+ networksOrder Placement: MEV-protected order submissionSecret Management: HashLock-based atomic swapsFill Monitoring: Automated secret submission for completed fillsStatus Tracking: Real-time order status updatesDatabase: PostgreSQL + PrismaSchema Design:User Management: Clerk integration with custom user profilesInvoice System: Flexible payment preferences and status trackingPayout Tracking: Cross-chain transaction monitoringMetrics: User performance and investment analyticsKey Features:UUID-based primary keysfor securityJSON metadata fieldsfor flexible data storageIndexed relationshipsfor performanceEnum-based status trackingfor type safetyWebhook Integration:Real-time user synchronizationSecure webhook validation with SvixAutomatic profile updatesAPI Architecture: Next.js API RoutesKey Endpoints:/api/quote: 1inch quote generation/api/execute: Cross-chain transaction execution/api/invoice: Invoice management/api/payment: Payment processing/api/cron/swap: Automated swap execution [COMING SOON]
Hackathon
ETHGlobal Unite
2025
Contributors
- lakshh07
53 contributions
- turbobot-temp
4 contributions