Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IErc1155BatchPortal

Git Source

Inherits: IPortal

Title: ERC-1155 Batch Transfer Portal interface

Functions

depositBatchErc1155Token

Transfer a batch of ERC-1155 tokens of multiple types to an application contract and add an input to the application's input box to signal such operation. The caller must enable approval for the portal to manage all of their tokens beforehand, by calling the setApprovalForAll function in the token contract.

Please make sure the arrays tokenIds and values have the same length. If the application is foreclosed, and the deposit input is not processed, the user can issue a refund. If the user deposits ERC-1155 tokens through a smart contract, a refund will only succeed if the smart contract accepts it through the onERC1155Received/onERC1155BatchReceived callback. If the smart contract wallet does not accept the tokens through the callback, they may not be recoverable.

function depositBatchErc1155Token(
    IERC1155 token,
    address appContract,
    uint256[] calldata tokenIds,
    uint256[] calldata values,
    bytes calldata baseLayerData,
    bytes calldata execLayerData
) external;

Parameters

NameTypeDescription
tokenIERC1155The ERC-1155 token contract
appContractaddressThe application contract address
tokenIdsuint256[]The identifiers of the tokens being transferred
valuesuint256[]Transfer amounts per token type
baseLayerDatabytesAdditional data to be interpreted by the base layer
execLayerDatabytesAdditional data to be interpreted by the execution layer