The _depositIntoEscrow
and _withdrawFromEscrow
functions assume that token deposits and withdrawals are valid without verifying the token supply, especially for ERC1155 tokens.
For ERC1155 tokens, the contract assumes that the token ID has exactly one unit in supply for deposits and withdrawals. This assumption may not hold if the token contract's supply is managed differently.
If the actual supply of a token ID does not match the assumptions in the contract, it may lead to unexpected behavior, including failed transactions or incorrect token balances.
Manual Code Review
Verify the token supply before performing operations. For ERC1155 tokens, you can use the balanceOf
function to check the balance:
```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.