In the ERC721 standard, which is commonly used for NFTs, the correct function name for retrieving metadata is URI
, not Uri
. However, the NFT bridge contract mistakenly tries to call baseUri
to get the metadata URI of an NFT collection. This mistake causes the function to fail every time.
The code snippet above shows the _callBaseUri
function used when bridging NFTs. The function attempts to retrieve metadata by calling _baseUri
and baseUri
from the NFT collection contract.
However, this approach has two main issues:
The _baseUri
function is typically an internal function. Internal functions cannot be accessed by external contracts, which means this call will fail.
Most NFT collections that support a base URI use the function name baseURI
, not baseUri
. This small difference in capitalization is crucial and causes the call to fail.
Because of these issues, the function will always fail to retrieve the base URI from any NFT collection.
The inability to retrieve the base URI prevents access to NFT metadata on the destination chain. This can disrupt the display or use of the NFT's metadata, such as its image, description, and other attributes.
Manual Review
To correctly retrieve the metadata from an NFT collection, the contract should call the baseURI
function instead of baseUri
.
Likelyhood: Medium, no token using OZ version 2.X and 3.X will work. Impact: Low, Valid standard token won’t be mint with the URI but owner can use ERC721UriImpl function on the deployed token.
Likelyhood: Medium, no token using OZ version 2.X and 3.X will work. Impact: Low, Valid standard token won’t be mint with the URI but owner can use ERC721UriImpl function on the deployed token.
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.