[BCN] Fix ERC-20 effect materialization - #4209
Open
msalcala11 wants to merge 1 commit into
Open
Conversation
msalcala11
force-pushed
the
fix-erc20-txs
branch
from
July 29, 2026 21:25
cbb4159 to
d311f3f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Before this fix, Bitcore tried to identify ERC-20 transfers by decoding transaction input and traced contract calls. That approach describes what a contract was asked to do, but not always what actually happened on-chain. It could miss transfers made through proxies or custom contract methods, include calls that did not produce a transfer, or report the wrong sender, recipient, or token.
This fix uses the ERC-20
Transferevents produced by confirmed blocks as the source of truth. It validates each event against the block and transaction, stores the result with the transaction, and uses it for transaction history, wallet matching, and balance cache updates.This is needed to make ERC-20 transaction data accurate and consistent while safely updating existing records.
Changelog
Transferevents while processing EVM blocks.Testing Notes
From
packages/bitcore-node, run:npm run test:unitnpm run test:integrationFor manual testing, run the backfill tool with
--dry-runagainst a small known block range. Confirm that it finds the expected transfers without writing changes, then check transaction history for the sender and recipient addresses.Checklist