all files / contracts/token/ERC1155/ ISpanningERC1155.sol

100% Statements 0/0
100% Branches 0/0
100% Functions 0/0
100% Lines 0/0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166                                                                                                                                                                                                                                                                                                                                           
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
 
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
 
/**
 * @dev Interface of ERC1155 in the Spanning Protocol
 */
interface ISpanningERC1155 is IERC1155 {
    /**
     * @dev Emitted when `amount` tokens of token type `id` are transferred from `senderAddress` to `receiverAddress` by `operatorAddress`.
     *
     * @param operatorAddress - Spanning Address of the operator
     * @param senderAddress - Spanning Address to initiate the transfer
     * @param receiverAddress - Spanning Address to receive the transfer
     * @param id - token type
     * @param amount - Amount to transfer
     */
    event SpanningTransferSingle(
        bytes32 indexed operatorAddress,
        bytes32 indexed senderAddress,
        bytes32 indexed receiverAddress,
        uint256 id,
        uint256 amount
    );
 
    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operatorAddress`, `senderAddress` and `receiverAddress` are the same for all
     * transfers.
     *
     * @param operatorAddress - Spanning Address of the operator
     * @param senderAddress - Spanning Address to initiate the transfer
     * @param receiverAddress - Spanning Address to receive the transfer
     * @param ids - a batch of token type
     * @param amounts - a batch of amounts
     */
    event SpanningTransferBatch(
        bytes32 indexed operatorAddress,
        bytes32 indexed senderAddress,
        bytes32 indexed receiverAddress,
        uint256[] ids,
        uint256[] amounts
    );
 
    /**
     * @dev Emitted when `senderAddress` grants or revokes permission to `receiverAddress` to transfer their tokens, according to
     * `approved`.
     *
     * @param senderAddress - Spanning Address to grants or revokes permission
     * @param receiverAddress - Spanning Address to receive permission
     * @param approved - grants or revokes permission
     */
    event SpanningApprovalForAll(
        bytes32 indexed senderAddress,
        bytes32 indexed receiverAddress,
        bool approved
    );
 
    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * @param account - Spanning Address to be queried
     * @param id - Token type
     * @return Token value of token type `id` for an account
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(bytes32 account, uint256 id)
        external
        view
        returns (uint256);
 
    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * @param accounts - a batch of Spanning Address to be queried
     * @param ids - a batch of Token type
     * @return a batch of token value of token type `ids` for a batch of accounts
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(bytes32[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);
 
    /**
     * @dev Grants or revokes permission to `receiverAddress` to transfer the caller's tokens, according to `approved`,
     *
     * @param receiverAddress - Spanning Address to receive permission
     * @param approved - grants or revokes permission
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `receiverAddress` cannot be the caller.
     */
 
    function setApprovalForAll(bytes32 receiverAddress, bool approved) external;
 
    /**
     * @dev Returns true if `receiverAddress` is approved to transfer ``senderAddress``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(bytes32 senderAddress, bytes32 receiverAddress)
        external
        view
        returns (bool);
 
    /**
     * @dev Transfers `amount` tokens of token type `id` from `senderAddress` to `receiverAddress`.
     *
     * Emits a {TransferSingle} event.
     *
     * @param senderAddress - Spanning Address to initiate the transfer
     * @param receiverAddress - Spanning Address to receive the transfer
     * @param id - Token type
     * @param amount - Amount to transfer
     *
     * Requirements:
     *
     * - `receiverAddress` cannot be the zero address.
     * - If the caller is not `senderAddress`, it must be have been approved to spend ``senderAddress``'s tokens via {setApprovalForAll}.
     * - `senderAddress` must have a balance of tokens of type `id` of at least `amount`.
     * - If `receiverAddress` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        bytes32 senderAddress,
        bytes32 receiverAddress,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;
 
    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * @param senderAddress - Spanning Address to initiate the transfer
     * @param receiverAddress - Spanning Address to receive the transfer
     * @param ids - a batch of Token type
     * @param amounts - a batch of amounts
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `receiverAddress` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        bytes32 senderAddress,
        bytes32 receiverAddress,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}