safe-global / safe-decoder-service

Decodes transaction data providing a human readable output
MIT License
2 stars 0 forks source link

Define a database model #3

Closed Uxio0 closed 6 days ago

Uxio0 commented 2 weeks ago

We must define the tables required to hold the data

moisses89 commented 1 week ago

Proposed model:

erDiagram
    ABI ||--o{ CONTRACT : "has"
    CHAIN ||--o{ CONTRACT : "has"
    PROJECT ||--o{ CONTRACT  : "has"
    SOURCE ||--o{ ABI  : "has"
    ABI {
        int id PK
        string description
        int relevance
        string abi_hash
        json abi
        int source_id FK
    }
    CONTRACT {
        string address PK
        int chain_id PK, FK
        int contract_abi FK
        int project_id FK
        string name
        string display_name
        boolean trusted_for_delegate
        boolean proxy
        int fetch_retries
    }
    CHAIN {
        int id PK
        string name
    }
    PROJECT {
            int id PK
            string description
            string logo_file
    }
    SOURCE {
            int id PK
            string name
            string url
    }