we are not supporting the IERC1155 into the depositTokens in Bridge.sol but we are supporting it into Escrow.sol.
function _depositIntoEscrow(
CollectionType collectionType,
address collection,
uint256 [] memory ids
)
internal
{
assert(ids.length > 0);
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
if (collectionType == CollectionType.ERC721) {
IERC721(collection).transferFrom(msg.sender, address(this), id);
} else {
@> IERC1155(collection).safeTransferFrom(msg.sender, address(this), id, 1, "");
}
_escrow[collection][id] = msg.sender;
}
}
@notice Withdraw a token from escrow.
@param collectionType The token type,
@param collection Token collection address.
@param to Owner withdrawing the token.
@param id Token to be deposited.
@return True if the token was into escrow, false otherwise.
*/
function _withdrawFromEscrow(
CollectionType collectionType,
address collection,
address to,
uint256 id
)
internal
returns (bool)
{
if (!_isEscrowed(collection, id)) {
return false;
}
address from = address(this);
if (collectionType == CollectionType.ERC721) {
IERC721(collection).safeTransferFrom(from, to, id);
} else {
@> IERC1155(collection).safeTransferFrom(from, to, id, 1, "");
}
_escrow[collection][id] = address(0x0);
return true;
}
support same token in both places as we are reverting IERC1155 inBridge.sol but accepting into escrow.sol