The Model contract manages the registration and lifecycle of machine learning models within the system. It handles operations such as enabling/disabling models, updating staking requirements, and associating staking pools with models.
Key Features
Model Registration and Management:
Supports registering new models with metadata and staking requirements.
Allows enabling or disabling of registered models.
Stake Requirement Management:
Admins can update the required staking amount for models.
Integration with Staking Pools:
Models are associated with staking pools for FUNC token staking.
Access Control:
Role-based access control for secure management.
Roles
Access Control
The contract uses AccessControl to secure critical functions.
DEFAULT_ADMIN_ROLE:
Full control over all administrative functions.
MODEL_CREATOR_ROLE:
Grants permission to create new models.
State Variables
router:
Reference to the Router contract for system-wide functionalities.
modelIdExists:
Mapping of model IDs to their existence status.
existingModels:
Mapping of model IDs to their corresponding ModelInfo struct.
modelIds:
Array of all registered model IDs.
Key Functions
Constructor
constructor(IRouter _router)
Initializes the contract and assigns the deployer the DEFAULT_ADMIN_ROLE.