The tokenURI()
function in the SablierV2NFTDescriptor
contract does not adhere to the EIP-721 standard, which mandates that the function should throw an error if _tokenId
is not a valid NFT. This can lead to inconsistencies and unexpected behavior when interacting with non-minted NFTs.
According to the EIP-721 standard, the tokenURI()
function must throw an error if the _tokenId
provided is not valid. However, the current implementation in SablierV2NFTDescriptor.sol
does not enforce this requirement. If the NFT corresponding to the streamId
has not been minted, tokenURI()
should revert but currently does not.
https://github.com/Cyfrin/2024-05-Sablier/tree/main/v2-core/src/SablierV2NFTDescriptor.sol#L47-L117
Failure to revert when the tokenId
is invalid can lead to unexpected behavior and inconsistencies. It might cause issues in applications relying on the standard behavior of tokenURI()
, potentially affecting the functionality of NFTs in user interfaces and other integrations.
Manual code review
EIP-721 documentation
Add a Validity Check: Ensure that the tokenURI()
function includes a check to verify that the streamId
corresponds to a valid, minted NFT. If the streamId
is not valid, the function should revert with an appropriate error message.
Example:
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.