Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precalculate TokenIds? #467

Open
genecyber opened this issue Jun 30, 2023 · 1 comment
Open

Precalculate TokenIds? #467

genecyber opened this issue Jun 30, 2023 · 1 comment

Comments

@genecyber
Copy link

I really would like to use these new features, but have one significant issue. It appears part of the magic is with sequential toeknIds. My application associates a tokenID with an off chain asset. Typically I do this by generating my tokenID based off a few bits of information known before mint.

If sequential only, my prior method of associating a tokenID with an item is fraught with race conditions.

1: is it possible to mint out of order?
2: if not, is there a way to provide info at mint time to associate a tokenID with some key that I can use to associate with a specific off chain “thing”?

@nidhhoggr
Copy link

  1. minting out of order is not possible
  2. Yes, you can make an internal call to setExtraDataAt which stores an uint24 at the specified mintIndex
    function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants