{
    "Function": "delegateTokenURI",
    "File": "src/MarketMetadata.sol",
    "Parent Contracts": [
        "lib/openzeppelin-contracts/contracts/token/common/ERC2981.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/IERC2981.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/access/Ownable2Step.sol",
        "lib/openzeppelin-contracts/contracts/access/Ownable.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol"
    ],
    "High-Level Calls": [
        "Strings",
        "Strings",
        "Strings",
        "Base64",
        "Strings"
    ],
    "Internal Calls": [
        "string.concat()",
        "string.concat()",
        "string.concat()",
        "string.concat()"
    ],
    "Library Calls": [
        "encode",
        "toString",
        "toString",
        "toHexString",
        "toHexString"
    ],
    "Low-Level Calls": [],
    "Code": "function delegateTokenURI(address tokenContract, uint256 delegateTokenId, uint256 expiry, address principalOwner) external view returns (string memory) {\n        string memory idstr = Strings.toString(delegateTokenId);\n\n        string memory pownerstr = principalOwner == address(0) ? \"N/A\" : Strings.toHexString(principalOwner);\n        //slither-disable-next-line timestamp\n        string memory status = principalOwner == address(0) || expiry <= block.timestamp ? \"Expired\" : \"Active\";\n\n        string memory firstPartOfMetadataString = string.concat(\n            '{\"name\":\"Delegate Token #\"',\n            idstr,\n            '\",\"description\":\"DelegateMarket lets you escrow your token for a chosen timeperiod and receive a token representing the associated delegation rights. This collection represents the tokenized delegation rights.\",\"attributes\":[{\"trait_type\":\"Collection Address\",\"value\":\"',\n            Strings.toHexString(tokenContract),\n            '\"},{\"trait_type\":\"Token ID\",\"value\":\"',\n            idstr,\n            '\"},{\"trait_type\":\"Expires At\",\"display_type\":\"date\",\"value\":',\n            Strings.toString(expiry)\n        );\n        string memory secondPartOfMetadataString = string.concat(\n            '},{\"trait_type\":\"Principal Owner Address\",\"value\":\"',\n            pownerstr,\n            '\"},{\"trait_type\":\"Delegate Status\",\"value\":\"',\n            status,\n            '\"}]',\n            ',\"image\":\"',\n            delegateTokenBaseURI,\n            \"rights/\",\n            idstr,\n            '\"}'\n        );\n        // Build via two substrings to avoid stack-too-deep\n        string memory metadataString = string.concat(firstPartOfMetadataString, secondPartOfMetadataString);\n\n        return string.concat(\"data:application/json;base64,\", Base64.encode(bytes(metadataString)));\n    }"
}