Pay2Earn
Pay2Earn: Pay Subscription with PyUSD, earn 4%+ APY via Morpho. Providers cut churn! đ¸ #DeFi
Problem Statement
Pay2Earn is a decentralized subscription platform on Arbitrum that uses PayPalâs PyUSD stablecoin to make subscriptions rewarding for users and profitable for service providers. Built for the ETHGlobal Hackathon, it offers a new way to pay for services like streaming, software, or gym memberships while earning returns and reducing subscriber churn.For Users: Pay yearly subscriptions with PyUSD and earn a 4% APY (PyUSDâs holding reward) plus extra yield from Morpho vaults if you complete the full year. Youâll get your principal back plus interest, turning subscriptions into a financial win. Cancel early? You get your principal refunded, but the interest goes to the provider, encouraging you to stay subscribed. The platformâs marketplace lets you browse providers, subscribe easily, and track your subscriptions and rewards on a user-friendly dashboard.For Providers: Pay2Earn helps businesses like SaaS platforms or content creators keep subscribers longer. By offering financial rewards (4%+ APY), users are motivated to stay for the full year, reducing churn. Early cancellations mean you keep the forfeited interest as extra revenue. Joining is simple: register with a business name, description, and PyUSD price via an easy on-chain form. A provider dashboard shows your subscribers, locked PyUSD, and interest earned, with a âWithdraw Interestâ button for quick access to funds.Why It Stands Out: Pay2Earn leverages PyUSDâs stability, Morphoâs yield-boosting vaults, and Arbitrumâs low-cost transactions to create a win-win model. For the hackathon, we built a sandbox demo mode on Arbitrum Sepolia, letting judges test the platform risk-free. The demo includes a guided flow with a pre-funded wallet, sample providers (e.g., âNetflix Cloneâ or âSpotify Premiumâ), and a fast-forward feature to simulate a year-long subscription. Transactions are trackable on Arbiscan for transparency.Pay2Earn makes subscriptions rewarding for users and sustainable for providers, driving DeFi adoption with a scalable, innovative platform.
Solution
đď¸ How It's BuiltSmart Contracts Layer Technology:Language: Solidity 0.8.28Framework: Hardhat 3.0 with Viem integrationDeployment: Hardhat Ignition for reproducible deploymentsNetwork: Arbitrum One (42161) & Arbitrum Sepolia (421614)Core Contracts:SubscriptionManager.sol (543 lines) - Main subscription logic:Manages monthly & yearly subscription modelsIntegrates with Morpho vaults for yield generationHandles pro-rata refunds and automated paymentsMockMorphoVault.sol - Morpho vault simulator for developmentContract address Arbitrum Sepolia (421614): subscriptionManager: '0x13445Bb62F05dc5f460aAE3F721Dd94C34D499c1', pyusd: '0x234982D988f139A77470d1d94ca517F2b404d92a', morphoVault: '0x87569E608a51797F4578740c86334CFcAE1D82Db'Key Features: â Two subscription models (Monthly with optional staking, Yearly) â Morpho vault integration for yield optimization â Automated monthly payment processing â Pro-rata refund calculations â OpenZeppelin security patterns (ReentrancyGuard, Pausable, Ownable)Frontend Application Technology:Framework: Next.js 15.5.6 (App Router with React 19)Language: TypeScript 5Styling: Tailwind CSS 4State Management: TanStack React Query v5Web3 Integration:Wagmi v2.18.1 - React hooks for EthereumViem v2.38.3 - Modern TypeScript Ethereum libraryRainbowKit v2.2.9 - Beautiful wallet connection UI
Hackathon
ETHOnline 2025
2025
Contributors
- johnku2011
12 contributions