estarriolvetch / ERC721Psi

MIT License
117 stars 29 forks source link

_exists function #10

Closed pale-aura closed 1 year ago

pale-aura commented 2 years ago

image

Shouldn't this be tokenId <= _minted instead of just tokenId < _minted ?

If I mint only 1 token, the function will return false for _exists(1).

Also breaks if I pass in tokenId of 0.

estarriolvetch commented 2 years ago

The tokenId starts with zero. It's why it is less.

What do you mean by "Also breaks if I pass in tokenId of 0."?

-------- Original Message -------- On Jun 30, 2022, 5:56 PM, pale-aura wrote:

image

Shouldn't this be tokenId <= _minted instead of just tokenId < _minted ?

If I mint only 1 token, the function will return false for _exists(1).

Also breaks if I pass in tokenId of 0.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

pale-aura commented 2 years ago

Oh ok I see now. Thanks for clarifying.

What was the reason for starting token id at 0? I think that could be a deal breaker for a lot of projects because it creates a weird user experience.

estarriolvetch commented 2 years ago

It's a more natural indexing option in coding, and the original ERC721A also uses that.

I am thinking of adding support for changing starting index, but I haven't get a chance to do that. Let me know if you are interested in sending a PR.

-------- Original Message -------- On Jul 2, 2022, 2:13 PM, pale-aura wrote:

Oh ok I see now. Thanks for clarifying.

What was the reason for starting token id at 0? I think that could be a deal breaker for a lot of projects because it creates a weird user experience.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>