Skip to content

Stoneybro/mneepay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

49 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MneePay

Automated gasless payroll & subscriptions powered by programmable money

Automated payment infrastructure for teams, creators, and businesses β€” built on programmable money.

MneePay is an ERC-4337 smart account wallet that turns complex payment workflows into simple conversations. Create recurring payrolls, batch payments, and automated subscriptions using natural language β€” no manual approvals, no gas management, fully non-custodial.

Built for the MNEE Hackathon, MneePay demonstrates how programmable stablecoins enable the next generation of financial automation and agent-driven commerce.


mneepay.demo.video.mp4

🎯 Problem Statement

Traditional payment systems weren't built for the speed and flexibility of on-chain businesses:

  • Manual overhead: Every pay cycle requires manual approvals and transaction signing
  • Gas complexity: Managing ETH for gas fees creates friction for non-technical users
  • Rigid tooling: Existing solutions don't support multi-recipient payouts or automated schedules natively
  • Poor UX: Web3 wallets aren't designed for natural, conversational workflows

MneePay solves this by combining smart contract accounts, AI-powered intent parsing, and decentralized automation into a single platform where payments just work.


✨ Key Features

πŸ€– Conversational Payment Definition

Define payrolls, subscriptions, and batch payouts using plain English:

  • "Pay my engineering team $6,000 each every two weeks"
  • "Send $500 to these 40 contributors"
  • "Split $20,000: 50% to Alice, 30% to Bob, 20% to Carol"

πŸ”„ Recurring Payroll & Subscriptions

Stop signing transactions every week. MneePay allows you to create robust, on-chain payment schedules that execute automatically:

  • Payrolls: Automate salary disbursements to your entire team.
  • Subscriptions: Set up recurring payments for services or vendors.

πŸ’Έ Native Batch Payments

Execute multi-recipient transfers in a single transaction β€” no extra contracts, no repeated approvals.

οΏ½ Decentralized Automation

Payment schedules run automatically via Chainlink Automation. Set it once, forget it forever β€” no servers, no manual execution.

β›½ Gas Sponsorship

Built on ERC-4337 smart accounts with Pimlico as the bundler. All transactions are gasless for end users.

πŸ” Self-Custodial by Default

Users maintain full control of their funds. Smart accounts are deployed per user via Privy embedded wallets.

πŸ’Ž MNEE Stablecoin Integration

All payments settle in MNEE (0x8ccedbAe4916b79da7F3F612EfB2EB93A2bFD6cF), a fully-backed USD stablecoin designed for instant, low-cost global payments.

πŸ“‡ Contact List

Save frequently used addresses with human-readable names and never copy-paste a wallet address again. When you say "Send $100 to Alice", the AI automatically resolves Alice to her saved address. This eliminates costly mistakes from mistyped addresses and improves UX.


πŸ—οΈ Technical Architecture

MneePay is a full-stack application built with modern Web3 infrastructure:

Frontend

  • Framework: Next.js 16 (App Router)
  • UI: React 18 + Tailwind CSS + shadcn/ui
  • State Management: TanStack Query (React Query)
  • AI Integration: Vercel AI SDK with Gemini 2.5 Flash Lite for intent parsing

Smart Contracts (Foundry/Solidity)

  • MneeSmartWallet β€” ERC-4337 compliant smart account with commitment tracking
  • MneeSmartWalletFactory β€” Deterministic wallet deployment via ERC-1167 minimal proxies
  • MneeIntentRegistry β€” Central registry managing all automated payment intents
  • Deployed on BSC Mainnet

Blockchain Integrations

  • Account Abstraction: ERC-4337 (EntryPoint v0.7)
  • Bundler: Pimlico (with sponsored transactions)
  • Automation: Chainlink Automation for decentralized intent execution
  • Embedded Wallets: Privy (email/social login with no seed phrases)

Indexing & Data Layer

  • Indexer: Envio (GraphQL API for transaction history and analytics)
  • Database: Neon Postgres (chat persistence via Drizzle ORM)
  • Real-time queries: Activity feeds, payment schedules, wallet stats

πŸ“‚ Project Structure

mneepaymenthub/
β”œβ”€β”€ apps/
β”‚   └── web/                    # Next.js frontend application
β”‚       β”œβ”€β”€ app/                # App Router pages
β”‚       β”œβ”€β”€ components/         # React components
β”‚       β”œβ”€β”€ hooks/              # Custom React hooks
β”‚       β”œβ”€β”€ lib/                # Utilities and blockchain clients
β”‚       └── public/             # Static assets
β”‚
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ contracts/              # Foundry smart contracts
β”‚   β”‚   β”œβ”€β”€ src/                # Contract source files
β”‚   β”‚   β”œβ”€β”€ script/             # Deployment scripts
β”‚   β”‚   └── foundry.toml        # Foundry configuration
β”‚   β”‚
β”‚   └── indexer/                # Envio indexer
β”‚       β”œβ”€β”€ config.yaml         # Indexer configuration
β”‚       β”œβ”€β”€ schema.graphql      # GraphQL schema
β”‚       └── src/                # Event handlers
β”‚
└── pnpm-workspace.yaml         # Monorepo configuration

πŸš€ Getting Started

Prerequisites

  • Node.js v18+ (download)
  • pnpm v8+ (npm install -g pnpm)
  • Docker Desktop β€” only required if running the indexer locally (download)

Obtain API Keys

You'll need accounts with the following services (all have free tiers):

Service Purpose Sign Up
Privy Embedded wallet auth privy.io
Pimlico ERC-4337 bundler & gas sponsorship pimlico.io
Neon Serverless Postgres neon.tech
Google AI Studio Gemini API for AI chat aistudio.google.com

