We will be undergoing planned maintenance on January 16th, 2026 at 1:00pm UTC. Please make sure to save your work.

🚀 Ad402 - Decentralized Advertising Platform

MNEE Hackathon Submission


🎯 Inspiration

Traditional digital advertising is broken:

  • Publishers lose 30-50% of revenue to intermediaries
  • Advertisers face complex approval processes and high costs
  • Platforms take hefty fees while providing minimal transparency
  • Payment delays leave publishers waiting weeks for earnings

We envisioned a decentralized advertising ecosystem where MNEE stablecoin could solve these pain points. By leveraging programmable money, we could enable:

  • ✅ Instant, transparent payments
  • ✅ Direct advertiser-to-publisher relationships
  • ✅ Zero intermediary fees
  • ✅ Real-time financial automation

Ad402 is the solution: A Web3-native advertising platform powered by MNEE, where everyone wins.


💡 What it Does

Ad402 is a revolutionary decentralized advertising platform that enables direct payments between advertisers and publishers using MNEE stablecoin.

📢 For Publishers:

  • 5-minute Integration: Add a single script tag, place ad slots, start earning
  • Instant MNEE Payments: Get paid immediately to your wallet
  • 93-95% Revenue Share: Keep nearly all earnings (vs 50-70% with traditional networks)
  • Complete Control: Set your own prices, manage moderation, track analytics in real-time

🎨 For Advertisers:

  • Direct Placement: No gatekeepers or complex approval processes
  • Pay-Per-View: Only pay for actual ad impressions with MNEE
  • Global Reach: Access thousands of websites without geographic restrictions
  • Instant Publishing: Ads go live immediately after MNEE payment confirms

🛠️ Key Features:

  • Multiple Ad Formats: Images, HTML, videos, responsive designs
  • Dynamic Pricing: Time-based and demand-based pricing models
  • Competitive Bidding: Queue system for prime ad slots with automatic activation
  • Content Moderation: Built-in safety with manual review capabilities
  • Real-time Analytics: Track ad performance, clicks, and revenue
  • Mobile Responsive: Optimized for all devices and screen sizes
  • Decentralized Storage: All ads stored on IPFS via Lighthouse (censorship-resistant)

🏗️ How We Built It

Architecture Overview:

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   Frontend      │    │   Payment        │    │   Storage       │
│   (Next.js)     │◄──►│   (MNEE/Sepolia) │◄──►│   (IPFS)        │
│   React App     │    │   Ethereum       │    │   Lighthouse    │
└─────────────────┘    └──────────────────┘    └─────────────────┘
         │                       │                       │
         ▼                       ▼                       ▼
┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   Ad402 SDK     │    │   API Routes     │    │   Bidding       │
│   (npm package) │    │   (Serverless)   │    │   Queue System  │
└─────────────────┘    └──────────────────┘    └─────────────────┘

MNEE Integration (Demo & Production):

Current Setup (Demo/Testnet):

  • Uses MockMNEE token on Ethereum Sepolia for testing
  • Demonstrates complete payment flow with mock ERC-20 stablecoin
  • Advertisers pay in MockMNEE, publishers receive MockMNEE instantly
  • Smart contract handles EIP-3009 permit-based transfers (gasless approvals)

Production Configuration:

# Development (Mock - Sepolia Testnet)
MNEE_CONTRACT_ADDRESS=0xc3f527c471c8ec8b329d8d09582e7cdf598947de
NEXT_PUBLIC_NETWORK=sepolia

# Production (Real MNEE - Mainnet)
MNEE_CONTRACT_ADDRESS=[REAL_MNEE_CONTRACT_ADDRESS]
NEXT_PUBLIC_NETWORK=ethereum

How it works:

  1. Advertiser connects wallet and submits MNEE payment
  2. Smart contract transfers MNEE from advertiser → platform → publisher
  3. Payment confirmed on-chain in ~12 seconds
  4. Ad goes live immediately
  5. Publisher receives MNEE instantly (no intermediaries, no delays)

The code works identically with real MNEE stablecoin - just change the contract address!

Tech Stack:

Frontend & Backend:

  • Next.js 15.2.1 (React framework with server-side rendering)
  • TypeScript 5.8.2 (type-safe development)
  • Tailwind CSS + shadcn/ui (modern, responsive design)
  • Vercel deployment (serverless infrastructure)

