Escrow function to transfer an ERC1155 from the user to the contract will always fail
The function that is responsible to transfer the tokens from the user that wants to bridge it to the bridge contract works as follows:
As we can see, when the token to bridge is an ERC721 it uses the transferFrom function. This is an intended behavior because the bridge contract does not implement the ERC721 receiver interface so if the safeTransferFrom function would be used instead, it would fail. The same happens for the ERC1155, since the bridge contract does not implement the ERC1155 receiver interface and the method used here is the safeTransferFrom function, it will lead to the transaction reverting.
ERC1155 tokens will not be able to be bridged
Manual review
Since the ERC1155 does not implement a method to transfer tokens without executing a callback function, the only way to solve this is by inheriting the ERC1155TokenReceiver interface.
```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(); } … } ```
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.