Files
core/contracts/interfaces/ILensNFTBase.sol
2022-02-05 19:11:57 -05:00

71 lines
2.4 KiB
Solidity

// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.8.10;
import {DataTypes} from '../libraries/DataTypes.sol';
/**
* @title ILensNFTBase
* @author Lens Protocol
*
* @notice This is the interface for the LensNFTBase contract, from which all Lens NFTs inherit.
* It is an expansion of a very slightly modified ERC721Enumerable contract, which allows expanded
* meta-transaction functionality.
*/
interface ILensNFTBase {
/**
* @notice Implementation of an EIP-712 permit function for an ERC-721 NFT. We don't need to check
* if the tokenId exists, since the function calls ownerOf(tokenId), which reverts if the tokenId does
* not exist.
*
* @param spender The NFT spender.
* @param tokenId The NFT token ID to approve.
* @param sig The EIP712 signature struct.
*/
function permit(
address spender,
uint256 tokenId,
DataTypes.EIP712Signature calldata sig
) external;
/**
* @notice Implementation of an EIP-712 permit-style function for ERC-721 operator approvals. Allows
* an operator address to control all NFTs a given owner owns.
*
* @param owner The owner to set operator approvals for.
* @param operator The operator to approve.
* @param approved Whether to approve or revoke approval from the operator.
* @param sig The EIP712 signature struct.
*/
function permitForAll(
address owner,
address operator,
bool approved,
DataTypes.EIP712Signature calldata sig
) external;
/**
* @notice Burns an NFT, removing it from circulation and essentially destroying it. This function can only
* be called by the NFT to burn's owner.
*
* @param tokenId The token ID of the token to burn.
*/
function burn(uint256 tokenId) external;
/**
* @notice Implementation of an EIP-712 permit-style function for token burning. Allows anyone to burn
* a token on behalf of the owner with a signature.
*
* @param tokenId The token ID of the token to burn.
* @param sig The EIP712 signature struct.
*/
function burnWithSig(uint256 tokenId, DataTypes.EIP712Signature calldata sig) external;
/**
* @notice Returns the domain separator for this NFT contract.
*
* @return The domain separator.
*/
function getDomainSeparator() external view returns (bytes32);
}