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

Support EIP-4906 Metadata Update event for ERC721 #19

Open
ssa3512 opened this issue Apr 17, 2023 · 2 comments
Open

Support EIP-4906 Metadata Update event for ERC721 #19

ssa3512 opened this issue Apr 17, 2023 · 2 comments

Comments

@ssa3512
Copy link

ssa3512 commented Apr 17, 2023

EIP-4906 allows for the following events to be fired to signal to consumers that the JSON metadata for a token or set of tokens has changed.

event MetadataUpdate(uint256 _tokenId);
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);

It would be great if the creator core interfaces could support this to be triggered either by an extension or an admin. For instance, when the claim is updated for LazyMintable, the extension could call back into the creator contract to trigger a refresh of all tokens in the contract. Additionally, custom extensions or admins who are controlling metadata with other off-chain methods could manually trigger this when metadata is changed.

This functionality is natively supported by OpenSea to trigger a refresh of the metadata for the specified token ids.

@wwhchung
Copy link
Contributor

It’s not as straightforward as emitting the event, due to the extensions framework (as you pointed out).

  1. The extension itself can’t emit the event (the spec assumes the root contract emits the event)
  2. Getting the full set of impacted tokens may be gas inefficient, and the tokens may not be sequential.

Looking into how the interface could be changed to support this (Eg providing a method on the creator contract which is callable by any extension which causes the creator contract to emit an event). This is the suggestion you’ve mentioned.

If we did that, we would want to consider the implications of what is/isn’t allowed (Eg if we only allow events to be emitted for tokens created by that extension, it is extremely gas inefficient).

So it seems like the only viable way is to allow any registered extension to call the method with any range of tokens. Thinking through if this would cause any downstream issues. At the moment, it would seem that a malicious actor could trigger unnecessary load on the indexers.

@0xGh
Copy link

0xGh commented Sep 14, 2024

So it seems like the only viable way is to allow any registered extension to call the method with any range of tokens.

This is totally fine and it is then on the dev to decide when / how in the extension.

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

3 participants