all files / contracts/token/ERC721/ ISpanningERC721.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                                                                                                                                                                                                                                                                                                                         
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: Copyright (C) 2022 Spanning Labs Inc.
 
pragma solidity ^0.8.0;
 
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
 
/**
 * @dev Interface of ERC721 in the Spanning Protocol
 *
 * NOTE: Spanning uses receiverAddress in favor of operatorAddress.
 * This pattern matches the language used to represent approvals elsewhere.
 */
interface ISpanningERC721 is IERC721 {
    /**
     * @dev Returns the number of tokens owned by an account.
     *
     * @param accountAddress - Address to be queried
     *
     * @return uint256 - Number of tokens owned by an account
     */
    function balanceOf(bytes32 accountAddress) external view returns (uint256);
 
    /**
     * @dev Returns the owner of the queried token.
     *
     * @param tokenId - Token to be queried
     *
     * @return bytes32 - Address of the owner of the queried token
     */
    function ownerOfSpanning(uint256 tokenId) external view returns (bytes32);
 
    /**
     * @dev Safely moves requested tokens between accounts, including data.
     *
     * @param senderAddress - Address of the sender
     * @param receiverAddress - Address of the receiver
     * @param tokenId - Token to be transferred
     * @param payload - Additional, unstructured data to be included
     */
    function safeTransferFrom(
        bytes32 senderAddress,
        bytes32 receiverAddress,
        uint256 tokenId,
        bytes calldata payload
    ) external;
 
    /**
     * @dev Safely moves requested tokens between accounts.
     *
     * @param senderAddress - Address of the sender
     * @param receiverAddress - Address of the receiver
     * @param tokenId - Token to be transferred
     */
    function safeTransferFrom(
        bytes32 senderAddress,
        bytes32 receiverAddress,
        uint256 tokenId
    ) external;
 
    /**
     * @dev Moves requested tokens between accounts.
     *
     * @param senderAddress - Address of the sender
     * @param receiverAddress - Address of the receiver
     * @param tokenId - Token to be transferred
     */
    function transferFrom(
        bytes32 senderAddress,
        bytes32 receiverAddress,
        uint256 tokenId
    ) external;
 
    /**
     * @dev Sets a token allowance for a pair of addresses (sender and receiver).
     *
     * @param receiverAddress - Address of the allowance receiver
     * @param tokenId - Token allowance to be approved
     */
    function approve(bytes32 receiverAddress, uint256 tokenId) external;
 
    /**
     * @dev Allows an account to have control over another account's tokens.
     *
     * @param receiverAddress - Address of the allowance receiver (gains control)
     * @param shouldApprove - Whether to approve or revoke the approval
     */
    function setApprovalForAll(bytes32 receiverAddress, bool shouldApprove)
        external;
 
    /**
     * @dev Returns the account approved for a token.
     *
     * @param tokenId - Token to be queried
     *
     * @return bytes32 - Address of the account approved for a token
     */
    function getApprovedSpanning(uint256 tokenId)
        external
        view
        returns (bytes32);
 
    /**
     * @dev Indicates if an account has total control over another's assets.
     *
     * @param senderAddress - Address of the allowance sender (cede control)
     * @param receiverAddress - Address of the allowance receiver (gains control)
     *
     * @return bool - Indicates whether the account is approved for all
     */
    function isApprovedForAll(bytes32 senderAddress, bytes32 receiverAddress)
        external
        view
        returns (bool);
 
    /**
     * @dev Emitted tokens are transferred
     *
     * Note that `amount` may be zero.
     *
     * @param senderAddress - Address initiating the transfer
     * @param receiverAddress - Address receiving the transfer
     * @param tokenId - Token under transfer
     */
    event SpanningTransfer(
        bytes32 indexed senderAddress,
        bytes32 indexed receiverAddress,
        uint256 indexed tokenId
    );
 
    /**
     * @dev Emitted when an allowance pair changes.
     *
     * @param senderAddress - Address of the allowance sender
     * @param receiverAddress - Address of the allowance receiver
     * @param tokenId - Token under allowance
     */
    event SpanningApproval(
        bytes32 indexed senderAddress,
        bytes32 indexed receiverAddress,
        uint256 indexed tokenId
    );
 
    /**
     * @dev Emitted when an account gives control to another account's tokens.
     *
     * @param senderAddress - Address of the allowance sender (cede control)
     * @param receiverAddress - Address of the allowance receiver (gains control)
     * @param approved - Whether the approval was approved or revoked
     */
    event SpanningApprovalForAll(
        bytes32 indexed senderAddress,
        bytes32 indexed receiverAddress,
        bool approved
    );
}