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

[Feature]: ERC-721 Metadata hooks #79

Open
1 task done
rsodre opened this issue Jun 29, 2024 · 2 comments · May be fixed by #80
Open
1 task done

[Feature]: ERC-721 Metadata hooks #79

rsodre opened this issue Jun 29, 2024 · 2 comments · May be fixed by #80

Comments

@rsodre
Copy link

rsodre commented Jun 29, 2024

Feature Request

Add a hook to Origami ERC-721 implementation to customize token_uri().

Proposed Solution

  • Create ERC721MetadataHooksTrait , containing a function custom_uri(), that can be implemented by the token contract.
  • This function will be called internally by called internally by erc721_metadata_component::token_uri() to customize its results.
  • The custom hook implementation is optional, and if not implemented, the token contract will have to import ERC721MetadataHooksEmptyImpl, an empty implementation that should not affect the standard uri.

Alternatives

Teh only way to customize the token uri is to clone erc721_metadata_component and use it on the token contract, instead of using Origami's own.

Related Code

OpenZeppelin has similar hooks at their ERC721 and ERC20 implementations

Additional context

This hook is required to allow fully on-chain metadata.

If the feature is accepted, would you be willing to contribute it?

  • Yes I would be willing to contribute
@rsodre rsodre linked a pull request Jun 29, 2024 that will close this issue
6 tasks
@ooochoche
Copy link

ooochoche commented Jun 29, 2024

@rsodre I could work on this since it is yet to be assigned

@rsodre
Copy link
Author

rsodre commented Jun 29, 2024

@rsodre I could work on this since it is yet to be assigned

I'm not an admin on this repository.
But I'm already working on it for a personal project, and proposing a PR with my changes.

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 a pull request may close this issue.

2 participants