This specification defines functions outlining a guarantor role for instance of EIP-721. The guarantee interface implements the user-set valuation and guarantee share for a given NFT (token ID), as well as the guarantee rights enjoyed and obligations assumed during subsequent transactions. An implementation enables the user to read or set the current guarantee value for a given NFT (token ID), and also realizes the distribution of guarantee interest and the performance of guarantee obligations. It sends the standardized events when the status changes. This proposal relies on and extends the existing EIP-721.
Motivation
NFT (token ID) commonly face the issue of insufficient market liquidity: the main reason being the lack of transparency in NFT pricing, making it difficult for users to cash out after trading and purchasing NFT (token ID).
With the introduction of the guarantor role, different guarantor groups can offer various price guarantees for NFT (token ID), establishing a multi-faceted price evaluation system for NFT (token ID).
After purchasing an NFT (token ID), users can return it to the guarantor at any time at the highest guaranteed price to protect their interests.
Additionally, after fulfilling their guarantee obligations, the guarantor can also request subsequent guarantors to provide guarantee obligations.
When an NFT (token ID) is owned by the guarantor, and since the guarantor can be a DAO organization, this expansion allows the NFT (token ID) to continue operating as a DAO, thus further enhancing the social or community recognition of the NFT (token ID).
Specification
The keywords “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
Every contract compliant to the ERC721Guarantee MUST implement the IERC721Guarantee guarantee interface.
The guarantee extension is OPTIONAL for EIP-721 contracts.
pragmasolidity^0.8.20;// import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
/// @title EIP-721 Guarantor Role extension
/// Note: the EIP-165 identifier for this interface is
interfaceIERC721Guarantee/*is IERC721*/{/// @notice Emitted when `guarantee contract` is established for an NFT
/// @param user address of guarantor
/// @param value The guarantee value provided by dao
/// @param DAO DAO organization providing guarantee
/// @param tokenId Guaranteed NFT (token ID),
eventGuaranteeIsEstablshed(addressuser,uint256value,addressDAO,uint256indexedtokenId);/// @notice Emitted when `guarantee contract` is canceled
/// @dev Some users in the closed DAO request a reduction in their guarantee share
/// @param user address of guarantor
/// @param value The guarantee value provided by dao
/// @param DAO DAO organization providing guarantee
/// @param tokenId Guaranteed NFT (token ID),
eventGuaranteeIsCancel(addressuser,uint256value,addressDAO,uint256indexedtokenId);/// @notice Emitted when `Guarantee sequence` is established for an NFT
/// @param userGuaranteed address of guaranteed
/// @param number block.number of transaction,
/// and all DAOs established before this point will enter the guarantee sequence
/// @param DAOs DAO sequence providing guarantee
/// @param tokenId Guaranteed NFT (token ID),
eventGuaranteeSequenceIsEstablshed(addressuserGuaranteed,uint256number,addressDAOs,uint256indexedtokenId);/// @notice A user's evaluation for an NFT (token ID)
/// @dev Set the guarantee information for one guarantor,
/// Throws if `_tokenId` is not a valid NFT
/// @param value user's evaluation for an NFT, the oledr value is canceled,
/// @param user address of guarantor
/// @param weight guarantee weight for guarantor
/// @param tokenId The NFT
/// @return the error status of function execution
functionsetNFTGuarantedInfo(uint256value,addressuser,uint256weight,uint256tokenId)externalreturns(uint256);/// @notice Establish guarantee sequence for an NFT (token ID) and split the commission
/// @dev Each NFT(token ID) retains a current guarantee sequence,
/// and expired guarantee sequences are no longer valid,
/// Throws if `_tokenId` is not a valid NFT
/// @param valueCommission Commission for a transactions
/// @param userGuaranteed address of guaranteed
/// @param number block.number of transaction,
/// and all DAOs established before this point will enter the guarantee sequence
/// @param tokenId The NFT
/// @return the error status of function execution
functionestablishNFTGuarantee(uint256valueCommission,addressuserGuaranteed,uint256number,uint256tokenId)externalreturns(uint256);/// @notice Transactions that fulfill the guarantee responsibility
/// @dev The new accountability transaction also requires
/// the construction of a new guarantee sequence
/// Throws if `_tokenId` is not a valid NFT or userGuaranteed is not right
/// @param userGuaranteed address of guaranteed
/// @param tokenId The NFT
/// @return the error status of function execution
functionFulfillGuaranteeTransfer(addressuserGuaranteed,uint256tokenId)externalreturns(uint256);}
Rationale
Key factors influencing the standard:
Pay attention to ensuring fairness between and within groups when allocating commissions
Keeping the number of guarantee groups (DAOs)in the interfaces to prevent contract bloat
The guarantee group is a DAO contract, which MUST implement the ERC721TokenReceiver interface
Simplicity
Gas Efficiency
Backwards Compatibility
This standard is compatible with current EIP-721 standards. There are no other standards that define a similar role for NFTs and the name (Guarantor) is not used by other EIP-721 related standards.
Reference Implementation
The reference implementation will be provided later.