Skip to content

Conversation

@iuwqyir
Copy link
Contributor

@iuwqyir iuwqyir commented Mar 4, 2025

TL;DR

Added support for ERC1155 token amount parsing in token balance materialized view

What changed?

Updated the token balance calculation logic to properly handle ERC1155 token amounts by parsing the data field when it contains batch transfer information (130 characters). For ERC1155 transfers, it now extracts the amount from the appropriate position in the data field, defaulting to 1 if not present.

Why make this change?

ERC1155 tokens can transfer multiple tokens in a single transaction. The previous implementation treated all ERC1155 transfers as single unit transfers, which was incorrect for batch transfers. This change ensures accurate token balance tracking for ERC1155 tokens.

Copy link
Contributor Author

iuwqyir commented Mar 4, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@iuwqyir iuwqyir requested a review from a team March 4, 2025 10:52
@iuwqyir iuwqyir marked this pull request as ready for review March 4, 2025 10:52
@iuwqyir iuwqyir force-pushed the 03-04-fix_erc1155_single_transfers_materialized_view branch from b78de2d to c387c59 Compare March 4, 2025 20:44
@iuwqyir iuwqyir merged commit 73eeb25 into main Mar 4, 2025
5 checks passed
@iuwqyir iuwqyir deleted the 03-04-fix_erc1155_single_transfers_materialized_view branch March 4, 2025 20:45
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.

3 participants