48 lines
2.2 KiB
Solidity
48 lines
2.2 KiB
Solidity
// SPDX-License-Identifier: CC0-1.0
|
|
pragma solidity ^0.8.0;
|
|
|
|
import "./IERC3525.sol";
|
|
|
|
/**
|
|
* @title ERC-3525 Semi-Fungible Token Standard, optional extension for approval of slot level
|
|
* @dev Interfaces for any contract that wants to support approval of slot level, which allows an
|
|
* operator to manage one's tokens with the same slot.
|
|
* See https://eips.ethereum.org/EIPS/eip-3525
|
|
* Note: the ERC-165 identifier for this interface is 0xb688be58.
|
|
*/
|
|
interface IERC3525SlotApprovable is IERC3525 {
|
|
/**
|
|
* @dev MUST emits when an operator is approved or disapproved to manage all of `_owner`'s
|
|
* tokens with the same slot.
|
|
* @param _owner The address whose tokens are approved
|
|
* @param _slot The slot to approve, all of `_owner`'s tokens with this slot are approved
|
|
* @param _operator The operator being approved or disapproved
|
|
* @param _approved Identify if `_operator` is approved or disapproved
|
|
*/
|
|
event ApprovalForSlot( address indexed _owner, uint256 indexed _slot, address indexed _operator, bool _approved);
|
|
|
|
/**
|
|
* @notice Approve or disapprove an operator to manage all of `_owner`'s tokens with the
|
|
* specified slot.
|
|
* @dev Caller SHOULD be `_owner` or an operator who has been authorized through
|
|
* `setApprovalForAll`.
|
|
* MUST emit ApprovalSlot event.
|
|
* @param _owner The address that owns the ERC3525 tokens
|
|
* @param _slot The slot of tokens being queried approval of
|
|
* @param _operator The address for whom to query approval
|
|
* @param _approved Identify if `_operator` would be approved or disapproved
|
|
*/
|
|
function setApprovalForSlot( address _owner, uint256 _slot, address _operator, bool _approved) external payable;
|
|
|
|
/**
|
|
* @notice Query if `_operator` is authorized to manage all of `_owner`'s tokens with the
|
|
* specified slot.
|
|
* @param _owner The address that owns the ERC3525 tokens
|
|
* @param _slot The slot of tokens being queried approval of
|
|
* @param _operator The address for whom to query approval
|
|
* @return True if `_operator` is authorized to manage all of `_owner`'s tokens with `_slot`,
|
|
* false otherwise.
|
|
*/
|
|
function isApprovedForSlot( address _owner, uint256 _slot, address _operator) external view returns (bool);
|
|
}
|