SetloDocs

Architecture

System overview

The contract holds the money and decides. Everything else is convenience.

Components

Agency / Client / Supplier (browser)
        │  email sign-in, EIP-712 signatures
        ▼
Next.js app on Vercel ── Privy (email login, embedded wallets)
        │            ├── Supabase (drafts, invites, profiles, terms text, tx log)
        │            └── Gmail SMTP (invites, setup links, payout notices)
        ▼
Relayer route (server key, pays gas)
        │  QuickNode RPC
        ▼
SetloPackages contract ── Paxos USDG (permit, transfers)
        │
        └── events ─▶ QuickNode Webhooks ─▶ /api/webhooks/quicknode ─▶ claimFor + payout emails

Who owns what

ComponentOwnsDoes not own
SetloPackages contractPackage state, funds custody, acceptance rules, credits and claimsIdentity, emails, terms text
Next.js appScreens for each role, signing, reading live state from the chainBalances or statuses as truth
RelayerSubmitting signed actions and permissionless calls, paying gasAny decision: it can only submit what users signed or what anyone may call
PrivyEmail login, embedded wallets, signingFunds rules
SupabaseDrafts, invites, profiles, terms text, package versions, tx log, processed eventsMoney: balances and statuses are always read from the contract
QuickNodeRPC reads/writes and contract event deliveryCorrectness: events are deduplicated and re-checked onchain