-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Ability to set starting token id for ERC721Consecutive #4097
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b693f7f
first consecutive id
kfishnchips bf8c076
linting and changeset
kfishnchips 31a565b
using bound instead of assume and small test refactor
kfishnchips b651b93
modify transfer test to include starting token id
kfishnchips 854b461
checking boundaries
kfishnchips 1c7570d
reduce lookup and rename function for clarity
kfishnchips ab40061
rename _totalConsecutiveSupply → _nextConsecutiveId
Amxx 1835727
Merge remote-tracking branch 'kfishnchips/master'
Amxx 1fdcbff
Update .changeset/spotty-hotels-type.md
kfishnchips 44cc563
fix minor bug
Amxx 3f8b0f9
Merge branch 'master' of github.com:kfishnchips/openzeppelin-contracts
Amxx 573fa0d
test multiple offsets
Amxx 5d9b21b
make firstConsecutiveId immutable in fuzz tests
Amxx 0fcb048
fix lint
Amxx dd1d6bf
Merge branch 'master' into master
kfishnchips 361aa8d
Update docs
ernestognw 114a3f6
Merge branch 'master' into master
kfishnchips 6b4e4ee
Merge branch 'master' into master
kfishnchips 78ed610
Merge branch 'master' into master
kfishnchips 7959df3
Merge branch 'master' into master
kfishnchips File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
rename _totalConsecutiveSupply → _nextConsecutiveId
- Loading branch information
commit ab40061324fdbca5c086a37d7b005a1700c67cab
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think
0 to _firstConsecutiveId()should be accounted for the_totalConsecutiveSupply, it affects line 135, which will be excluding the after hook for real burnedtokenIdsFor example:
_firstConsecutiveId()with a5tokenIds from 5 to 9 (5 mints)2via normal minting_sequentialBurnon theownerOf(...)method, which is not what we wantI think this is what we should aim for:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make more sense for someone to consecutively mint token
10instead of2? I was thinking that there could be no minting below the first consecutive id.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would requiring that the tokenId be greater than the last batch minted one in the
_mintfunction be a viable option? It might be too inefficient...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is something we don't want, because it adds 2 (cold) sload to the mint operation, which we want to keep as cheap as possible.
Also, if we do that, it would be impossible to
_minta token that was first minted as part of a batch then burnt.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that mint already check if the tokenId has an owner, and revert if that is the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, I'm still wrapping my head around the internals of this but I think I got it.