The function tokenURI
is overridden without adhering to the ERC721 standard, as it does not throw the expected errors, nor does it return the correct data type.
In the list of functions exported from the ERC721 standard, there is a commented line, stating that one of the standard function will be overridden:
# ERC721.tokenURI, we are overriding this function
The natspec for the standard ERC721 tokenURI
function is the following one:
However, looking at the overridden function, it is obvious that there are two implementation errors:
the function does not throw an error, but it actually returns a common rarity URI for non existing NFTs
the function returns a String[53]
instead of the expected String[512]
To test that the function does not fail nor throw any error, the following test can be added to the test suite:
The function is non-compliant with the ERC721 standard. The impact is twofold:
integrating into the existing environment will prove difficult, if the defined standard is not adhered to completely
the behavior and the returned values are logically wrong, as the function never fails, even for non-existing NFTs
Manual review, VSCode, Pytest
Fix the two issues that differ from standard, expected behavior.
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.