Wrong function selector will always return an empty baseURI()
.
When NFTs are deposited on L1 via depositTokens()
, their tokenURI
will be retrieved in TokenUtil.erc721Metadata()
. The logic is as follows:
Is baseURI
populated in the collection:
→ Yes - baseURI
will be returned.
→ No - tokenURI
of each tokenId will be returned.
But _callBaseUri()
is incorrectly implemented by passing in the wrong function selectors to retrieve the baseURI
of a collection.
This is the OZ implementation and _baseUri
must be _baseURI
, with capital letters.
However even if change the selectors to capital letters, there’s no guarantee that this code will retrieve the baseURI
of the collection:
Because _baseURI()
is internal and cannot be called.
The collection must explicitly define external/public baseURI()
or override _baseURI()
to be public.
In the specified EveraiDuo collection, this function is internal and cannot be called.
Note: In the contest chat it was stated that all NFT collections are in scope - BoredApeYachtClub this is one of the collections that has public baseURI() and will work with after the fix.
baseURI
will never be retrieved, TokenUtil.erc721Metadata()
will always return the result of tokenURI()
, breaking the idea of the function.
Manual
Change the function selectors to _baseURI()
and baseURI(
), but note that if the collection does not expose an external/public
function for baseURI
, it cannot be retrieved separately and then tokenURI
must be used.
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.