Skip to content

Tommybuild/Mello

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸƒ MelloPay

Conversational, AI-assisted Solana payments β€” escrow vaults, tip jars, and scheduled transfers in a single smart wallet.

Mellocoin turns natural-language intent ("send Alex 0.5 SOL on Friday", "lock 2 SOL for the design deliverable") into safe, on-chain actions backed by a custom Anchor program. It is built for hackathon judging: full Rust program + Anchor tests + production-grade frontend on TanStack Start + Tailwind v4 + Wallet Adapter.


✨ Features

  • Smart Wallet Dashboard β€” connect Phantom / Solflare, view SOL & SPL balances, send funds, browse history.
  • Escrow Vaults β€” lock SOL or SPL tokens in PDA-owned vaults; release or refund with one signature.
  • Tip Jars β€” public donation pages with on-chain memos and creator attribution.
  • Scheduled Payments β€” store recurring transfer instructions on-chain as deterministic PDAs.
  • Memo-First UX β€” every flow attaches a category and note via the Solana Memo program.
  • Live on Devnet β€” versioned transactions, ATA management, CPI into SPL Token.

πŸŒ‰ LI.FI Cross-Chain Integration

Why This Matters

Users should not need to manually bridge before using Solana apps. Mellocoin solves this UX friction by deeply integrating LI.FI, allowing users to start on any EVM chain, bridge seamlessly, and instantly use Solana-native payment and creator experiences.

Supported Chains

  • Ethereum
  • Base
  • Arbitrum
  • Polygon
  • Optimism
  • BSC
  • Solana

Cross-Chain User Flow

EVM Wallet β†’ LI.FI Route / Swap β†’ Solana β†’ Mellocoin Escrow / Tip Jar

  1. User opens Mellocoin and connects MetaMask (EVM) or Phantom (Solana).
  2. User chooses a source chain and token.
  3. LI.FI SDK / Widget fetches the best, real-time routes.
  4. User executes the bridge/swap transaction natively in the app.
  5. Assets arrive as SOL or USDC on Solana.
  6. User can instantly utilize Mellocoin features.

Integrations Used

  • LI.FI SDK (@lifi/sdk): Used in the AI-Assisted Smart Router (/routes) to fetch, evaluate, and recommend the cheapest and fastest cross-chain routes.
  • LI.FI Widget (@lifi/widget): Embedded with custom branding for the Cross-Chain Onboarding (/bridge) and Cross-Chain Checkout (/pay) flows to handle real bridging and transaction execution securely.

πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  TanStack Start UI     β”‚  RPC β†’  β”‚  Solana Devnet Cluster   β”‚
β”‚  β€’ Wallet Adapter      β”‚ ◄──────│  β€’ mellocoin_protocol    β”‚
β”‚  β€’ web3.js / spl-token β”‚  events β”‚  β€’ SPL Token / ATA       β”‚
β”‚  β€’ shadcn + Framer     β”‚         β”‚  β€’ Memo Program          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β–Ό                                      β–Ό
   Phantom / Solflare              PDAs: User Β· Escrow Β· Vault Β· TipJar Β· Schedule

Detailed docs: docs/architecture.md, docs/smart-contract-flow.md, docs/pda-structure.md.

PDA layout

Account Seeds
UserProfile [b"user", authority]
Escrow [b"escrow", maker, escrow_id_le_bytes]
Escrow vault [b"escrow-vault", escrow]
TipJar [b"tipjar", creator, slug]
PaymentSchedule [b"schedule", owner, schedule_id_le_bytes]

Escrow lifecycle

   create_escrow            release_escrow
Ø ─────────────► Funded ──────────────────► Released
                   β”‚
                   β”‚ refund_escrow
                   β–Ό
                Refunded

🧰 Solana Libraries Used

  • Anchor 0.30 β€” program framework (PDAs, CPI, events, custom errors, init_if_needed)
  • anchor-spl β€” SPL Token + Associated Token Account CPI
  • @solana/web3.js β€” versioned transactions, signature subscriptions
  • @solana/wallet-adapter-react / -react-ui β€” Phantom / Solflare via Wallet Standard
  • @solana/spl-token β€” ATA derivation + SPL transfers
  • Solana Memo Program β€” on-chain transaction metadata
  • Solana Explorer β€” deep-link UX

