ERC-7652 ERC-721 guarantee extension
Draft · NFTs & multi-token · created 2024-03-10
An ERC-721 extension that adds a guarantor role to an NFT, letting the holder return the NFT to the guarantor at any time in exchange for receiving the circulating token at the guaranteed price.
Why it is needed
NFTs often suffer from poor market liquidity because prices are not transparent. Once you buy one, it is hard to know how much you could resell it for, and if you cannot find a buyer, you cannot cash out at all. This standard solves the problem by introducing the role of guarantor. When multiple groups of guarantors each offer different price guarantees for the same NFT, that itself becomes a multi-sided price evaluation system for the NFT. A buyer can at any time return the NFT to a guarantor at the highest guaranteed price and recover funds to limit losses. A guarantor who fulfills a guarantee obligation can in turn demand fulfillment from the next guarantor in the sequence. Because a guarantor can be a DAO, the NFT can continue to be operated as a DAO after ownership passes to the guarantor, building social or community recognition.
What to implement
function FulfillGuaranteeTransfer(address userGuaranteed, uint256 tokenId) external returns (uint256);: Carries out the transaction that fulfills the guarantee obligation. A new obligation fulfillment transaction requires establishing a new guarantee sequence.
In depth
An optional extension to ERC-721
This standard is an extension that adds a guarantor role to existing ERC-721, and it is OPTIONAL for ERC-721 contracts. A contract conforming to ERC721Guarantee MUST implement the IERC721Guarantee interface. It requires ERC-165 and ERC-721 (requires: 165, 721), and emits standardized events when state changes occur. The name Guarantor is not used in any other ERC-721-related standard, so it remains compatible with existing standards.
setNFTGuarantedInfo: setting a guarantor's appraisal and stake
A function that lets a user set an appraisal for a specific NFT (token ID). The arguments are the appraised value, the guarantor's address user, the guarantee weight, and the target tokenId; it sets the guarantee information for one guarantor. Setting a new value cancels the previous value. It fails (throws) if tokenId is not a valid NFT, and the return value is the error status of the function execution.
establishNFTGuarantee: establishing the guarantee sequence and distributing fees
A function that establishes the guarantee sequence for a specific NFT and splits the fee. The arguments are the transaction fee valueCommission, the guaranteed party's address userGuaranteed, number, which is the block.number of the transaction, and the target tokenId. All DAOs established before the time of number are included in the guarantee sequence. Each NFT maintains a single current guarantee sequence, and an expired guarantee sequence is no longer valid. It fails if tokenId is not valid.
FulfillGuaranteeTransfer: fulfilling the guarantee obligation
A function that carries out the transaction fulfilling the guarantee obligation. The arguments are the guaranteed party's address userGuaranteed and the target tokenId. A new obligation fulfillment transaction requires establishing a new guarantee sequence. It fails if tokenId is not a valid NFT or userGuaranteed is incorrect, and the return value is the error status of the function execution.
Three standard events
GuaranteeIsEstablshed fires when a guarantee contract is established on an NFT, and GuaranteeIsCancel fires when a guarantee contract is canceled, which happens when some users of a closed DAO request a reduction in guarantee stake. GuaranteeSequenceIsEstablshed fires when a guarantee sequence is established, and it carries information that all DAOs established before the reference block number (number) are included in the sequence. In all three events, tokenId is declared as indexed.
Design principles: fairness, simplicity, gas efficiency
Care was taken to ensure fairness between guarantor groups and within a group when distributing fees. The number of guarantor groups (DAOs) held in the interface is managed so the contract does not become bloated. A guarantor group is a DAO contract and MUST implement the ERC721TokenReceiver interface. Beyond that, simplicity and gas efficiency were used as design criteria.
A proposal still at the Draft stage
This proposal is in Draft status, so its content may still change. The reference implementation is yet to be provided, and the Security Considerations section only states that it Needs discussion, meaning the proposal is not yet complete.