Skip to content
DDevlinksPublic
forked from Yormee-103/PayLoop

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Β 
Β 

Latest commit

Β 

History

74 Commits

Folders and files

Repository files navigation

PayLoop

Contract CI Web CI Deploy (CD)

Get paid for freelance work in seconds, not weeks β€” with a permanent, portable income record.

PayLoop is an invoicing + escrow dApp built on Stellar/Soroban. It lets freelancers (built with Nigerian & African freelancers working with foreign clients in mind) create an invoice, share a payment link, and receive USDC the moment a client funds it β€” settling in ~5 seconds for a fraction of a cent, instead of the 2–5 days and 5–8% that PayPal/Payoneer cost. Every paid invoice is a timestamped on-chain record that becomes the freelancer's portable income history. Open-source Soroban invoicing and escrow dApp enabling freelancers to receive USDC payments and build verifiable on-chain income records.

Website: https://pay-loop-neon.vercel.app

Topics: stellar, soroban, rust, usdc, escrow, invoicing, freelancers, web3, payments


The core loop

create_invoice  β†’  fund_invoice (client pays, escrow + instant release)  β†’  Paid, on-chain forever

That create β†’ fund β†’ release loop is PayLoop. Everything else is UX around it.

πŸ”— Live app: https://pay-loop-neon.vercel.app Β Β·Β  🎬 Demo video: https://www.loom.com/share/0b08c1208df841ac96ecd61b2b05a7a9 🎀 Pitch deck: /pitch (web) Β· PayLoop-Pitch-Deck.pptx


Level 5 β€” Blue Belt

This level is about growth, iteration, and pitching. Everything shipped here is driven by the user feedback collected in Level 4.

User growth & usage proof

  • 60 testnet users onboarded with real wallet transactions β€” proof log in docs/USERS.md, live on the Activity page (unique-wallet + invoice counts, Export CSV), and on stellar.expert.
  • On-chain activity snapshot (point-in-time, 2026-08-12): docs/testnet-traction.csv β€” 42 invoices on-chain, 34 Paid. This is a committed snapshot, not a live figure; for the current on-chain count, see the live Activity page.

Feedback collection & Excel export

  • Feedback collection: a user survey collecting name, email, wallet address, network, product rating and written feedback.
  • Raw responses (Google Sheet): view-only link.
  • Excel export (committed): docs/survey-responses.xlsx β€” generated from the form CSV by python3 scripts/build-excel.py, with a Responses sheet (every user) and a Summary sheet (metrics).

Product iteration (feedback β†’ shipped, with commits)

The full traceability table β€” each user request, the feature that shipped, and its commit β€” is in docs/GROWTH.md. Summary of what shipped:

  • Invoice history page with search + status/role filters
  • Invoice preview before sending
  • PDF export for any invoice (and paid receipts)
  • Onboarding walkthrough (first-run tour + navbar "?")
  • Payment reminders (one-click copy-to-send)
  • Dark/light mode toggle (dark default)
  • UX polish: retry on all load errors, stronger buttons, better empty states
  • Analytics: activity-page CSV export + live usage stats

Pitch & demo

  • Pitch deck: web /pitch Β· downloadable PayLoop-Pitch-Deck.pptx (generated by python3 scripts/build-pitch.py).
  • Demo video: Level-5 walkthrough covering create β†’ preview β†’ pay β†’ history β†’ activity β†’ withdraw β€” script in DEMO.md.

Submission checklist

Mapped requirement-by-requirement in SUBMISSION.md.


Why Stellar

Problem (today) PayPal / wire PayLoop on Stellar
Speed 2–5 days; PayPal 21-day holds ~5 second settlement
Cost 3–5% fee + 5–8% FX markup fractions of a cent network fee
Income trail scattered bank alerts, WhatsApp tamper-proof on-chain invoice history
Compliance you become a money transmitter anchors handle the regulated fiat on/off-ramp

Architecture

  • Smart contract β€” contracts/invoice, Rust/Soroban, deployed to Stellar testnet. Holds invoices and performs the atomic clientβ†’freelancer USDC transfer on funding.
  • Web app β€” web/, Next.js (App Router) + TypeScript + Tailwind, Freighter wallet, deployed on Vercel. Mobile-responsive, with loading/error states throughout.
  • Observability β€” Sentry (errors) + Vercel Analytics (usage).
  • Public activity feed β€” /activity reads every invoice straight off the contract and reports usage stats; doubles as verifiable proof of wallet interactions.
  • Feedback β€” in-app widget β†’ /api/feedback (forwards to an optional webhook).
  • Anchor off-ramp β€” USDC β†’ Naira bank payout is mocked for this submission with clear UX and a documented integration path. See docs/ANCHOR.md.

