ERC721 URI Metadata is lost when bridging NFT from L2 -> L1, this is because ERC721Bridgeable.sol
doesn't support token URIs.
When bridging an NFT from L2 -> L1, the NFT Metadata is stored in the request as follows :
Here, the base_uri
represents the base_uri
of the NFT collection, additionally, uris
contains the token-specific URIs of the individual tokens. These comprise the URI Metadata of the collection and NFT.
In the current codebase, if a native L2 NFT is bridged to L1 for the first time, the corresponding collection is created on L1 in the L1 bridge's (Bridge.sol
) withdrawTokens()
function.
As you can see, the URI data is not passed on to the _deployERC721Bridgeable()
function :
Also, in ERC721Bridgeable.sol
, you can see that the contract returns an empty string in the _baseURI()
function :
Also, a close look at ERC721Bridgeable.sol
will reveal that it doesn't support individual token URIs. Hence all ERC721 URI data is lost
also on the L2 bridge, while gathering ERC721 Metadata for L2 -> L1 bridging, base URI is set to an empty string :
Native L2 NFTs that are bridged to L1 won't carry the URI data of the token to L1, and there is no way to add this data later on. The token URI points to a JSON file that contains detailed metadata about the token, including its name, description, image, and attributes. This metadata gives the token context and meaning, transforming it from just an entry on the blockchain into a unique and identifiable asset. Without it, the NFT loses its uniqueness and the rich descriptive information that makes it valuable and distinguishable from other tokens. This absence can lead to a significant loss in the NFT's perceived value and utility, as platforms, marketplaces, and users on L1 would only see a bare token without any of the critical metadata that defines its purpose and characteristics.
Manual Review
Modify the functions above and ERC721Bridgeable.sol
so that it supports token URI Metadata.
URI is not lost on the origin chain and it can be modified with `ERC721UriImpl`. As explained in the TODO below, that’s a design choice and it will be implemented as a future feature. https://github.com/Cyfrin/2024-07-ark-project/blob/main/apps/blockchain/ethereum/src/Bridge.sol#L206 `ERC721Bridgable` is out of scope.
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.