NFTBridge
60,000 USDC
View results
Submission Details
Severity: low
Invalid

Bridging ERC1155 NFTs on l1 produces ERC721 NFTs on l2

Summary

The l1 bridge supports erc1155 bridging but the l2 bridge currently has no logic for minting erc1155 nfts.

Vulnerability Details

_depositIntoEscrow(ctype, collectionL1, ids);

The line above allows depositing Erc20 and ERC1155 nfts on ethereum, but in the withdraw_autofroml1_ function on starknet the _ctype collection type is retrieved but never used to determint what kind of NFT is to be minted.

//note: _ctype variable not used anywhere
let _ctype = collection_type_from_header(req.header);

Therefore for every erc1155 bridged on l1 an erc721 is minted on l2, which can lead to a large number of dublicated NFTs and also render the core function of the NFTs invalid, i.e. if they are meant to be used as in-game items or collectibles.

Impact

NFTs intended usage and uniqueness is disrupted

Tools Used

Manual Review

Recommendations

Consider checking _ctype on starknet to determine what type of NFT is to be minted then add logic for minting ERC1155s into the contract.

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Out of scope
Assigned finding tags:

invalid-ERC1155-not-in-scope

```compatibilities: Blockchains: - Ethereum/Starknet Tokens: - [ERC721](www.tokenstandard.com) ``` ``` function depositTokens( uint256 salt, address collectionL1, snaddress ownerL2, uint256[] calldata ids, bool useAutoBurn ) external payable { if (!Cairo.isFelt252(snaddress.unwrap(ownerL2))) { revert CairoWrapError(); } if (!_enabled) { revert BridgeNotEnabledError(); } CollectionType ctype = TokenUtil.detectInterface(collectionL1); if (ctype == CollectionType.ERC1155) { @> revert NotSupportedYetError(); } … } ```

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.