# hironate/erc404 architecture

> Architecture diagram of the GitHub repository hironate/erc404, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hironate/erc404
- Repository: https://github.com/hironate/erc404

## Overview

##### Interaction Flows

- Token minting/burning flows
- ERC20 <-> ERC721 conversion process
- External contract interactions
- Deployment workflows

##### Component Details

For each major component, include:
- Contract addresses (from publish/addresses)
- Network-specific deployments
- Integration points with external services

**[Infrastructure Layer]**
- ↓
**[Smart Contract Layer]**
- ↓
**[Integration Layer]**

##### Contract Deployment Flow
- Deployment tasks flow
- Verification process
- ABI generation process

##### Configuration Management
- Environment variables handling
- Network-specific configurations

##### Testing Infrastructure
- Mock contracts integration
- Test utilities

##### External Dependencies
- Hardhat tooling
- Blockchain networks
- Uniswap protocols

1. Unique "pathing" mechanism that allows ERC20 and ERC721 functionality to coexist
##### Contract verification and deployment pipeline

- Smart contract components
- External service integrations
- Network connections
- Data flow directions
- Configuration points
- Verification endpoints

Level of Detail:

##### Integration with Uniswap

This structure will provide a clear understanding of how the ERC404 implementation works while maintaining the necessary technical detail for a principal software engineer to understand the system's architecture.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Infrastructure
        ETH[Ethereum Mainnet]
        SEP[Sepolia Testnet]
        POLY[Polygon Network]
        ALCH[Alchemy API]
    end

    subgraph "Smart Contract Layer"
        ERC404[ERC404 Implementation]
        MYERC["MyERC404 Contract"]:::contract
        GRAD["GradientCircle Contract"]:::contract
        ERC404 --> MYERC
        ERC404 --> GRAD
    end

    subgraph "Deployment & Testing"
        TASK_MY["MyERC404 Deployment Task"]:::task
        TASK_GRAD["GradientCircle Deployment Task"]:::task
        MOCK["Mock Contracts"]:::test
        TEST_UTIL["Test Utilities"]:::test
        TEST_DATA["Test Data"]:::test
    end

    subgraph "Configuration & Utilities"
        ENV["Environment Config"]:::config
        NET_CONFIG["Network Configuration"]:::config
        CONST["Constants"]:::util
        IO["I/O Operations"]:::util
    end

    subgraph "Contract Addresses"
        SEP_MY["Sepolia MyERC404 Address"]:::address
        SEP_GRAD["Sepolia GradientCircle Address"]:::address
        POLY_GRAD["Polygon GradientCircle Address"]:::address
    end

    subgraph "External Integration"
        UNI_V2["Uniswap V2"]
        UNI_V3["Uniswap V3"]
    end

    ETH & SEP & POLY --> ALCH
    MYERC & GRAD --> UNI_V2
    MYERC & GRAD --> UNI_V3
    
    TASK_MY --> MYERC
    TASK_GRAD --> GRAD
    
    ENV & NET_CONFIG --> ERC404
    CONST & IO --> ERC404

    classDef contract fill:#a8d1ff
    classDef test fill:#ffd7a8
    classDef config fill:#a8ffd1
    classDef util fill:#ffa8d1
    classDef address fill:#d1a8ff
    classDef task fill:#ffffa8

    click MYERC "https://github.com/hironate/erc404/blob/master/publish/abis/MyERC404.json"
    click GRAD "https://github.com/hironate/erc404/blob/master/publish/abis/GradientCircle.json"
    click TASK_MY "https://github.com/hironate/erc404/blob/master/tasks/my-erc404.js"
    click TASK_GRAD "https://github.com/hironate/erc404/blob/master/tasks/gradient-circle.js"
    click MOCK "https://github.com/hironate/erc404/blob/master/test/MockERC20.js"
    click TEST_UTIL "https://github.com/hironate/erc404/blob/master/test/utils.js"
    click TEST_DATA "https://github.com/hironate/erc404/blob/master/test/data.js"
    click ENV "https://github.com/hironate/erc404/blob/master/.env.example"
    click NET_CONFIG "https://github.com/hironate/erc404/blob/master/hardhat.config.js"
    click CONST "https://github.com/hironate/erc404/blob/master/utils/constants.js"
    click IO "https://github.com/hironate/erc404/blob/master/utils/io.js"
    click SEP_MY "https://github.com/hironate/erc404/blob/master/publish/addresses/sepolia/MyERC404.json"
    click SEP_GRAD "https://github.com/hironate/erc404/blob/master/publish/addresses/sepolia/GradientCircle.json"
    click POLY_GRAD "https://github.com/hironate/erc404/blob/master/publish/addresses/polygon/GradientCircle.json"
```
