-
Notifications
You must be signed in to change notification settings - Fork 842
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
Remove tokenOfOwnerByIndex #107
Remove tokenOfOwnerByIndex #107
Conversation
I think The line containing Line 143 in 34788d8
|
Yes, removed Kept the inheritance in order to qualify this reference in |
@fulldecent I did this #81 a week ago. Waiting for signal to rebase. |
Right but #81 adds a new extension. I don't think that new extension should exist. |
It moves IERC721Enumerable to an extension, so that ERC721A is free of it.
Why ? There're very selected cases in which ERC721Enumerable functions may be useful on-chain. Always been the same deal with OZ: they moved IERCEnumerable because they couldn't assume that it would never be make sense... |
OpenZeppelin contracts includes ERC721Enumerable because it is a feasible extension. It is implemented as O(1). ERC721Enumerable is not O(1), therefore ERC721Enumerable is not feasible here. I think the threshold for this repository should be/is: "things that people probably want with ERC721A". Not "dangerous things that we have to warn people not to use and that nobody specifically wants and which are basically not compatible with ERC721A". Therefore the extension should not be included here. But again, this repo is missing a mission scope, so I cannot argue further on this topic without any source of authority. |
I'm in agreement with @fulldecent here - these functions were originally implemented to market gas improvements, but ERC721A has become primarily a means of minting tokens in batch efficiently. At the current point in time we want to make this contract as safe as possible and prevent someone from doing something dangerous. We will update the README with a better mission statement shortly |
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.
Approving this, but will wait a day or so before merging so our community members can add their thoughts
this "feasibility" you mention is highly debatable. Only that the issue isn't security related, but gas related: devs who don't know better keep implementing this extension that takes ~2M gas for minting 20 tokens for no functional reason in most cases. Now this is not a subject for this repo. Anyway, this is a bit disappointing that someone put the work into changing this as requested here, and that you would choose to submit a new PR instead of commenting an existing one... FYI this line should be removed: Line 9 in 584d073
|
Developers /do/ know better and they have /chosen/ to implement ERC721Enumerable. Very many projects do this. There is nothing wrong this this extension. The tradeoffs have been discussed thoroughly in the standardization process and this is implemented in the first ERC-721 token. Arguing this in either direction probably won't go anywhere. Especially against me. For OpenZeppelin Contracts, a good implementation of a well-known standard, following the specifications, and achieving O(1) complexity is in scope for that project. Their implementation meets those requirements, that's why it's published in that project. If you want to feel better, watch me embarrass myself by developing a huge PR with the team and then the /real/ decision maker decides they don't have time to review PRs any more. I have piles of examples like this. |
I'll agree with you on this: it is completely pointless !
You don't know better is all: have a chat with OZ devs before you mention it. You're talking about EIP when I talk specifically about OZ ERC721Enumerable impl being unoptimized gas-wise, nothing related there.
Nothing closely related to this situation ! This is not about you: open source is about collaboration, disrespecting other's work to flatter your ego certainly isn't the spirit. Wasted enough of my time already, I'm done here. |
If there are unresolved criticisms here of the OpenZeppelin Contracts Also I just want you to know I appreciate this discussion here and that PR that's being discussed. Arguing about a PR's acceptability doesn't change that. |
Just leaving this here for those interested. https://www.twitch.tv/videos/1299266697 <- (around 48 minute mark) I've asked William about his thoughts on ERC721A. Specifically on the enumerable parts, and whether we should include a convenience Designing standards / libraries to be efficient, future proof, and generalizable requires a lot of thought. |
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.
As @Vectorized and @syffs mentioned earlier, Shouldn't these lines be deleted?
Line 9 in f3205a7
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol'; |
Line 175 in f3205a7
interfaceId == type(IERC721Enumerable).interfaceId || |
Edit:
I see now it's for the reference, but still are these lines, especially L175 in supportsInterface
required?
Fixes #69 (ish)
tokenOfOwnerByIndex
is incompatible with ERC721a. AndtokenWithIndex
is incompatible if there will be burning. This PR removes it.Therefore we lose ERC721Enumerable extension. That's fine.
But we also keep tokenbyIndex and totalSupply. It is fine to implement these functions even though we are not implementing ERC721Enumerable. Nobody says we can't do this.