The tokenURI
method encodes the NFT metadata in Base64. While Base64 encoding is common in some contexts, in this implementation it may be unnecessary and counterproductive. Encoding the JSON metadata in Base64 can complicate off-chain processing, potentially cause interoperability issues with platforms expecting plain JSON, and lead to increased gas consumption due to additional encoding overhead.
The current implementation of tokenURI encodes a JSON metadata object in Base64. This results in a URI that is not easily readable or parsable by off-chain applications expecting a standard JSON metadata URI.
The additional encoding layer introduces extra computational steps, which may increase gas costs during the tokenURI call.
There is also a potential risk for tooling incompatibility; some NFT platforms or metadata aggregators might expect a plain JSON response and may not correctly decode Base64, leading to issues in displaying NFT details.
Off-chain systems may not be able to correctly interpret or display NFT metadata, potentially impacting NFT applications that rely on standard metadata formats.
The extra Base64 encoding increases the complexity of the tokenURI and, in some cases, may incur additional gas expenses.
If the Base64 encoded metadata is not supported or expected by external platforms, it may lead to broken user experiences, underrepresentation of the NFT’s attributes, or even rejection of the NFT on some platforms.
Remove the Base64 encoding layer from the tokenURI function. Instead of encoding the metadata into Base64, return a plain JSON metadata string or a direct URL pointing to off-chain metadata storage that serves the JSON directly. For example, modify the tokenURI function as follows:
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.