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

fix: Don't panic if tokenID is nil #148

Merged
merged 2 commits into from
Oct 30, 2023
Merged

fix: Don't panic if tokenID is nil #148

merged 2 commits into from
Oct 30, 2023

Conversation

tyler-smith
Copy link

@tyler-smith tyler-smith commented Oct 30, 2023

If for any reason the tokenID for an ERC721 or ERC1155 transfer is nil, skip calculating the URI. There is a most likely a better/more robust solution but this should prevent us from dying until such a solution is in place.

Example scenario: A Contract implements ERC1155, and additionally the same transfer method as ERC20. However the Contract is not an ERC20 it just has one of the same methods. When we parse transfers, we will still collect this as a transfer but there is no tokenID because it's not an ERC1155 transfer. Later when getting metadata, we see that the contract is not an ERC20 but is an ERC1155 so we get the metadata for that. It is now not safe to assume the transfer has a non-nil tokenID.

@tyler-smith tyler-smith merged commit c1d54c9 into main Oct 30, 2023
1 check passed
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.

1 participant