Skip to content

Module

Modules

Modules are the starting point for all contracts and tokens on the blockchain. Modules can be deployed through an Account Transaction with effect module_deployed.

Modules are stored in the collection modules in the db and have the following class:

MongoTypeModule represents a module stored in the modules collection.

Attributes:

Name Type Description
id str

The hex string identifier for the module, stored as _id in the database.

module_name str

The name of the module.

methods Optional[list[str]]

A list of method names associated with the module.

contracts Optional[list[str]]

A list of contract instances from this module.

init_date Optional[datetime]

The initialization date of the module.

verification Optional[ModuleVerification]

The verification details of the module.

Source code in .venv/lib/python3.13/site-packages/ccdexplorer/domain/mongo.py
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
class MongoTypeModule(BaseModel):
    """
    MongoTypeModule represents a module stored in the `modules` collection.

    Attributes:
        id (str): The hex string identifier for the module, stored as `_id` in the database.
        module_name (str): The name of the module.
        methods (Optional[list[str]]): A list of method names associated with the module.
        contracts (Optional[list[str]]): A list of contract instances from this module.
        init_date (Optional[dt.datetime]): The initialization date of the module.
        verification (Optional[ModuleVerification]): The verification details of the module.
    """

    id: str = Field(..., alias="_id")
    module_name: Optional[str] = None
    methods: Optional[list[str]] = None
    contracts: Optional[list[str]] = None
    init_date: Optional[dt.datetime] = None
    verification: Optional[ModuleVerification] = None

How is a module stored in the system?

This is performed in the New Module Service, that works on receiving the appropriate MQTT message. When this service runs, it stores the module data in the corresponding collection, and also starts the module verification process.