# safe-global/safe-deployments architecture

> Architecture diagram of the GitHub repository safe-global/safe-deployments, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/safe-global/safe-deployments
- Repository: https://github.com/safe-global/safe-deployments

## Overview

Safe Deployments is a data-and-query library for retrieving Safe contract deployment metadata by version, release status, and network. A consumer calls the package API; contract-specific modules select deployment sets, and shared lookup logic filters and maps the JSON registry into backward-compatible single-address or multi-address results. The README also documents direct use of the JSON assets. The registry-update scripts are excluded because they are maintenance tooling, not runtime product behavior. Some modules are only partially excerpted, so the graph shows only relationships evidenced by the excerpts, index, or README.

Main entry points: [`src/index.ts`](https://github.com/safe-global/safe-deployments/blob/main/src/index.ts) (Package Exports), [`src/deployments.ts`](https://github.com/safe-global/safe-deployments/blob/main/src/deployments.ts) (Deployment Sets), [`src/utils.ts`](https://github.com/safe-global/safe-deployments/blob/main/src/utils.ts) (Filter and Mapping), [`src/safes.ts`](https://github.com/safe-global/safe-deployments/blob/main/src/safes.ts) (Safe Deployments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_entry["Package Exports<br/>[index.ts]"]
end

subgraph group_contracts["Deployment Queries"]
  node_safe["Safe Deployments<br/>[safes.ts]"]
  node_factory["Factory Deployments<br/>[factories.ts]"]
  node_libs["Library Deployments<br/>[libs.ts]"]
  node_handlers["Handler Deployments<br/>[handler.ts]"]
  node_accessors["Accessor Deployments<br/>[accessors.ts]"]
end

subgraph group_registry["Registry Data"]
  node_deployment_sets["Deployment Sets<br/>[deployments.ts]"]
  node_assets["Versioned JSON Assets"]
end

subgraph group_core["Lookup Core"]
  node_lookup["Filter and Mapping<br/>[utils.ts]"]
  node_types["Deployment Types<br/>[types.ts]"]
end

node_consumer(("Library Consumer"))

node_consumer -->|"calls API"| node_entry
node_entry -->|"exports"| node_safe
node_entry -->|"exports"| node_factory
node_entry -->|"exports"| node_libs
node_entry -->|"exports"| node_handlers
node_entry -->|"exports"| node_accessors
node_safe -->|"queries"| node_lookup
node_safe -->|"selects sets"| node_deployment_sets
node_factory -->|"queries"| node_lookup
node_factory -->|"selects set"| node_deployment_sets
node_libs -->|"queries"| node_lookup
node_libs -->|"selects sets"| node_deployment_sets
node_handlers -->|"queries"| node_lookup
node_handlers -->|"selects sets"| node_deployment_sets
node_accessors -->|"queries"| node_lookup
node_accessors -->|"selects set"| node_deployment_sets
node_deployment_sets -->|"imports registry"| node_assets
node_lookup -->|"uses formats"| node_types
node_consumer -->|"reads directly"| node_assets

click node_entry "https://github.com/safe-global/safe-deployments/blob/main/src/index.ts"
click node_safe "https://github.com/safe-global/safe-deployments/blob/main/src/safes.ts"
click node_factory "https://github.com/safe-global/safe-deployments/blob/main/src/factories.ts"
click node_libs "https://github.com/safe-global/safe-deployments/blob/main/src/libs.ts"
click node_handlers "https://github.com/safe-global/safe-deployments/blob/main/src/handler.ts"
click node_accessors "https://github.com/safe-global/safe-deployments/blob/main/src/accessors.ts"
click node_deployment_sets "https://github.com/safe-global/safe-deployments/blob/main/src/deployments.ts"
click node_assets "https://github.com/safe-global/safe-deployments/tree/main/src/assets"
click node_lookup "https://github.com/safe-global/safe-deployments/blob/main/src/utils.ts"
click node_types "https://github.com/safe-global/safe-deployments/blob/main/src/types.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_entry toneBlue
class node_safe,node_factory,node_libs,node_handlers,node_accessors toneAmber
class node_deployment_sets,node_assets toneMint
class node_lookup,node_types toneRose
class node_consumer toneIndigo
```

## Components

### Public API

- [Package Exports](https://github.com/safe-global/safe-deployments/blob/main/src/index.ts): `src/index.ts`

### Deployment Queries

- [Safe Deployments](https://github.com/safe-global/safe-deployments/blob/main/src/safes.ts): `src/safes.ts`
- [Factory Deployments](https://github.com/safe-global/safe-deployments/blob/main/src/factories.ts): `src/factories.ts`
- [Library Deployments](https://github.com/safe-global/safe-deployments/blob/main/src/libs.ts): `src/libs.ts`
- [Handler Deployments](https://github.com/safe-global/safe-deployments/blob/main/src/handler.ts): `src/handler.ts`
- [Accessor Deployments](https://github.com/safe-global/safe-deployments/blob/main/src/accessors.ts): `src/accessors.ts`

### Registry Data

- [Deployment Sets](https://github.com/safe-global/safe-deployments/blob/main/src/deployments.ts): `src/deployments.ts`
- [Versioned JSON Assets](https://github.com/safe-global/safe-deployments/tree/main/src/assets): `src/assets`

### Lookup Core

- [Filter and Mapping](https://github.com/safe-global/safe-deployments/blob/main/src/utils.ts): `src/utils.ts`
- [Deployment Types](https://github.com/safe-global/safe-deployments/blob/main/src/types.ts): `src/types.ts`

### Other components

- **Library Consumer**

## Connections

- Library Consumer → Package Exports: calls API (evidence: `README.md`)
- Package Exports → Safe Deployments: exports (evidence: `src/index.ts`)
- Package Exports → Factory Deployments: exports (evidence: `src/index.ts`)
- Package Exports → Library Deployments: exports (evidence: `src/index.ts`)
- Package Exports → Handler Deployments: exports (evidence: `src/index.ts`)
- Package Exports → Accessor Deployments: exports (evidence: `src/index.ts`)
- Safe Deployments → Filter and Mapping: queries (evidence: `src/safes.ts`)
- Safe Deployments → Deployment Sets: selects sets (evidence: `src/safes.ts`)
- Factory Deployments → Filter and Mapping: queries (evidence: `src/factories.ts`)
- Factory Deployments → Deployment Sets: selects set (evidence: `src/factories.ts`)
- Library Deployments → Filter and Mapping: queries (evidence: `src/libs.ts`)
- Library Deployments → Deployment Sets: selects sets (evidence: `src/libs.ts`)
- Handler Deployments → Filter and Mapping: queries (evidence: `src/handler.ts`)
- Handler Deployments → Deployment Sets: selects sets (evidence: `src/handler.ts`)
- Accessor Deployments → Filter and Mapping: queries (evidence: `src/accessors.ts`)
- Accessor Deployments → Deployment Sets: selects set (evidence: `src/accessors.ts`)
- Deployment Sets → Versioned JSON Assets: imports registry (evidence: `src/deployments.ts`)
- Filter and Mapping → Deployment Types: uses formats (evidence: `src/utils.ts`)
- Library Consumer → Versioned JSON Assets: reads directly (evidence: `README.md`)
