# aviatorac/skybridge-public architecture

> Architecture diagram of the GitHub repository aviatorac/skybridge-public, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aviatorac/skybridge-public
- Repository: https://github.com/aviatorac/skybridge-public

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Layer Structure
- L1 (Layer 1) Components
- L2 (Layer 2) Components
- Universal Components
- Bridge Infrastructure

b) Core Components
- Liquidity Pool
- Bridge Contracts
- Mintable Tokens
- Administrative Systems

**┌─────────────────────┐     ┌─────────────────────┐**
- Layer 1 (L1)     │ ←→  │    Layer 2 (L2)     │
- ┘     └─────────────────────┘
- ↑                           ↑

- ┬───────────────┘
- ↓
- ┌─────────────────────┐
- Universal Components│
- ┘

##### Interaction Flows

Critical flows:
- Token Bridging Process
- Liquidity Management
- Administrative Operations
- Finalization Processes

##### Technical Specifications

Technical details:
- Smart Contract Interactions
- External Dependencies
- Factory Pattern Implementation
- Library Utilization

##### Testing Integration

How test components interact:
- Test Scenarios (from test/L1, test/L2)
- Setup Configuration (from test/__setup__)
- Universal Test Cases (from test/universal)

##### Implementation Notes

Callouts for:
- Known issues (as listed in README)
- Potential bottlenecks
- Security considerations
- Upgrade paths

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef l1 fill:#a8d1ff,stroke:#333,stroke-width:1px
    classDef l2 fill:#90EE90,stroke:#333,stroke-width:1px
    classDef universal fill:#DDA0DD,stroke:#333,stroke-width:1px
    classDef admin fill:#FFB6C6,stroke:#333,stroke-width:1px
    classDef liquidity fill:#FFB347,stroke:#333,stroke-width:1px
    classDef testing fill:#E6E6FA,stroke:#333,stroke-width:1px
    classDef infrastructure fill:#F0F8FF,stroke:#333,stroke-width:1px

    subgraph Layer1["Layer 1 Components"]
        L1C["L1 Contracts"]:::l1
        L1B["Bridge Contracts"]:::l1
        L1T["Token Management"]:::l1
        L1A["Admin Controls"]:::admin
    end

    subgraph Layer2["Layer 2 Components"]
        L2C["L2 Contracts"]:::l2
        L2B["Bridge Contracts"]:::l2
        L2T["Token Management"]:::l2
        L2A["Admin Controls"]:::admin
    end

    subgraph Universal["Universal Components"]
        UC["Core Components"]:::universal
        LP["Liquidity Pool"]:::liquidity
        MS["Message System"]:::universal
    end

    subgraph Infrastructure["Bridge Infrastructure"]
        LIB["Libraries"]:::infrastructure
        FAC["Factories"]:::infrastructure
        DEP["External Dependencies"]:::infrastructure
    end

    subgraph Testing["Testing Framework"]
        TL1["L1 Tests"]:::testing
        TL2["L2 Tests"]:::testing
        TU["Universal Tests"]:::testing
        TS["Test Setup"]:::testing
    end

    %% Relationships
    L1C --> L1B
    L1B --> L1T
    L1B --> L1A
    L2C --> L2B
    L2B --> L2T
    L2B --> L2A
    
    L1B <--> MS
    L2B <--> MS
    
    MS --> LP
    LP --> L1T
    LP --> L2T
    
    UC --> L1B
    UC --> L2B
    
    LIB --> L1C
    LIB --> L2C
    FAC --> L1T
    FAC --> L2T
    
    TL1 --> L1C
    TL2 --> L2C
    TU --> UC
    TS --> TL1
    TS --> TL2
    TS --> TU
    
    DEP --> LIB

    %% Click Events
    click L1C "https://github.com/AviatorAC/skybridge-public/tree/main/src/L1"
    click L2C "https://github.com/AviatorAC/skybridge-public/tree/main/src/L2"
    click UC "https://github.com/AviatorAC/skybridge-public/tree/main/src/universal"
    click LIB "https://github.com/AviatorAC/skybridge-public/tree/main/src/libraries"
    click FAC "https://github.com/AviatorAC/skybridge-public/tree/main/src/factories"
    click TL1 "https://github.com/AviatorAC/skybridge-public/tree/main/test/L1"
    click TL2 "https://github.com/AviatorAC/skybridge-public/tree/main/test/L2"
    click TU "https://github.com/AviatorAC/skybridge-public/tree/main/test/universal"
    click TS "https://github.com/AviatorAC/skybridge-public/tree/main/test/__setup__"
    click DEP "https://github.com/AviatorAC/skybridge-public/tree/main/lib/forge-std"

    %% Legend
    subgraph Legend
        L1["Layer 1"]:::l1
        L2["Layer 2"]:::l2
        U["Universal"]:::universal
        A["Admin"]:::admin
        LQ["Liquidity"]:::liquidity
        T["Testing"]:::testing
        I["Infrastructure"]:::infrastructure
    end
```