πŸš€ Devnet Deployment

Program ID:    TO_BE_FILLED_AFTER_DEPLOY
Frontend URL:  TO_BE_FILLED_AFTER_DEPLOY
Cluster:       solana devnet

After running scripts/deploy-devnet.sh, paste the printed program ID into:

  1. programs/mellocoin_protocol/src/lib.rs (declare_id!)
  2. Anchor.toml ([programs.devnet])
  3. .env (VITE_MELLOCOIN_PROGRAM_ID)

πŸ›  Local setup

Prerequisites

  • Rust + solana-cli (β‰₯ 1.18)
  • anchor-cli 0.30
  • Node 20+ and Bun (or pnpm/yarn)

Steps

# 1. Install JS deps
bun install

# 2. Configure env
cp .env.example .env

# 3. Build & test the Anchor program
anchor build
anchor test

# 4. Deploy to devnet
solana airdrop 2
bash scripts/deploy-devnet.sh

# 5. Run the frontend
bun run dev

Environment variables

Var Default
VITE_SOLANA_CLUSTER devnet
VITE_SOLANA_RPC_URL https://api.devnet.solana.com
VITE_MELLOCOIN_PROGRAM_ID MeLLoXkB3v3VJk2A1mEJC8hQqKqkPkS9qLZxZmL5cKp

πŸ“‚ Project structure

mellocoin/
β”œβ”€β”€ programs/
β”‚   └── mellocoin_protocol/      # Anchor Rust program
β”‚       β”œβ”€β”€ Cargo.toml
β”‚       └── src/lib.rs
β”œβ”€β”€ tests/                       # mocha + chai integration tests
β”œβ”€β”€ scripts/                     # deploy-devnet.sh, local-validator.sh
β”œβ”€β”€ docs/                        # architecture, contract flow, PDA structure
β”œβ”€β”€ src/                         # TanStack Start frontend
β”‚   β”œβ”€β”€ routes/                  # /, /dashboard, /escrow, /tip, /tip/$slug, /settings
β”‚   β”œβ”€β”€ components/              # NavBar, wallet glue, shadcn UI
β”‚   └── lib/                     # solana.ts, wallet-hooks.ts
β”œβ”€β”€ Anchor.toml
β”œβ”€β”€ README.md
└── package.json

πŸ§ͺ Testing

anchor test

Covers:

  • βœ… User profile initialization
  • βœ… Escrow create + release happy path
  • βœ… Unauthorized release rejection
  • βœ… Tip jar creation + tipping flow

πŸ“Έ Screenshots

Landing Hero with glassmorphism + emerald/violet gradients
Cross-Chain Bridge LI.FI Widget embedded for any-to-Solana onboarding
Smart Route AI-assisted route evaluation via @lifi/sdk
Pay Checkout Cross-chain payment flow to a specific Solana escrow
Dashboard Balance, SPL list, recent tx feed
Escrow Fund + memo + status timeline
Tip Jar Public /tip/:slug donation page

(Screenshots live in /docs/screens/ β€” populate after deploy.)


πŸ”­ Future Improvements

  • AI intent parser β†’ server function that crafts versioned transactions from natural language
  • Jupiter quote integration for cross-token tips
  • Metaplex Token Metadata reads to enrich SPL views
  • Address Lookup Tables for batched payroll runs
  • pg_cron β†’ cron worker that executes crank_schedule instructions

πŸ’š Why Mellopay is Unique

Most Solana payment apps are form-driven. Mellocoin treats payments as conversation primitives β€” every action carries a memo, every PDA is addressable, every escrow has a story. It pairs that UX with a serious Solana program: PDAs, CPIs, events, custom errors, and SPL escrows via associated token accounts. It's built to feel like an early-stage fintech, not a tutorial fork.


πŸ“„ License

MIT β€” see also CONTRIBUTING.md.

About

Mellocoin turns natural-language intent into safe, on-chain actions backed by a custom Anchor program.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 87.7%
  • Rust 6.9%
  • CSS 2.8%
  • JavaScript 2.1%
  • Other 0.5%