Smart Contracts:

  • Solidity 0.8.28 - MockMNEE ERC-20 token (Demo/Testnet)
  • Hardhat 3.0.1 - Professional contract development
  • Hardhat Ignition - Declarative deployment system
  • @openzeppelin/contracts 5.4.0 - Battle-tested contract libraries

Blockchain:

  • Ethereum Sepolia Testnet (Chain ID: 11155111) - Demo Environment
  • MockMNEE Contract (Deployed): 0xc3f527c471c8ec8b329d8d09582e7cdf598947de
    • ⚠️ For Production: Replace with actual MNEE stablecoin contract address
    • 📝 Configuration Location: /client/.envMNEE_CONTRACT_ADDRESS
  • Etherscan Verification: Full contract source code visible
  • Bun 1.3.5 - Fast, reliable package manager for contract dependencies

Storage & Data:

  • IPFS - Decentralized, permanent ad storage
  • HTTP-based Storage - No native module dependencies (serverless-friendly)
  • 30-second Cache - Optimized performance with smart caching
  • 30-day Retention - Long-term ad persistence

Web3 Integration:

  • ethers.js 6.16.0 - Ethereum interaction library
  • WalletConnect - Multi-chain wallet support
  • MetaMask Integration - Seamless wallet connection

Deployment Process:

# 1. Contract Development
cd contracts
bun install
npx hardhat compile  # Compiled 2 files with solc 0.8.28

# 2. Local Testing
npx hardhat ignition deploy ignition/modules/MNEE.ts
# Successfully deployed 🚀

# 3. Sepolia Testnet Deployment
npx hardhat ignition deploy ignition/modules/MNEE.ts --network sepolia
# MockMNEE deployed to: 0xc3f527c471c8ec8b329d8d09582e7cdf598947de

# 4. Frontend Integration
cd app
npm install
npm run dev  # Live on http://localhost:3000

🚧 Challenges We Ran Into

1. Contract Compatibility Issues

  • Challenge: ERC20Permit abstract functions had conflicting override declarations
  • Solution: Correctly identified which functions to override (only _mint, _burn, _afterTokenTransfer)
  • Learning: Deep understanding of ERC-20 inheritance and OpenZeppelin contracts

2. Hardhat Configuration Complexity

  • Challenge: Hardhat 3.0 uses different APIs than earlier versions (defineConfig vs direct exports)
  • Challenge: Environment variable loading required proper configuration
  • Solution: Implemented correct hardhat.config.ts with configDotenv() for environment support
  • Solution: Used direct process.env instead of configVariable() API

3. Node.js Version Incompatibility

  • Challenge: Node.js 25.2.1 is technically unsupported by Hardhat/npm
  • Solution: Switched to Bun as package manager (faster, more compatible)
  • Solution: Successfully installed 479+ packages and compiled without errors

4. Interactive Deployment Confirmation

  • Challenge: Hardhat Ignition requires manual confirmation for live network deployments
  • Solution: Implemented proper confirmation flow for security
  • Learning: This is a safety feature to prevent accidental mainnet deployments

5. Testnet RPC Reliability

  • Challenge: Finding stable, free Sepolia RPC endpoints
  • Solution: Used https://ethereum-sepolia-rpc.publicnode.com (public node)
  • Solution: Verified with multiple RPC calls to ensure transaction confirmation

6. IPFS Serverless Integration

  • Challenge: Traditional IPFS clients require native modules (not serverless-compatible)
  • Solution: Implemented HTTP-based Lighthouse.storage integration
  • Solution: Deployed to Vercel successfully with persistent ad storage

7. Real-time Queue Management

  • Challenge: Managing bidding queues across multiple concurrent users
  • Solution: Implemented efficient queue system with expiration tracking
  • Solution: Automatic ad rotation when current ads expire

🏆 Accomplishments We're Proud Of

✅ Live Contract Deployment (Demo)

  • MockMNEE (demonstration token) successfully deployed to Ethereum Sepolia testnet
  • Contract address: 0xc3f527c471c8ec8b329d8d09582e7cdf598947de
  • Full source code verified on Etherscan
  • Transaction hash: 0x2ccd70b0b9ecef8df1b36424d9a671bcf82fe427bb64b66cf7d49174ef315f74
  • This demonstrates the exact payment flow that works with the real MNEE stablecoin
  • 🔄 Production Setup: Simply update MNEE_CONTRACT_ADDRESS in environment variables to use actual MNEE contract

✅ Complete Hardhat Setup

  • Professional-grade smart contract framework
  • Hardhat Ignition for declarative deployments
  • Automated compilation and testing pipeline
  • Multi-network support (local, Sepolia, mainnet-ready)

