Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: medium
Valid

Legendary NFT is non-compliant with the ERC721 standard

Summary

The NFTs of legendary rarity are not complying with the ERC721 standard, as their URI does not conform to the JSON data structure defined by the standard.

Vulnerability Details

The ERC721 standard defines a JSON data structure to represent NFTs, shown in the documentation for the EIP, here: https://eips.ethereum.org/EIPS/eip-721
An example of the metadata for an ERC721 compliant NFT is as follows:

{
"title": "Asset Metadata",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Identifies the asset to which this NFT represents"
},
"description": {
"type": "string",
"description": "Describes the asset to which this NFT represents"
},
"image": {
"type": "string",
"description": "A URI pointing to a resource with mime type image/* representing the asset to which this NFT represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive."
}
}
}

However, when querying the URI for the rarities defined in the contract, the legendary LEGEND_SNEK_URI returns the image associated with the NFT, which (should) probably be the "image" field of the correct JSON structure.
The error is even more evident, as the other two rarities return the correct JSON data structure.
For example, this is what is returned when querying the URI for the RARE_SNEK_URI:

{
"name": "Jungle Snek",
"description": "An adorable rare jungle snek!",
"image": "ipfs://QmRujARrkux8nsUG8BzXJa8TiDyz5sDJnVKDqrk3LLsKLX",
"attributes": [
{
"trait_type": "cuteness",
"value": 100
}
]
}

To reproduce the verification steps, follow these links:

  1. correctly set URI: https://ipfs.io/ipfs/QmZit9nbdhJsRTt3JBQN458dfZ1i6LR3iPGxGQwq34Li4a

  2. wrongly set URI: https://ipfs.io/ipfs/QmRujARrkux8nsUG8BzXJa8TiDyz5sDJnVKDqrk3LLsKLX

Impact

Indexing the NFT will prove difficult, and its integration with existing tools and wallets might be impossible, as it does not correctly implement the ERC721 standard.

Tools Used

Manual review, VSCode

Recommendations

Modify the URI for the legendary NFTs, to match the expected standard behavior, as it is for the other two rarities.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

LEGEND_SNEK_URI is wrong

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.