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

Emit ERC-4906 metadata updates in "transferFrom" #670

Closed
PaulRBerg opened this issue Aug 28, 2023 · 2 comments
Closed

Emit ERC-4906 metadata updates in "transferFrom" #670

PaulRBerg opened this issue Aug 28, 2023 · 2 comments
Assignees

Comments

@PaulRBerg
Copy link
Member

The goal is to refresh the NFT SVG on platforms like OpenSea whenever the NFT is transferred around.

@andreivladbrg
Copy link
Member

andreivladbrg commented Sep 5, 2023

How should the implementation look like?

  1. emit an event only when transfer or transferFrom are called
  2. emit an event on transfer and also when burn and mint functions are called

Both versions require the implementation of _afterTokenTransfer hook. However, for the first version we would need to do similar as we did for _beforeTokenTransfer (checking for address(0)):

if (!isTransferable(streamId) && to != address(0) && from != address(0)) {

@PaulRBerg
Copy link
Member Author

Option 2, but note that transfer does not exist in ERC-721. Only transferFrom. I think you meant to say _transfer (notice the underscore)?

Yes, the implementation would go in _afterTokenTransfer. No need to check for the zero address in this case.

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

2 participants