Skip to content

Conversation

AugmentedMode
Copy link
Contributor

@AugmentedMode AugmentedMode commented Sep 16, 2025

Explanation

This PR integrates the bulk token screening functionality from the PhishingController into the TransactionController's transaction simulation workflow. When a transaction simulation completes with received tokens, those tokens are scanned in a fire and forget method.

Changes introduced

  • Added #bulkScanReceivedTokens method that scans tokens received during transaction simulation
  • Added PhishingController:bulkScanTokens to the TransactionController's allowed actions
  • Integrated token screening into the #afterSimulate workflow as a fire and forget
  • Filters received tokens from simulation data and passes them to PhishingController for bulk screening

Screenshot showcasing the tokenScanCache is implemented as expected

This is grabbed via the extension console using await stateHooks.getPersistedState() after triggering a swap in uniswap. You will notice i was doing a swap for USDC which is the only token address stored in the cache.

Screenshot 2025-09-15 at 10 28 15 AM

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@AugmentedMode AugmentedMode requested review from a team as code owners September 16, 2025 00:33
@AugmentedMode AugmentedMode changed the base branch from main to feat/add-bulk-token-screening September 16, 2025 00:33
@AugmentedMode AugmentedMode self-assigned this Sep 16, 2025
@AugmentedMode AugmentedMode changed the title Feat/add token screening tx controller feat: Add bulk token scanning and introduce shared cache manager Sep 16, 2025
@AugmentedMode AugmentedMode changed the title feat: Add bulk token scanning and introduce shared cache manager feat: Integrate bulk token screening into transaction simulation flow within runAfterSimulateHook Sep 16, 2025
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