Skip to main contentA-REX Core

Diagramas · 01

Arquitectura: niveles y capas

Los dos niveles del repositorio, las cuatro capas del estándar y el sentido de cada dependencia.

Niveles

Las cuatro capas del estándar

flowchart TB
    L3["Capa 3 · IARexAttest<br/>attest · revokeAttestation · isAttested · emisores de confianza por tema"]
    L2["Capa 2 · IARexHook + IARexHookManager<br/>hookFlags · check → bytes32 · onExecuted · getHooks"]
    L1["Capa 1 · IARexBatch<br/>createBatch · batchOf · setBatchStatus · setBatchMetadata · transform · parentsOf"]
    L0["Capa 0 · ERC-1155 + ERC-165 + IERC7943MultiToken<br/>freeze · forcedTransfer · canSend · canReceive · canTransfer"]
    L3 --- L2 --- L1 --- L0
    classDef l3 fill:#edf5ff,stroke:#0f62fe,color:#161616
    classDef l2 fill:#d0e2ff,stroke:#0f62fe,color:#161616
    classDef l1 fill:#a6c8ff,stroke:#0f62fe,color:#161616
    classDef l0 fill:#78a9ff,stroke:#0043ce,color:#161616
    class L3 l3
    class L2 l2
    class L1 l1
    class L0 l0

Los dos niveles del repositorio y el sentido de la dependencia

flowchart LR
    STD["<b>El estándar</b><br/>standard/ · contracts/standard/<br/>normativo · CC0"]
    REF["<b>Implementación de referencia</b><br/>ARexToken · ARexAttestations<br/>MIT"]
    DEMO["<b>Demostraciones</b><br/>7 hooks · 3 extensiones<br/>MIT · no normativo"]
    STD -->|implementado por| REF -->|demostrado por| DEMO
    DEMO -.->|dependen solo de las interfaces| STD

El estándar no depende de nada. El token de referencia depende del estándar y de OpenZeppelin. Los hooks y las extensiones dependen únicamente de las interfaces del estándar, nunca de ARexToken: si se eliminan todos ellos, permanece un token conforme.

Vista de componentes de la implementación de referencia

classDiagram
    class IARexBatch { <<interface>> }
    class IARexHook { <<interface>> }
    class IARexHookManager { <<interface>> }
    class IARexAttest { <<interface>> }
    class IERC7943MultiToken { <<interface>> }
    class ARexToken {
        +createBatch()
        +transform()
        +setBatchStatus()
        +forcedTransfer()
        +setFrozenTokens()
        +registerHook()
        +transferCheck()
        -_update()
    }
    class ARexAttestations {
        +attest()
        +revokeAttestation()
        +isAttested()
        +setTrustedIssuer()
    }
    IERC7943MultiToken <|.. ARexToken
    IARexBatch <|.. ARexToken
    IARexHookManager <|.. ARexToken
    IARexAttest <|.. ARexAttestations
    ARexToken --> "0..n" IARexHook : canalización ordenada
    ARexAttestations --> IARexBatch : ¿existe el lote?
    IARexHook <|.. EligibilityHook
    IARexHook <|.. ExpiryHook
    IARexHook <|.. AttestationHook
    IARexHook <|.. PerishabilityHook
    IARexHook <|.. SeasonalHook
    IARexHook <|.. DeliveryHook
    IARexHook <|.. TraceabilityHook
    AttestationHook --> IARexAttest : isAttested
    CarbonImmobilizationWrapper --> IARexAttest : attest
    ParametricInsurance --> IARexAttest : isAttested