Module
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. Each module bundles the Wasm bytecode plus metadata describing its entrypoints.
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 |
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 | |
How is a module stored in the system?¶
ms_block_analysernotices amodule_deployedeffect and publishes amodule_deployedtask.- The New Module Service (
ms_modules) consumes the task, fetches the Wasm bytes via gRPC, parses the export section (usingwasm_decoder), and writes aMongoTypeModuledocument into themodulescollection. - If the module exposes verification metadata, the service invokes the
concordium_clientCLI to runcargo concordium verify-build. Results are stored alongside the module and surfaced in the Explorer UI. - Downstream services map modules to recognized projects;
ms_instancesuses this link whenever a new contract is initialized.***