✅ Full-Stack Web3 Application

  • Next.js frontend with real-time updates
  • Serverless API routes (scalable)
  • Web3 wallet integration (MetaMask, WalletConnect)
  • TypeScript throughout (100% type-safe)

✅ Decentralized Storage

  • Censorship-resistant ad storage
  • 30+ day retention guarantee
  • HTTP-based (serverless-friendly)

✅ SDK & Developer Experience

  • Npm package for easy integration
  • React hooks and Context API
  • TypeScript type definitions
  • Complete documentation and examples

✅ Advanced Features

  • Competitive bidding system with queue management
  • Snapshot-based ERC-20 with permit functionality
  • Dynamic pricing (time-based and demand-based)
  • Real-time analytics and revenue tracking
  • Multiple ad formats (images, HTML, videos)

✅ Business Model

  • 2-5% platform fee (vs 30-50% traditional networks)
  • Publishers keep 95-98% of revenue
  • Advertisers pay only for impressions
  • Zero payment delays (instant MNEE settlement)

📚 What We Learned

Blockchain Development:

  • ✅ ERC-20 token standards and inheritance patterns
  • ✅ Smart contract security (override declarations, reentrancy prevention)
  • ✅ Hardhat framework and deployment best practices
  • ✅ Ethereum Sepolia testnet quirks and RPC reliability
  • ✅ Transaction confirmation and gas optimization

Web3 Integration:

  • ✅ Wallet connection patterns (MetaMask, WalletConnect)
  • ✅ ethers.js library for blockchain interaction
  • ✅ Contract interaction from frontend applications
  • ✅ Environment variable management for secure keys

Serverless Architecture:

  • ✅ IPFS integration without native modules
  • ✅ HTTP-based storage for serverless platforms
  • ✅ Vercel deployment optimization
  • ✅ Caching strategies for Web3 data

Product Design:

  • ✅ UX for both publishers and advertisers
  • ✅ Real-time bidding system design
  • ✅ Queue management for fair slot allocation
  • ✅ Analytics dashboard for business insights

Project Management:

  • ✅ Iterative development and debugging
  • ✅ Issue resolution with Node.js/npm compatibility
  • ✅ Testing on testnets before production
  • ✅ Documentation and API design

🎯 Why This Matters for MNEE

Ad402 demonstrates programmable money in action:

  1. Instant Settlements: MNEE enables real-time payments without intermediaries

    • Demo proof: MockMNEE transfers complete in ~12 seconds
    • Zero payment delays for publishers
  2. No Volatility: USD-backed stability makes pricing predictable

    • Publishers don't worry about token fluctuation
    • Advertisers know exact cost per impression
    • Both parties benefit from stablecoin reliability
  3. Creator Economy: Empowers creators to monetize directly

    • 95-98% revenue share (vs 50-70% traditional networks)
    • Publishers get paid instantly to wallet
    • No gatekeepers or approval delays
  4. Financial Inclusion: No bank accounts required, just a Web3 wallet

    • Works globally
    • No traditional banking friction
    • Direct wallet-to-wallet settlements
  5. Transparency: All transactions visible on blockchain

    • Publishers can verify payments on Etherscan
    • Complete audit trail of all ad placements
    • No hidden fees or platform manipulation

The Ad402 platform is proof that MNEE stablecoins can revolutionize commerce, one ad slot at a time. 🚀


🔄 Demo vs Production Ready

Current Status: ✅ Fully functional demo on Ethereum Sepolia with MockMNEE

  • What's working: Complete payment flow, ad placement, revenue tracking, bidding system
  • What's mocked: ERC-20 token (MockMNEE instead of real MNEE)
  • Production path: Single environment variable change to use real MNEE stablecoin address
  • No code changes required: The platform is production-ready, just swap the token address

🔗 Resources & Links

Built With

  • bun-1.3.5
  • erc-20
  • erc-20-permit
  • erc-20-standard
  • ethereum-sepolia-testnet
  • ethers.js-6.16.0
  • hardhat-3.0.1
  • hardhat-ignition
  • http-api
  • ipfs
  • lighthouse-storage
  • metamask
  • next.js-15.2.1
  • node.js
  • npm
  • npm-package-manager
  • openzeppelin-contracts-5.4.0
  • prisma-(optional-orm)
  • react
  • shadcn/ui
  • solidity-0.8.28
  • tailwind-css
  • typescript-5.8.2
  • vercel
  • walletconnect
Share this project:

Updates