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

Add ERC721 preset #811

Merged
merged 76 commits into from
Nov 25, 2023
Merged

Conversation

andrew-fleming
Copy link
Collaborator

@andrew-fleming andrew-fleming commented Nov 6, 2023

Fixes (partial) #804 and #693.

PR Checklist

  • Tests
  • Tried the feature on a public network
  • Documentation

@martriay martriay linked an issue Nov 10, 2023 that may be closed by this pull request
@andrew-fleming andrew-fleming marked this pull request as ready for review November 10, 2023 20:16
@martriay martriay linked an issue Nov 22, 2023 that may be closed by this pull request
Comment on lines 14 to 15
component!(path: SRC5Component, storage: src5, event: SRC5Event);
component!(path: ERC721Component, storage: erc721, event: ERC721Event);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should swap the components to make ERC721 appear first (this applies to impls below too). That is consistent with the Account Preset as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree in the sense that it's the "main" component, but I switched it because Access appears first in the imports and IMO it appears more organized that way. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm, got your point, but I still think it makes more sense to have the main component first, instead of letting the imports decide. We still need to define the rule for this, but I don't like the one coming from import orders that much 😢

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair, and we also already have the account preset using the suggested approach. I'll update and we can maybe revisit in the future

Copy link
Contributor

@martriay martriay Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i actually like SRC5 first, as it's a dependency of ERC721. also, not sure if there's always going to be a "main component", and it's not clear to me that's a concept we want to suggest or push.

+1 to not inheriting order from imports

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, not sure if there's always going to be a "main component", and it's not clear to me that's a concept we want to suggest or push.

+1 to not inheriting order from imports

Let's say we create an ownable, pausable ERC20 preset. There's no component dependency like with SRC5. If we're not using the main component approach and we're not inheriting order from imports, how else can we organize the component declarations?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we don't need a rule for that

Copy link
Member

@ericnordelo ericnordelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides perhaps the XYZ discussion for changes pending to be released, I think this is good to go!

Copy link
Contributor

@martriay martriay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Looks good to me.

Opened an issue to track adding it to the docsite.

src/tests/presets/test_erc721.cairo Outdated Show resolved Hide resolved
src/tests/presets/test_erc721.cairo Outdated Show resolved Hide resolved
Copy link
Contributor

@martriay martriay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@martriay martriay merged commit 20c91c2 into OpenZeppelin:main Nov 25, 2023
4 checks passed
@andrew-fleming andrew-fleming deleted the add-erc721-preset branch November 27, 2023 01:43
@andrew-fleming andrew-fleming mentioned this pull request Jan 9, 2024
4 tasks
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

Successfully merging this pull request may close these issues.

Add vanilla presets Add _mint to erc721 constructor
3 participants