// SPDX-License-Identifier: MIT pragma solidity >=0.7.6 <0.8.0; /** * @title ERC1155 Multi Token Standard, basic interface. * @dev See https://eips.ethereum.org/EIPS/eip-1155 * @dev Note: The ERC-165 identifier for this interface is 0xd9b67a26. */ interface IERC1155 { event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value); event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values); event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); event URI(string _value, uint256 indexed _id); /** * Safely transfers some token. * @dev Reverts if `to` is the zero address. * @dev Reverts if the sender is not approved. * @dev Reverts if `from` has an insufficient balance. * @dev Reverts if `to` is a contract and the call to {IERC1155TokenReceiver-onERC1155received} fails or is refused. * @dev Emits a `TransferSingle` event. * @param from Current token owner. * @param to Address of the new token owner. * @param id Identifier of the token to transfer. * @param value Amount of token to transfer. * @param data Optional data to send along to a receiver contract. */ function safeTransferFrom( address from, address to, uint256 id, uint256 value, bytes calldata data ) external; /** * Safely transfers a batch of tokens. * @dev Reverts if `to` is the zero address. * @dev Reverts if `ids` and `values` have different lengths. * @dev Reverts if the sender is not approved. * @dev Reverts if `from` has an insufficient balance for any of `ids`. * @dev Reverts if `to` is a contract and the call to {IERC1155TokenReceiver-onERC1155batchReceived} fails or is refused. * @dev Emits a `TransferBatch` event. * @param from Current token owner. * @param to Address of the new token owner. * @param ids Identifiers of the tokens to transfer. * @param values Amounts of tokens to transfer. * @param data Optional data to send along to a receiver contract. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external; /** * Retrieves the balance of `id` owned by account `owner`. * @param owner The account to retrieve the balance of. * @param id The identifier to retrieve the balance of. * @return The balance of `id` owned by account `owner`. */ function balanceOf(address owner, uint256 id) external view returns (uint256); /** * Retrieves the balances of `ids` owned by accounts `owners`. For each pair: * @dev Reverts if `owners` and `ids` have different lengths. * @param owners The addresses of the token holders * @param ids The identifiers to retrieve the balance of. * @return The balances of `ids` owned by accounts `owners`. */ function balanceOfBatch(address[] calldata owners, uint256[] calldata ids) external view returns (uint256[] memory); /** * Enables or disables an operator's approval. * @dev Emits an `ApprovalForAll` event. * @param operator Address of the operator. * @param approved True to approve the operator, false to revoke an approval. */ function setApprovalForAll(address operator, bool approved) external; /** * Retrieves the approval status of an operator for a given owner. * @param owner Address of the authorisation giver. * @param operator Address of the operator. * @return True if the operator is approved, false if not. */ function isApprovedForAll(address owner, address operator) external view returns (bool); }