The tokenURI function in the SablierV2NFTDescriptor contract constructs the JSON metadata for the NFT by concatenating various components. If any of these components are empty or invalid, it could result in an incomplete or empty JSON metadata string. This issue is not currently handled in the function, which can lead to potential problems.
Scenarios Leading to Empty String:
Calls to functions like sablier.getAsset, sablier.getDepositedAmount, etc., might fail or return unexpected results, leading to missing data fields.
If safeAssetSymbol fails and returns an empty string, the assetSymbol could be empty.
If NFTSVG.generateSVG fails to generate a valid SVG string, vars.svg could be empty.
If the Base64.encode function fails or returns an empty string, the image field in the JSON metadata could be empty.
If the low-level call to ISablierV2Lockup.isTransferable fails and the fallback logic does not handle it properly, it could lead to an empty or incorrect isTransferable value.
If any of the components used to build the JSON metadata (e.g., generateAttributes, generateDescription, generateName) return empty strings, it could lead to an incomplete or empty JSON metadata string.
The NFT metadata might be incomplete, leading to missing information when displayed on platforms like OpenSea.
An empty or malformed JSON string could cause errors in applications that rely on this metadata.
Manual Review
Implement validation checks for each component used to build the JSON metadata. Ensure that none of the components are empty before concatenating them.
Add error handling mechanisms to catch and handle cases where any of the components are empty or invalid.
Provide fallback values for critical fields to ensure that the JSON metadata is always complete and valid.
Consider adding logging for debugging purposes to track any instances where components are empty or invalid.
https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.