The Starknet-side bridge allways sends token URI data when bridging to Ethereum, but the Ethereum-side ERC721Bridgable contract does not use this data and will always return an empty string for any tokenId when queried with tokenURI(uint256 tokenId). This results in both a loss for bridge users (who pay a redundant fee for the transfered URI data) and in rendering the Ethereum-side bridged tokens useless for most common NFT applications.
The token bridging process from Starknet to Ethereum involves the following steps with regards to handling token URIs
When depositing tokens on starknet, specific token URIs are always included in the message while base URI is never included:
On the Ethereum side, when the message is consumed through WidthdrawTokens, if the bridgable collection does not exist, it is created, but the base URI is never set ( see here ).
If a specific token ID is bridged to Ethereum for the first time, is it minted on the Ethereum-side bridgable contract, but the token's URI (sent with the message) is never used ( see here ).
Any call to an ERC721Bridgable.tokenUri(tokenId) on Ethereum falls back to the base OZ ERC721 implementation, that returns an empty string if the _baseUri() is empty:
As a result, any bridged Starknet collection will have no URI data for any Token, ispite of this data being sent with every bridge message.
Ethereum-side bridged NFTs are useless for many NFT related applications and uses that relies on the URI for NFT presentation (social media apps, NFT wallets, Marketplaces, gaming apps NFTs etc.)
Users pay an extra gas fee (both on Starknet when sending the message and on Ethereum when withdrawing it) for the URI data sent, inspite of this data never being used.
Manual Review, Foundry, snFoundry
Implement per-token URIs on the ERC721Bridgable contract and set the sent URIs when a token is first bridged to the Ethereum side.
Until such imlpementation is available, avoid sending URI information from the Starknet-side bridge.
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.