Skip to content

DiamondzShadow/WavzProtocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔥 YouTube Validator Oracle - NFT Airdrop System 🔥

A validator oracle that monitors YouTube and airdrops NFTs to contract holders.

What It Does (Simple AF)

This is a YouTube Validator Oracle that:

  1. Watches @tooomuchmoxiepodcast YouTube channel (every 45 min)
  2. Validates when videos hit 500 VIEWS or 25 LIKES 💥
  3. Queries Drop1155 contract: 0xaE12B3Eb30aAF06161354D6295246854956F3983 for all holders
  4. Mints NFT with video thumbnail on Arbitrum
  5. Airdrops to EVERY Drop1155 holder automatically 🚀

Secure server wallet. No exposed keys. Just pure automation.

Quick Deploy

1. Setup Database

Run these in Supabase SQL Editor: ```sql -- scripts/001-create-youtube-milestones-table.sql -- scripts/002-create-monitored-channels-table.sql -- scripts/003-create-wavz-config-table.sql ```

2. Configure Environment

```env

YouTube

YOUTUBE_API_KEY=your_key_here

Supabase

SUPABASE_URL=https://xxx.supabase.co SUPABASE_SERVICE_ROLE_KEY=your_key

Thirdweb

THIRDWEB_CLIENT_ID=your_client_id THIRDWEB_SECRET_KEY=your_secret

Wallet (Server-side minting)

PRIVATE_KEY=0x1234567890abcdef...

Contracts (Arbitrum)

DROP1155_ADDR=0xaE12B3Eb30aAF06161354D6295246854956F3983 MILESTONE_EDITIONS_ADDR=0xYourERC1155Contract

Milestones

VIEW_MILESTONE=500 LIKE_MILESTONE=25

Security

CRON_SECRET=random_secret_string ```

3. Deploy

```bash vercel --prod ```

Done. Runs every 45 minutes automatically.

How It Works (The Validator Oracle Flow)

``` Vercel Cron (45 min) ↓ Watch YouTube (@tooomuchmoxiepodcast) ↓ Milestone hit? (500 views OR 25 likes) ↓ Query Drop1155 contract for holders ← VALIDATOR PART ↓ Mint NFT with server wallet + Airdrop to ALL holders ↓ DONE! 🎉 ```

See ORACLE_EXPLAINED.md for detailed breakdown.

Architecture

  • Vercel Cron: Triggers polling every 45 minutes
  • YouTube API: Fetches video stats
  • Supabase: Tracks milestone state
  • Thirdweb SDK: Mints & airdrops via server wallet
  • Arbitrum: Where NFTs live

Costs

  • Vercel Pro: $20/month (required for cron)
  • Gas: ~$5-20/month (Arbitrum is cheap)
  • Everything else: Free

Files

  • /app/api/cron/poll-youtube/route.ts - Cron endpoint
  • /lib/polling/poll.ts - Main logic
  • /lib/youtube/api.ts - YouTube integration
  • /lib/nft/mint.ts - NFT minting with server wallet
  • vercel.json - Cron config (45 min)

Docs

  • ORACLE_EXPLAINED.md - How the validator oracle works (ELI5)
  • TEST_ORACLE.md - How to test it manually
  • DEPLOYMENT.md - Full setup guide
  • RATE_LIMITS.md - Why 45 minutes
  • FIXED.md - What was fixed

Support

Check Vercel logs if shit breaks. Everything is logged with [ORACLE], [YouTube], [NFT] prefixes.


Built for @tooomuchmoxiepodcast 🎙️

Releases

No releases published

Packages

 
 
 

Contributors