This standard is an extension of ERC-721. It proposes adding a nonce function to ERC-721 tokens.
Motivation
Some orders of NFT marketplaces have been attacked and the NFTs sold at a lower price than the current market floor price. This can happen when users transfer an NFT to another wallet and, later, back to the original wallet. This reactivates the order, which may list the token at a much lower price than the owner would have intended.
This EIP proposes adding a nonce property to ERC-721 tokens, and the nonce will be changed when a token is transferred. If a nonce is added to an order, the order can be checked to avoid attacks.
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.
/// @dev the ERC-165 identifier for this interface is 0xce03fdab.
interfaceIERC5008/* is IERC165 */{/// @notice Emitted when the `nonce` of an NFT is changed
eventNonceChanged(uint256tokenId,uint256nonce);/// @notice Get the nonce of an NFT
/// Throws if `tokenId` is not a valid NFT
/// @param tokenId The id of the NFT
/// @return The nonce of the NFT
functionnonce(uint256tokenId)externalviewreturns(uint256);}
The nonce(uint256 tokenId) function MUST be implemented as view.
The supportsInterface method MUST return true when called with 0xce03fdab.
Rationale
At first transferCount was considered as function name, but there may some case to change the nonce besides transfer, such as important properties changed, then we changed transferCount to nonce.