# prtk-codes/hack25-micromint architecture

> Architecture diagram of the GitHub repository prtk-codes/hack25-micromint, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prtk-codes/hack25-micromint
- Repository: https://github.com/prtk-codes/hack25-micromint

## Overview

Micromint is an Arbitrum Orbit L3 micropayment product: users connect a wallet and can deposit MicroUSD into PaymentHub; merchants can view earnings and withdraw on L3. The contracts also support micropayments, while the frontend’s payment hook exposes a pay call that the sampled PayCard does not invoke. Major documented capabilities include the MicroUSD token and optional L3-to-L2 settlement. Contract internals and bridge implementation were not sampled, so those relationships are limited to README-supported claims.

Main entry points: [`frontend/src/hooks/useMicroUSD.ts`](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/hooks/useMicroUSD.ts) (Token operations), [`frontend/src/hooks/usePaymentHub.ts`](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/hooks/usePaymentHub.ts) (Hub operations), [`frontend/src/App.tsx`](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/App.tsx) (App shell), [`frontend/src/components/PayCard.tsx`](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/components/PayCard.tsx) (User payment card)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_app["App shell<br/>[App.tsx]"]
  node_walletui["Wallet connect<br/>[WalletConnect.tsx]"]
  node_paycard["User payment card<br/>[PayCard.tsx]"]
  node_dashboard["Merchant dashboard"]
  node_tokenhook["Token operations<br/>[useMicroUSD.ts]"]
  node_hubhook["Hub operations<br/>[usePaymentHub.ts]"]
  node_tokenabi["Token ABI<br/>[microUsdAbi.ts]"]
  node_hubabi["Hub ABI<br/>[paymentHubAbi.ts]"]
  node_chainconfig["Chain configuration<br/>[config.ts]"]
  node_wagmi["Wallet provider config<br/>[wagmi.ts]"]
  node_entry["Frontend entry<br/>[main.tsx]"]
end

subgraph group_contracts["Payment contracts"]
  node_micro["MicroUSD token<br/>[MicroUSD.sol]"]
  node_paymenthub["PaymentHub<br/>[PaymentHub.sol]"]
  node_hubinterface["PaymentHub interface<br/>[IPaymentHub.sol]"]
end

subgraph group_integration["Chain integration"]
end

node_user(("User"))
node_merchant(("Merchant"))
node_wallet(("Browser wallet"))
node_l3{{"Micromint L3"}}
node_l2{{"Arbitrum L2"}}

node_user -->|"connects"| node_walletui
node_walletui -->|"connects"| node_wallet
node_entry -->|"renders"| node_app
node_app -->|"renders"| node_walletui
node_app -->|"renders"| node_paycard
node_app -->|"renders"| node_dashboard
node_paycard -->|"reads balance"| node_tokenhook
node_paycard -->|"reads balance"| node_hubhook
node_paycard -->|"deposits via"| node_tokenhook
node_dashboard -->|"withdraws via"| node_hubhook
node_tokenhook -->|"uses"| node_tokenabi
node_tokenhook -->|"uses"| node_hubabi
node_hubhook -->|"uses"| node_hubabi
node_tokenhook -->|"uses addresses"| node_chainconfig
node_hubhook -->|"uses addresses"| node_chainconfig
node_wagmi -->|"configures chain"| node_chainconfig
node_entry -->|"provides config"| node_wagmi
node_tokenhook -.->|"reads and writes"| node_l3
node_hubhook -.->|"reads and writes"| node_l3
node_l3 -.->|"hosts token"| node_micro
node_l3 -.->|"hosts payments"| node_paymenthub
node_paymenthub -.->|"uses token"| node_micro
node_paymenthub -.->|"optional settlement"| node_l2

