Skip to main content

ERC1155BatchPortal

The ERC1155BatchPortal allows anyone to perform batch transfers of ERC-1155 tokens to a dApp while informing the off-chain machine.

depositBatchERC1155Token

function depositBatchERC1155Token(contract IERC1155 _token, address _dapp, uint256[] _tokenIds, uint256[] _values, bytes _baseLayerData, bytes _execLayerData) external

Transfer a batch of ERC-1155 tokens to a dApp and add an input to the dApp'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 _tokenIds and _values have the same length.

Parameters

NameTypeDescription
_tokencontract IERC1155The ERC-1155 token contract
_dappaddressThe address of the dApp
_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

On this page

© 2024 Cartesi Foundation Ltd. All rights reserved.

The Cartesi Project is commissioned by the Cartesi Foundation.

We use cookies to ensure that we give you the best experience on our website. By using the website, you agree to the use of cookies.