Installation

  1. Clone the repository

    git clone https://github.com/Stoneybro/mneepaymenthub.git
    cd mneepaymenthub
  2. Install dependencies

    pnpm install
  3. Configure environment variables

    Copy the example file and fill in your keys:

    cp apps/web/.env.example apps/web/.env.local

    Or create apps/web/.env.local manually:

    # Privy (required)
    NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_id
    
    # Pimlico (required for gasless transactions)
    NEXT_PUBLIC_PIMLICO_API_KEY=your_pimlico_api_key
    NEXT_PUBLIC_PIMPLICO_SPONSOR_ID=your_sponsorship_policy_id
    
    # Database (required for chat persistence)
    DATABASE_URL=your_postgres_connection_string
    POSTGRES_URL_NON_POOLING=your_postgres_non_pooling_url
    
    # AI (required for conversational payments)
    GOOGLE_GENERATIVE_AI_API_KEY=your_gemini_api_key
  4. Run database migrations

    cd apps/web
    pnpm db:push
    cd ../..
  5. Start the development server

    From the repository root:

    pnpm dev

    Or from the web app directory:

    cd apps/web
    pnpm dev
  6. Access the application

Optional: Run the Indexer Locally

The app uses a hosted Envio indexer by default. To run it locally:

cd packages/indexer
pnpm dev

This requires Docker and exposes a GraphQL playground at http://localhost:8080.


🎬 Demo Flow

1. Wallet Activation

Users sign in with email/social login. A smart account is deployed deterministically on first use.

2. Fund Your Wallet

Deposit ETH or MNEE stablecoin. The wallet displays available vs. committed balances in real-time.

3. Save Your Contacts

Add team members, vendors, or frequent recipients to your contact list with friendly names. No more copy-pasting addresses β€” just use names like "Alice" or "Marketing Budget".

4. Create a Payment

Use natural language to define your payment:

  • Single transfer: "Send $100 to Alice" β€” the AI resolves Alice from your contacts
  • Batch payout: "Pay $50 each to Alice, Bob, and Carol"
  • Recurring payroll: "Pay my team $6,000 each every two weeks for 6 months"

5. Confirm & Execute

Review the parsed intent in a clean UI card. Confirm the transaction β€” no gas fees, fully sponsored.

6. Automation Runs

Chainlink keepers execute scheduled payments automatically. Track history and cancel anytime.


πŸŽ₯ Demo Video

▢️ Watch the Demo


πŸ§ͺ Testing

Smart Contracts

cd packages/contracts
forge test

Frontend

cd apps/web
pnpm test

Local Indexer

cd packages/indexer
pnpm dev

πŸ“Š How It Works: Technical Deep Dive

1. Intent Parsing

User input is sent to a Gemini 2.5 model with a structured prompt. The AI:

  • Identifies recipients and amounts
  • Extracts timing parameters (interval, duration, start time)
  • Selects the correct smart contract method
  • Validates all parameters before tool execution

2. Smart Account Execution

The parsed intent becomes a UserOperation:

  • Single transfers: execute(target, value, data)
  • Batch transfers: executeBatch(Call[] calls)
  • Recurring payments: Registry calls createIntent(...)

3. Commitment Tracking

When an intent is created:

  • Funds are locked in the wallet's s_committedFunds mapping
  • Available balance = total balance - committed balance
  • Prevents double-spending across overlapping intents

4. Automated Execution

Chainlink Automation:

  • Calls checkUpkeep() every block to scan for executable intents
  • Triggers performUpkeep() when conditions are met
  • Registry calls wallet's executeBatchIntentTransfer(...) to distribute funds

5. Indexing & Analytics

Envio indexer captures all events:

  • Wallet deployment
  • Single/batch executions
  • Intent creation/execution/cancellation
  • Failed transfers

Data is queryable via GraphQL for dashboards and activity feeds.


πŸ† MNEE Hackathon Submission

Track: Programmable Finance & Automation

How We Use MNEE:

  • All payments settle in MNEE stablecoin
  • Demonstrates programmable money via automated, scheduled payouts
  • Enables AI agents to execute treasury operations without human intervention

Solves Real Coordination Problems:

  • Automated payroll eliminates manual approval overhead for remote teams
  • Batch payments reduce costs and time for large distributions
  • Shared treasury automation enables transparent, predictable budget execution

Impact Potential:

  • Targets remote-first companies, DAOs, creator economies
  • Scalable infrastructure (Chainlink Automation, ERC-4337)
  • Open-source and composable β€” other projects can build on our contracts

πŸ› οΈ Tech Stack Summary

Layer Technology
Frontend Next.js 16, React 18, TypeScript, Tailwind CSS
Smart Contracts Solidity 0.8.28, Foundry, ERC-4337
Account Abstraction Pimlico (Bundler), EntryPoint v0.7
Automation Chainlink Automation
AI/NLP Vercel AI SDK, Gemini 2.5 Flash Lite
Auth Privy (embedded wallets)
Database Neon Postgres, Drizzle ORM
Indexing Envio (GraphQL API)
Payments MNEE Stablecoin (0x8cce...)

🀝 Contributing

We welcome contributions! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is open-source under the MIT License.


πŸ”— Links


πŸ™ Acknowledgments

Built with support from:

  • MNEE β€” Programmable money infrastructure
  • Chainlink β€” Decentralized automation
  • Pimlico β€” ERC-4337 bundler and gas sponsorship
  • Privy β€” Embedded wallet authentication
  • Envio β€” Real-time blockchain indexing

MneePay β€” Where payments become conversations, and automation becomes trust.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •