Skip to content

Realign#70

Closed
CedrikNikita wants to merge 7 commits intodevelopfrom
main
Closed

Realign#70
CedrikNikita wants to merge 7 commits intodevelopfrom
main

Conversation

@CedrikNikita
Copy link
Contributor

@CedrikNikita CedrikNikita commented Mar 10, 2026

Note

Medium Risk
Touches core transaction validation/processing and event decoding logic, so mistakes could skip or mis-derive trades; changes are localized and covered by new unit tests.

Overview
Improves BCL transaction ingestion robustness by allowing reprocessing of previously persisted broken buy/sell rows (zero volume / NaN price fields) and by skipping failed/reverted transactions based on returnType/return_type.

Adds a raw tx.raw.log fallback decoder in TransactionsService.decodeTxEvents() for buy/sell/create flows when ABI decoding yields no events, and makes TransactionProcessorService throw on live buy/sell transactions that still lack decoded events (to force later reprocessing) instead of persisting derived zero/NaN data.

Hardens a few edges: TransactionsController.listTransactions() now returns an empty page when token lookup fails, and TokensService.getTokenContractsBySaleAddress() treats common bytecode/ACI mismatch errors as “unsupported contract” (warn + return undefined). Tests were added/updated to cover the new validation, fallback decoding, and controller behavior.

Written by Cursor Bugbot for commit f3923a8. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

error,
error.stack,
);
return undefined;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New code breaks contract caching, returns stale/undefined value

High Severity

The newly inserted lines 396–418 in getTokenContractsBySaleAddress are placed before the original contract-caching assignment at lines 419–424. Line 396 does return this.contracts[saleAddress] immediately after fetching instance and tokenContractInstance, but before they are stored into this.contracts[saleAddress]. Since the cache guard at line 379 already returned early for cached entries, this.contracts[saleAddress] is undefined here, so the function always returns undefined for uncached addresses. Additionally, return undefined at line 418 makes the original caching code (lines 419–424) and the original retry-capable catch block (line 427) completely unreachable dead code. This breaks token creation, price syncing, and all callers of this method.

Additional Locations (1)
Fix in Cursor Fix in Web

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