{
    "Function": "getPointedIfMirror",
    "File": "contracts/libraries/Helpers.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [
        "revert PublicationDoesNotExist()"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function getPointedIfMirror(\n        uint256 profileId,\n        uint256 pubId,\n        mapping(uint256 => mapping(uint256 => DataTypes.PublicationStruct))\n            storage _pubByIdByProfile\n    )\n        internal\n        view\n        returns (\n            uint256,\n            uint256,\n            address\n        )\n    {\n        address collectModule = _pubByIdByProfile[profileId][pubId].collectModule;\n        if (collectModule != address(0)) {\n            return (profileId, pubId, collectModule);\n        } else {\n            uint256 pointedTokenId = _pubByIdByProfile[profileId][pubId].profileIdPointed;\n            // We validate existence here as an optimization, so validating in calling contracts is unnecessary\n            if (pointedTokenId == 0) revert Errors.PublicationDoesNotExist();\n\n            uint256 pointedPubId = _pubByIdByProfile[profileId][pubId].pubIdPointed;\n\n            address pointedCollectModule = _pubByIdByProfile[pointedTokenId][pointedPubId]\n                .collectModule;\n\n            return (pointedTokenId, pointedPubId, pointedCollectModule);\n        }\n    }"
}