{
    "Function": "slitherConstructorConstantVariables",
    "File": "registries/contracts/GenericRegistry.sol",
    "Parent Contracts": [
        "registries/lib/solmate/src/tokens/ERC721.sol",
        "registries/contracts/interfaces/IErrorsRegistries.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "abstract contract GenericRegistry is IErrorsRegistries, ERC721 {\n    event OwnerUpdated(address indexed owner);\n    event ManagerUpdated(address indexed manager);\n    event BaseURIChanged(string baseURI);\n\n    // Owner address\n    address public owner;\n    // Unit manager\n    address public manager;\n    // Base URI\n    string public baseURI;\n    // Unit counter\n    uint256 public totalSupply;\n    // Reentrancy lock\n    uint256 internal _locked = 1;\n    // To better understand the CID anatomy, please refer to: https://proto.school/anatomy-of-a-cid/05\n    // CID = <multibase_encoding>multibase_encoding(<cid-version><multicodec><multihash-algorithm><multihash-length><multihash-hash>)\n    // CID prefix = <multibase_encoding>multibase_encoding(<cid-version><multicodec><multihash-algorithm><multihash-length>)\n    // to complement the multibase_encoding(<multihash-hash>)\n    // multibase_encoding = base16 = \"f\"\n    // cid-version = version 1 = \"0x01\"\n    // multicodec = dag-pb = \"0x70\"\n    // multihash-algorithm = sha2-256 = \"0x12\"\n    // multihash-length = 256 bits = \"0x20\"\n    string public constant CID_PREFIX = \"f01701220\";\n\n    /// @dev Changes the owner address.\n    /// @param newOwner Address of a new owner.\n    function changeOwner(address newOwner) external virtual {\n        // Check for the ownership\n        if (msg.sender != owner) {\n            revert OwnerOnly(msg.sender, owner);\n        }\n\n        // Check for the zero address\n        if (newOwner == address(0)) {\n            revert ZeroAddress();\n        }\n\n        owner = newOwner;\n        emit OwnerUpdated(newOwner);\n    }\n\n    /// @dev Changes the unit manager.\n    /// @param newManager Address of a new unit manager.\n    function changeManager(address newManager) external virtual {\n        if (msg.sender != owner) {\n            revert OwnerOnly(msg.sender, owner);\n        }\n\n        // Check for the zero address\n        if (newManager == address(0)) {\n            revert ZeroAddress();\n        }\n\n        manager = newManager;\n        emit ManagerUpdated(newManager);\n    }\n\n    /// @dev Checks for the unit existence.\n    /// @notice Unit counter starts from 1.\n    /// @param unitId Unit Id.\n    /// @return true if the unit exists, false otherwise.\n    function exists(uint256 unitId) external view virtual returns (bool) {\n        return unitId > 0 && unitId < (totalSupply + 1);\n    }\n    \n    /// @dev Sets unit base URI.\n    /// @param bURI Base URI string.\n    function setBaseURI(string memory bURI) external virtual {\n        // Check for the ownership\n        if (msg.sender != owner) {\n            revert OwnerOnly(msg.sender, owner);\n        }\n\n        // Check for the zero value\n        if (bytes(bURI).length == 0) {\n            revert ZeroValue();\n        }\n\n        baseURI = bURI;\n        emit BaseURIChanged(bURI);\n    }\n\n    /// @dev Gets the valid unit Id from the provided index.\n    /// @notice Unit counter starts from 1.\n    /// @param id Unit counter.\n    /// @return unitId Unit Id.\n    function tokenByIndex(uint256 id) external view virtual returns (uint256 unitId) {\n        unitId = id + 1;\n        if (unitId > totalSupply) {\n            revert Overflow(unitId, totalSupply);\n        }\n    }\n\n    // Open sourced from: https://stackoverflow.com/questions/67893318/solidity-how-to-represent-bytes32-as-string\n    /// @dev Converts bytes16 input data to hex16.\n    /// @notice This method converts bytes into the same bytes-character hex16 representation.\n    /// @param data bytes16 input data.\n    /// @return result hex16 conversion from the input bytes16 data.\n    function _toHex16(bytes16 data) internal pure returns (bytes32 result) {\n        result = bytes32 (data) & 0xFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000 |\n        (bytes32 (data) & 0x0000000000000000FFFFFFFFFFFFFFFF00000000000000000000000000000000) >> 64;\n        result = result & 0xFFFFFFFF000000000000000000000000FFFFFFFF000000000000000000000000 |\n        (result & 0x00000000FFFFFFFF000000000000000000000000FFFFFFFF0000000000000000) >> 32;\n        result = result & 0xFFFF000000000000FFFF000000000000FFFF000000000000FFFF000000000000 |\n        (result & 0x0000FFFF000000000000FFFF000000000000FFFF000000000000FFFF00000000) >> 16;\n        result = result & 0xFF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 |\n        (result & 0x00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000) >> 8;\n        result = (result & 0xF000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000) >> 4 |\n        (result & 0x0F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F00) >> 8;\n        result = bytes32 (0x3030303030303030303030303030303030303030303030303030303030303030 +\n        uint256 (result) +\n            (uint256 (result) + 0x0606060606060606060606060606060606060606060606060606060606060606 >> 4 &\n            0x0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F) * 39);\n    }\n\n    /// @dev Gets the hash of the unit.\n    /// @param unitId Unit Id.\n    /// @return Unit hash.\n    function _getUnitHash(uint256 unitId) internal view virtual returns (bytes32);\n\n    /// @dev Returns unit token URI.\n    /// @notice Expected multicodec: dag-pb; hashing function: sha2-256, with base16 encoding and leading CID_PREFIX removed.\n    /// @param unitId Unit Id.\n    /// @return Unit token URI string.\n    function tokenURI(uint256 unitId) public view virtual override returns (string memory) {\n        bytes32 unitHash = _getUnitHash(unitId);\n        // Parse 2 parts of bytes32 into left and right hex16 representation, and concatenate into string\n        // adding the base URI and a cid prefix for the full base16 multibase prefix IPFS hash representation\n        return string(abi.encodePacked(baseURI, CID_PREFIX, _toHex16(bytes16(unitHash)),\n            _toHex16(bytes16(unitHash << 128))));\n    }\n}"
}