Full design: docs/ARCHITECTURE.md. Contract-level integrator reference (entrypoints, auth matrix, errors, events, integration code): contracts/invoice/README.md.

Soroban architecture at a glance

  • The contract is the only database. Invoice state lives in two persistent storage keys per freelancer (Invoice(id) records and a per-freelancer History index) plus three instance keys set once at initialize (admin, default token, id counter). There is no application backend holding state.
  • Two-state lifecycle: Pending β†’ Paid, transitioned atomically inside fund_invoice together with the clientβ†’freelancer token transfer (instant release β€” the contract never custodies funds). Double payment is impossible (AlreadyPaid), and a short client balance fails with a typed InsufficientBalance error instead of an opaque token trap.
  • Authorization is minimal and verified: only the freelancer being credited can create their invoice, only the named client can fund it, and no admin power exists after one-time initialization. Authorization enforcement is covered by MockAuth tests (impostor and no-auth rejections).
  • Events for indexers: InvoiceCreated and InvoicePaid emit freelancer/client as topics, so off-chain indexers can watch addresses directly instead of scanning invoices.

What PayLoop contributes to the Stellar ecosystem

Ecosystem relevance beyond the product itself:

  1. A reusable, token-agnostic invoice/escrow contract. The payment token is chosen at initialize, invoices store the token they were created with, and the instant-release escrow pattern is documented for reuse β€” contracts/invoice/README.md ships the lifecycle, storage model, auth matrix, error codes, event schema, build/test commands and copy-paste TypeScript/CLI integration examples against the live testnet deployment.
  2. A reusable authorization-test pattern. contracts/invoice/src/test.rs pairs standard mock_all_auths convenience tests with MockAuth-verified tests that prove exactly which party must sign each write (including the nested token-transfer authorization inside fund_invoice) β€” a technique other Soroban teams can copy for their own require_auth coverage.
  3. Practical testnet-SAC lessons in the open. The repo documents and implements the friction points of using an issued asset on Soroban testnet: in-app trustline management via changeTrust (Freighter's asset UI is unreliable across versions), a server-side faucet pattern with the issuer secret kept server-only, and the reason ed25519-dalek is pinned against a soroban-env-host testutils break (contracts/invoice/Cargo.toml).
  4. Contract CI that builds the real artifact. Every push to contracts/ runs fmt/clippy/tests and uploads the optimized wasm32v1-none WASM as a CI artifact β€” the deployable build is verifiable, not just claimed.

Known limitations are documented, not hidden: the testnet-only faucet (now rate-limited per wallet, though best-effort on serverless), the id-scan activity feed (correct long-term primitive would be the contract events), and the unbounded growth of the per-freelancer history read β€” all in docs/ARCHITECTURE.md and the contract README.

Features

  • Create an invoice on-chain (client, amount, description, optional due date).
  • Preview the invoice before it goes on-chain, and export any invoice as PDF.
  • Share a /pay/<id> link; the client funds it in one wallet click.
  • Instant settlement β€” USDC moves clientβ†’freelancer atomically, marked Paid.
  • Invoice history page with search + status/role filtering and payment reminders (one-click copy-to-send).
  • Freelancer dashboard: invoices, balance, received/pending totals, test-USDC faucet, and an overdue/pending reminders card.
  • Public on-chain activity feed with unique-wallet and settled-volume stats + CSV export.
  • Dark/light mode toggle (dark default) and a first-run onboarding tour.
  • Mocked USDCβ†’Naira off-ramp with a documented SEP-24 path.
  • Monitoring (Sentry) + analytics (Vercel) + in-app feedback collection.
  • Pitch deck live at /pitch.

Deployment

Item Value
Network Stellar Testnet
Invoice contract CAQVSBNVL7OI66IDTYCR7XL4VJKMSOYGBW5D6SWLTWTINTCQO2OGCSXS
Payment token (test USDC SAC) CA3DMMHKAEV555MKWZB5AFXWB6LVZRETYNUO5ZCFGSENQOC7A2FL5HNU
Live app https://pay-loop-neon.vercel.app

Full deployment metadata: contracts/deployment.testnet.json.

Deploy the web app (Vercel)

The app is a standard Next.js project. From web/:

npm install
vercel --prod          # or import the repo in the Vercel dashboard

Set the root directory to web/. The public testnet contract/token addresses are baked in as defaults, so the app works with zero env vars. To enable the faucet, monitoring, or feedback forwarding, set USDC_ISSUER_SECRET, NEXT_PUBLIC_SENTRY_DSN (+ SENTRY_ORG/SENTRY_PROJECT), and FEEDBACK_WEBHOOK_URL in the Vercel project settings. See web/.env.example.

CI/CD

GitHub Actions runs on every push and pull request (.github/workflows/):

Workflow What it does
contract.yml Contract CI β€” cargo fmt --check, clippy, cargo test, and an optimized wasm32v1-none release build (uploaded as an artifact)
web.yml Web CI β€” npm ci, npm run lint, npm run build
deploy.yml CD β€” Vercel production deploy on push to main (via the Vercel CLI when VERCEL_* secrets are set; Vercel's native Git integration otherwise)

Screenshots & demo

The four proof-critical shots:

Dashboard (balance, invoices, faucet, reminders) Payment β€” paid (explorer tx link)
Dashboard Payment paid
On-chain activity (unique-wallet stats, proof of interactions) Create invoice (templates + preview)
Activity Create invoice with templates

The full index (landing, preview, history, feedback, tour, mobile, analytics, monitoring, light theme) is the single canonical list maintained in docs/screenshots/README.md β€” see also docs/GROWTH.md for the full feedback β†’ shipped trace.

Watch the 🎬 demo video for the full create β†’ pay β†’ on-chain loop. The demo-video script, onboarding steps, and how to capture proof of wallet interactions are in DEMO.md. The user-feedback summary (60 responses, avg 5.2/6) is in docs/FEEDBACK.md, collected via a user survey β€” raw responses (Google Sheet).

Submission (Level 5 β€” Blue Belt)

Local development

Prerequisites: Node 20+, Rust + stellar CLI (cargo install --locked stellar-cli).

# Contract
cd contracts/invoice
cargo test                    # run unit tests
stellar contract build        # build the wasm

# Web
cd web
cp .env.example .env.local     # fill in contract + token addresses
npm install
npm run dev

See contracts/DEPLOYMENT.md for the full testnet deploy + token setup steps.

Repository layout

PayLoop/
β”œβ”€β”€ .github/workflows/         CI (contract + web) and CD (Vercel) pipelines
β”œβ”€β”€ contracts/
β”‚   β”œβ”€β”€ invoice/               Soroban invoice/escrow contract (Rust) + tests
β”‚   β”‚   └── README.md          Integrator reference: lifecycle, auth, errors, events, examples
β”‚   β”œβ”€β”€ DEPLOYMENT.md          Testnet deploy + token setup steps
β”‚   └── deployment.testnet.json
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ build-excel.py         Generate docs/survey-responses.xlsx (stdlib only)
β”‚   └── build-pitch.py         Generate the .pptx pitch deck (stdlib only)
β”œβ”€β”€ web/                       Next.js frontend (App Router)
β”‚   β”œβ”€β”€ app/                   routes incl. /history, /pitch, /activity, /api/*
β”‚   β”œβ”€β”€ components/            wallet, theme, tour, invoice document, feedback
β”‚   └── lib/                   config, wallet, contract, format
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ ARCHITECTURE.md        System design
β”‚   β”œβ”€β”€ ANCHOR.md              Mock vs. production off-ramp (SEP-24)
β”‚   β”œβ”€β”€ FEEDBACK.md            User-feedback summary
β”‚   β”œβ”€β”€ GROWTH.md              Feedbackβ†’shipped table + next-phase plan
β”‚   β”œβ”€β”€ USERS.md               60-user proof log
β”‚   β”œβ”€β”€ survey-responses.csv   Google Form CSV export
β”‚   β”œβ”€β”€ survey-responses.xlsx  Generated Excel export (Responses + Summary)
β”‚   β”œβ”€β”€ testnet-traction.csv   On-chain invoice activity snapshot
β”‚   β”œβ”€β”€ pitch/                 PayLoop-Pitch-Deck.pptx
β”‚   └── screenshots/           Submission screenshots
β”œβ”€β”€ CONTRIBUTING.md            How to report bugs and submit PRs
β”œβ”€β”€ AUDIT.md                   Maintainer-criteria audit + remediation trace
β”œβ”€β”€ DEMO.md                    Demo-video + user-onboarding checklist
└── README.md

Roadmap

  • MVP (this): single invoice, shareable pay link, instant release on fund, on-chain history.
  • Next: live USDC↔Naira anchor off-ramp, milestone-based escrow (deposit + final), on-chain reputation score, recurring/retainer invoices, multi-stablecoin, agency batch payouts.

Contributing & license

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages