Skip to content

usedId purpose in ERC721 #56

Open
Open
@pcaversaccio

Description

@pcaversaccio

In the IERC721Internal interface you define the following function usedId:

function usedId(uint256 tokenId) external view returns (bool);

I'm having a hard time to understand what is the reason behind using this as part of the interface. In your ERC721Compliant contract, you declare it but not use it:

mapping(uint256 => bool) public usedId;

If someone adds something like usedId[id] = true to the _customMint function, the following property always fails obviously:

assertWithMsg(!token.usedId(tokenId), "Token ID minted is not new");

If you want to track the used ids, you should update it after the above test assertion to make sense.

Furthermore, the README section on the ERC721 is outdated. There is no ITokenMock in the ERC721 case for example, but IERC721Internal. I would recommend making it consistent with the ERC20 example tho & updating the docs about the latest status quo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions