Skip to content

Metadata Manager

Rahul Saxena edited this page Aug 11, 2023 · 4 revisions

File: MetadataManager.sol

Things to know

  1. This module is used to manage(set and get) the metadata of three different entities:
  • Manager
  • Orchestrator
  • Member
  1. The metadata is additional information about these entities used for initialization or for other auxiliary functionalities.
  2. The metadata are defined as following:
  • struct ManagerMetadata {
        string name;
        address account;
        string twitterHandle;
    }
  • struct OrchestratorMetadata {
        string title;
        string descriptionShort;
        string descriptionLong;
        string[] externalMedias;
        string[] categories;
    }
  • struct MemberMetadata {
        string name;
        address account;
        string url;
    }

View Function(s)

1. getManagerMetadata

function getManagerMetadata()
        external
        view
        returns (ManagerMetadata memory)

Returns the metadata of the manager in the form of struct ManagerMetadata.

Return Data

  1. ManagerMetadata: The metadata of the manager in the form of struct ManagerMetadata

2. getOrchestratorMetadata

function getOrchestratorMetadata()
        external
        view
        returns (OrchestratorMetadata memory)

Returns the metadata of the orchestrator in the form of struct OrchestratorMetadata.

Return Data

  1. OrchestratorMetadata: The metadata of the orchestrator in the form of struct OrchestratorMetadata

3. getTeamMetadata

function getTeamMetadata()
        external
        view
        returns (MemberMetadata[] memory)

Returns an array of the metadata of the members involved in the project, each in the form of struct MemberMetadata.

Return Data:

  1. MemberMetadata[]: Array of the metadata of the members involved in the project, each in the form of struct MemberMetadata.

Write Function(s)

1. init

function init(
        IOrchestrator orchestrator_,
        Metadata memory metadata,
        bytes memory configData
    ) external override(Module) initializer

Initializes the MetadataManager module itself and then sets the initial values for the manager, orchestrator, and team metadata, that is decoded from the configData.

Parameters

  1. IOrchestrator orchestrator_: The Orchestrator instance on which the Metadata Manager will operate.
  2. Metadata metadata: Metadata for the Metadata Manager
  3. bytes configData: Additional data for the initialization of other things in the module

2. setManagerMetadata

function setManagerMetadata(ManagerMetadata calldata managerMetadata_)
        external

Sets the manager metadata.

Parameters

  1. ManagerMetadata managerMetadata_: New value of the Manager Metadata

3. setOrchestratorMetadata

function setOrchestratorMetadata(
        OrchestratorMetadata calldata orchestratorMetadata_
    ) public

Sets the orchestrator metadata

Parameters:

  1. OrchestratorMetadata orchestratorMetadata_: New value of the Orchestrator Metadata

4. setTeamMetadata

function setTeamMetadata(MemberMetadata[] calldata teamMetadata_)
        external

Sets the team metadata.

Parameters:

  1. MemberMetadata[] teamMetadata_: New value of the Team metadata.