click node_app "https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/App.tsx"
click node_walletui "https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/components/WalletConnect.tsx"
click node_paycard "https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/components/PayCard.tsx"
click node_dashboard "https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/components/MerchantDashboard.tsx"
click node_tokenhook "https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/hooks/useMicroUSD.ts"
click node_hubhook "https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/hooks/usePaymentHub.ts"
click node_tokenabi "https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/lib/abi/microUsdAbi.ts"
click node_hubabi "https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/lib/abi/paymentHubAbi.ts"
click node_chainconfig "https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/lib/config.ts"
click node_wagmi "https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/lib/wagmi.ts"
click node_entry "https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/main.tsx"
click node_micro "https://github.com/prtk-codes/hack25-micromint/blob/master/contracts/tokens/MicroUSD.sol"
click node_paymenthub "https://github.com/prtk-codes/hack25-micromint/blob/master/contracts/core/PaymentHub.sol"
click node_hubinterface "https://github.com/prtk-codes/hack25-micromint/blob/master/contracts/interfaces/IPaymentHub.sol"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_walletui,node_paycard,node_dashboard,node_tokenhook,node_hubhook,node_tokenabi,node_hubabi,node_chainconfig,node_wagmi,node_entry,node_user,node_wallet toneBlue
class node_micro,node_paymenthub,node_hubinterface toneAmber
class node_merchant,node_l3,node_l2 toneIndigo
```

## Components

### Frontend

- [App shell](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Wallet connect](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/components/WalletConnect.tsx): `frontend/src/components/WalletConnect.tsx`
- [User payment card](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/components/PayCard.tsx): `frontend/src/components/PayCard.tsx`
- [Merchant dashboard](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/components/MerchantDashboard.tsx): `frontend/src/components/MerchantDashboard.tsx`
- [Token operations](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/hooks/useMicroUSD.ts): `frontend/src/hooks/useMicroUSD.ts`
- [Hub operations](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/hooks/usePaymentHub.ts): `frontend/src/hooks/usePaymentHub.ts`
- [Token ABI](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/lib/abi/microUsdAbi.ts): `frontend/src/lib/abi/microUsdAbi.ts`
- [Hub ABI](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/lib/abi/paymentHubAbi.ts): `frontend/src/lib/abi/paymentHubAbi.ts`
- [Chain configuration](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/lib/config.ts): `frontend/src/lib/config.ts`
- [Wallet provider config](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/lib/wagmi.ts): `frontend/src/lib/wagmi.ts`
- [Frontend entry](https://github.com/prtk-codes/hack25-micromint/blob/master/frontend/src/main.tsx): `frontend/src/main.tsx`

### Payment contracts

- [MicroUSD token](https://github.com/prtk-codes/hack25-micromint/blob/master/contracts/tokens/MicroUSD.sol): `contracts/tokens/MicroUSD.sol`
- [PaymentHub](https://github.com/prtk-codes/hack25-micromint/blob/master/contracts/core/PaymentHub.sol): `contracts/core/PaymentHub.sol`
- [PaymentHub interface](https://github.com/prtk-codes/hack25-micromint/blob/master/contracts/interfaces/IPaymentHub.sol): `contracts/interfaces/IPaymentHub.sol`

### Other components

- **User**
- **Merchant**
- **Browser wallet**
- **Micromint L3**
- **Arbitrum L2**

## Connections

- User → Wallet connect: connects (evidence: `frontend/src/components/WalletConnect.tsx`)
- Wallet connect → Browser wallet: connects
- Frontend entry → App shell: renders (evidence: `frontend/src/main.tsx`)
- App shell → Wallet connect: renders (evidence: `frontend/src/App.tsx`)
- App shell → User payment card: renders (evidence: `frontend/src/App.tsx`)
- App shell → Merchant dashboard: renders (evidence: `frontend/src/App.tsx`)
- User payment card → Token operations: reads balance (evidence: `frontend/src/components/PayCard.tsx`)
- User payment card → Hub operations: reads balance (evidence: `frontend/src/components/PayCard.tsx`)
- User payment card → Token operations: deposits via (evidence: `frontend/src/components/PayCard.tsx`)
- Merchant dashboard → Hub operations: withdraws via (evidence: `frontend/src/components/MerchantDashboard.tsx`)
- Token operations → Token ABI: uses (evidence: `frontend/src/hooks/useMicroUSD.ts`)
- Token operations → Hub ABI: uses (evidence: `frontend/src/hooks/useMicroUSD.ts`)
- Hub operations → Hub ABI: uses (evidence: `frontend/src/hooks/usePaymentHub.ts`)
- Token operations → Chain configuration: uses addresses (evidence: `frontend/src/hooks/useMicroUSD.ts`)
- Hub operations → Chain configuration: uses addresses (evidence: `frontend/src/hooks/usePaymentHub.ts`)
- Wallet provider config → Chain configuration: configures chain (evidence: `frontend/src/lib/wagmi.ts`)
- Frontend entry → Wallet provider config: provides config (evidence: `frontend/src/main.tsx`)
- Token operations → Micromint L3: reads and writes
- Hub operations → Micromint L3: reads and writes
- Micromint L3 → MicroUSD token: hosts token
- Micromint L3 → PaymentHub: hosts payments
- PaymentHub → MicroUSD token: uses token (evidence: `README.md`)
- PaymentHub → Arbitrum L2: optional settlement (evidence: `README.md`)
