{
    "Function": "slitherConstructorVariables",
    "File": "registries/contracts/AgentRegistry.sol",
    "Parent Contracts": [
        "registries/contracts/UnitRegistry.sol",
        "registries/contracts/GenericRegistry.sol",
        "registries/lib/solmate/src/tokens/ERC721.sol",
        "registries/contracts/interfaces/IErrorsRegistries.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "contract AgentRegistry is UnitRegistry {\n    // Component registry\n    address public immutable componentRegistry;\n    // Agent registry version number\n    string public constant VERSION = \"1.0.0\";\n\n    /// @dev Agent registry constructor.\n    /// @param _name Agent registry contract name.\n    /// @param _symbol Agent registry contract symbol.\n    /// @param _baseURI Agent registry token base URI.\n    /// @param _componentRegistry Component registry address.\n    constructor(string memory _name, string memory _symbol, string memory _baseURI, address _componentRegistry)\n        UnitRegistry(UnitType.Agent)\n        ERC721(_name, _symbol)\n    {\n        baseURI = _baseURI;\n        componentRegistry = _componentRegistry;\n        owner = msg.sender;\n    }\n\n    /// @dev Checks provided component dependencies.\n    /// @param dependencies Set of component dependencies.\n    function _checkDependencies(uint32[] memory dependencies, uint32) internal virtual override {\n        // Check that the agent has at least one component\n        if (dependencies.length == 0) {\n            revert ZeroValue();\n        }\n\n        // Get the components total supply\n        uint32 componentTotalSupply = uint32(IRegistry(componentRegistry).totalSupply());\n        uint32 lastId;\n        for (uint256 iDep = 0; iDep < dependencies.length; ++iDep) {\n            if (dependencies[iDep] < (lastId + 1) || dependencies[iDep] > componentTotalSupply) {\n                revert ComponentNotFound(dependencies[iDep]);\n            }\n            lastId = dependencies[iDep];\n        }\n    }\n\n    /// @dev Gets linearized set of subcomponents of a provided unit Id and a type of a component.\n    /// @notice (0) For components this means getting the linearized map of components from the componentRegistry contract.\n    /// @notice (1) For agents this means getting the linearized map of components from the local map of subcomponents.\n    /// @param subcomponentsFromType Type of the unit: component or agent.\n    /// @param unitId Component Id.\n    /// @return subComponentIds Set of subcomponents.\n    function _getSubComponents(UnitType subcomponentsFromType, uint32 unitId) internal view virtual override\n        returns (uint32[] memory subComponentIds)\n    {\n        // Self contract (agent registry) can only call subcomponents calculation from the component level (0)\n        // Otherwise, the subcomponents are already written into the corresponding subcomponents map\n        if (subcomponentsFromType == UnitType.Component) {\n            (subComponentIds, ) = IRegistry(componentRegistry).getLocalSubComponents(uint256(unitId));\n        } else {\n            subComponentIds = mapSubComponents[uint256(unitId)];\n        }\n    }\n\n    /// @dev Calculates the set of subcomponent Ids.\n    /// @notice We assume that the external callers calculate subcomponents from the higher unit hierarchy level: agents.\n    /// @param unitIds Unit Ids.\n    /// @return subComponentIds Subcomponent Ids.\n    function calculateSubComponents(uint32[] memory unitIds) external view returns (uint32[] memory subComponentIds)\n    {\n        subComponentIds = _calculateSubComponents(UnitType.Agent, unitIds);\n    }\n}"
}