# machinalabs/remix-etherscan-plugin architecture

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

- Interactive diagram: https://gitdiagram.com/machinalabs/remix-etherscan-plugin
- Repository: https://github.com/machinalabs/remix-etherscan-plugin

## Overview

Remix Etherscan Plugin is a Remix UI for submitting Solidity contract verification requests to Etherscan and checking their receipt status. The principal flow is: Remix provides compilation data, the user submits contract details, the plugin selects the network and sends the verification request, then records and polls the returned receipt. Settings capture the API key; the receipts view also supports manual status checks. Source excerpts show the app shell, routing, verification and status helpers; some view wiring is only evidenced by the source index.

Main entry points: [`src/App.tsx`](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/App.tsx) (Plugin app), [`src/routes.tsx`](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/routes.tsx) (Route dispatch), [`src/views/VerifyView.tsx`](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/views/VerifyView.tsx) (Contract verification), [`src/utils/utilities.ts`](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/utils/utilities.ts) (Network and status helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Plugin and app shell"]
  node_app["Plugin app<br/>[App.tsx]"]
  node_routes["Route dispatch<br/>[routes.tsx]"]
  node_layout["Default layout<br/>[Default.tsx]"]
  node_header["Navigation header"]
end

subgraph group_views["User workflows"]
  node_home["Verification home<br/>[HomeView.tsx]"]
  node_verify["Contract verification<br/>[VerifyView.tsx]"]
  node_settings["API key settings<br/>[CaptureKeyView.tsx]"]
  node_receipts["Receipt status<br/>[ReceiptsView.tsx]"]
  node_error["Error view<br/>[ErrorView.tsx]"]
  node_submit["Submit control<br/>[SubmitButton.tsx]"]
end

subgraph group_services["Verification services"]
  node_utils["Network and status helpers<br/>[utilities.ts]"]
end

subgraph group_state["Shared state"]
  node_context["App context<br/>[AppContext.tsx]"]
  node_storagehook["Persistent state hook"]
  node_receiptmodel["Receipt model<br/>[Receipt.ts]"]
end

node_user(("Plugin user"))
node_remix["Remix IDE"]
node_etherscan["Etherscan API"]
node_browserstore[("Browser storage")]

node_user -->|"uses plugin"| node_app
node_remix -->|"sends compilation events"| node_app
node_app -->|"renders"| node_routes
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_error
node_routes -->|"routes to"| node_receipts
node_routes -->|"routes to"| node_settings
node_routes -->|"wraps views"| node_layout
node_layout -->|"renders"| node_header
node_home -->|"uses view"| node_verify
node_verify -->|"gets network and status"| node_utils
node_verify -->|"renders"| node_submit
node_verify -->|"requests compilation and emits status"| node_remix
node_verify -->|"posts verification"| node_etherscan
node_receipts -->|"checks receipt status"| node_utils
node_receipts -->|"renders"| node_submit
node_utils -->|"detects network"| node_remix
node_utils -->|"queries status"| node_etherscan
node_app -->|"polls receipt status"| node_utils
node_app -->|"provides shared state"| node_context
node_app -->|"persists API key and receipts"| node_storagehook
node_storagehook -->|"reads and writes"| node_browserstore
node_app -->|"uses receipt records"| node_receiptmodel
node_user -.->|"configures key"| node_settings
node_user -->|"checks receipts"| node_receipts

click node_app "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/App.tsx"
click node_routes "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/routes.tsx"
click node_layout "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/layouts/Default.tsx"
click node_header "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/components/HeaderWithSettings.tsx"
click node_home "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/views/HomeView.tsx"
click node_verify "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/views/VerifyView.tsx"
click node_settings "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/views/CaptureKeyView.tsx"
click node_receipts "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/views/ReceiptsView.tsx"
click node_error "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/views/ErrorView.tsx"
click node_utils "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/utils/utilities.ts"
click node_submit "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/components/SubmitButton.tsx"
click node_context "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/AppContext.tsx"
click node_storagehook "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/hooks/useLocalStorage.tsx"
click node_receiptmodel "https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/types/Receipt.ts"

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_routes,node_layout,node_header,node_user toneBlue
class node_home,node_verify,node_settings,node_receipts,node_error,node_submit,node_browserstore toneAmber
class node_utils,node_etherscan toneMint
class node_context,node_storagehook,node_receiptmodel toneRose
class node_remix toneIndigo
```

## Components

### Plugin and app shell

- [Plugin app](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/App.tsx): `src/App.tsx`
- [Route dispatch](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/routes.tsx): `src/routes.tsx`
- [Default layout](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/layouts/Default.tsx): `src/layouts/Default.tsx`
- [Navigation header](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/components/HeaderWithSettings.tsx): `src/components/HeaderWithSettings.tsx`

### User workflows

- [Verification home](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/views/HomeView.tsx): `src/views/HomeView.tsx`
- [Contract verification](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/views/VerifyView.tsx): `src/views/VerifyView.tsx`
- [API key settings](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/views/CaptureKeyView.tsx): `src/views/CaptureKeyView.tsx`
- [Receipt status](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/views/ReceiptsView.tsx): `src/views/ReceiptsView.tsx`
- [Error view](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/views/ErrorView.tsx): `src/views/ErrorView.tsx`
- [Submit control](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/components/SubmitButton.tsx): `src/components/SubmitButton.tsx`

### Verification services

- [Network and status helpers](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/utils/utilities.ts): `src/utils/utilities.ts`

### Shared state

- [App context](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/AppContext.tsx): `src/AppContext.tsx`
- [Persistent state hook](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/hooks/useLocalStorage.tsx): `src/hooks/useLocalStorage.tsx`
- [Receipt model](https://github.com/machinalabs/remix-etherscan-plugin/blob/master/src/types/Receipt.ts): `src/types/Receipt.ts`

### Other components

- **Plugin user**
- **Remix IDE**
- **Etherscan API**
- **Browser storage**

## Connections

- Plugin user → Plugin app: uses plugin (evidence: `README.md`)
- Remix IDE → Plugin app: sends compilation events (evidence: `src/App.tsx`)
- Plugin app → Route dispatch: renders (evidence: `src/App.tsx`)
- Route dispatch → Verification home: routes to (evidence: `src/routes.tsx`)
- Route dispatch → Error view: routes to (evidence: `src/routes.tsx`)
- Route dispatch → Receipt status: routes to (evidence: `src/routes.tsx`)
- Route dispatch → API key settings: routes to (evidence: `src/routes.tsx`)
- Route dispatch → Default layout: wraps views (evidence: `src/routes.tsx`)
- Default layout → Navigation header: renders (evidence: `src/layouts/Default.tsx`)
- Verification home → Contract verification: uses view (evidence: `src/views/HomeView.tsx`)
- Contract verification → Network and status helpers: gets network and status (evidence: `src/views/VerifyView.tsx`)
- Contract verification → Submit control: renders (evidence: `src/views/VerifyView.tsx`)
- Contract verification → Remix IDE: requests compilation and emits status (evidence: `src/views/VerifyView.tsx`)
- Contract verification → Etherscan API: posts verification (evidence: `src/views/VerifyView.tsx`)
- Receipt status → Network and status helpers: checks receipt status (evidence: `src/views/ReceiptsView.tsx`)
- Receipt status → Submit control: renders (evidence: `src/views/ReceiptsView.tsx`)
- Network and status helpers → Remix IDE: detects network (evidence: `src/utils/utilities.ts`)
- Network and status helpers → Etherscan API: queries status (evidence: `src/utils/utilities.ts`)
- Plugin app → Network and status helpers: polls receipt status (evidence: `src/App.tsx`)
- Plugin app → App context: provides shared state (evidence: `src/App.tsx`)
- Plugin app → Persistent state hook: persists API key and receipts (evidence: `src/App.tsx`)
- Persistent state hook → Browser storage: reads and writes (evidence: `src/hooks/useLocalStorage.tsx`)
- Plugin app → Receipt model: uses receipt records (evidence: `src/App.tsx`)
- Plugin user → API key settings: configures key
- Plugin user → Receipt status: checks receipts
