{
    "Function": "tokenURI",
    "File": "smart-contracts/NextGenCore.sol",
    "Parent Contracts": [
        "smart-contracts/ERC2981.sol",
        "smart-contracts/Ownable.sol",
        "smart-contracts/ERC721Enumerable.sol",
        "smart-contracts/IERC721Enumerable.sol",
        "smart-contracts/ERC721.sol",
        "smart-contracts/IERC721Metadata.sol",
        "smart-contracts/IERC721.sol",
        "smart-contracts/ERC165.sol",
        "smart-contracts/IERC2981.sol",
        "smart-contracts/IERC165.sol",
        "smart-contracts/Context.sol"
    ],
    "High-Level Calls": [
        "Base64",
        "Strings"
    ],
    "Internal Calls": [
        "abi.encodePacked()",
        "getTokenName",
        "abi.encodePacked()",
        "_requireMinted",
        "abi.encodePacked()",
        "retrieveGenerativeScript",
        "abi.encodePacked()"
    ],
    "Library Calls": [
        "encode",
        "toString"
    ],
    "Low-Level Calls": [],
    "Code": "function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n        _requireMinted(tokenId);\n        if (onchainMetadata[tokenIdsToCollectionIds[tokenId]] == false && tokenToHash[tokenId] != 0x0000000000000000000000000000000000000000000000000000000000000000) {\n            string memory baseURI = collectionInfo[tokenIdsToCollectionIds[tokenId]].collectionBaseURI;\n            return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n        } else if (onchainMetadata[tokenIdsToCollectionIds[tokenId]] == false && tokenToHash[tokenId] == 0x0000000000000000000000000000000000000000000000000000000000000000) {\n            string memory baseURI = collectionInfo[tokenIdsToCollectionIds[tokenId]].collectionBaseURI;\n            return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, \"pending\")) : \"\";\n        }\n        else {\n            string memory b64 = Base64.encode(abi.encodePacked(\"<html><head></head><body><script src=\\\"\",collectionInfo[tokenIdsToCollectionIds[tokenId]].collectionLibrary,\"\\\"></script><script>\",retrieveGenerativeScript(tokenId),\"</script></body></html>\"));\n            string memory _uri = string(abi.encodePacked(\"data:application/json;utf8,{\\\"name\\\":\\\"\",getTokenName(tokenId),\"\\\",\\\"description\\\":\\\"\",collectionInfo[tokenIdsToCollectionIds[tokenId]].collectionDescription,\"\\\",\\\"image\\\":\\\"\",tokenImageAndAttributes[tokenId][0],\"\\\",\\\"attributes\\\":[\",tokenImageAndAttributes[tokenId][1],\"],\\\"animation_url\\\":\\\"data:text/html;base64,\",b64,\"\\\"}\"));\n            return _uri;\n        }\n    }"
}