// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.22; import { IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import { Base64 } from "@openzeppelin/contracts/utils/Base64.sol"; import { IFlowNFTDescriptor } from "./interfaces/IFlowNFTDescriptor.sol"; /// @title FlowNFTDescriptor /// @notice See the documentation in {IFlowNFTDescriptor}. contract FlowNFTDescriptor is IFlowNFTDescriptor { /// @inheritdoc IFlowNFTDescriptor function tokenURI( IERC721Metadata, /* sablierFlow */ uint256 /* streamId */ ) external pure override returns (string memory uri) { // solhint-disable max-line-length,quotes string memory svg = ''; string memory json = string.concat( '{"description": "This NFT represents a payment stream in Sablier Flow",', '"external_url": "https://sablier.com",', '"name": "Sablier Flow",', '"image": "data:image/svg+xml;base64,', Base64.encode(bytes(svg)), '"}' ); uri = string.concat("data:application/json;base64,", Base64.encode(bytes(json))); } }