Description:
The Bridge.sol::withdrawTokens
function currently lacks a mechanism to manage the URI (Uniform Resource Identifier) for ERC721 tokens during the minting process. If the ERC721 implementation on Layer 1 (L1) supports URI storage, the URI should be set appropriately when the token is minted after being bridged from Layer 2 (L2). Without handling URIs, the newly minted tokens on L1 might miss critical metadata that is essential for their representation and usability.
Impact:
Missing or Incorrect Metadata: Users may encounter issues with missing or incorrect token metadata, which can reduce the utility and perceived value of the bridged ERC721 tokens.
Inconsistency Between Layers: The discrepancy in token metadata between L2 and L1 could lead to a lack of synchronization and trust in the bridging process, potentially affecting user confidence.
User Experience: A lack of proper metadata handling could result in a suboptimal user experience, particularly if the URI contains important information that users rely on to understand or trade the tokens.
Recommended Mitigation:
To address the inconsistency in URI handling, consider implementing the following mitigations:
Fetch the URI from L2: During the withdrawTokens process, implement a mechanism to fetch the token's URI from L2. This ensures that the metadata is preserved and correctly applied when the token is minted on L1.
Modify the Minting Process: Update the minting process on L1 to include the URI for ERC721 tokens. This will maintain metadata consistency across both layers.
Support for URI Setting: Ensure that the ERC721 contract on L1 has a method for setting the URI. If such a method is not already supported, consider adding one to allow URIs to be assigned during the minting process.
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.