Skip to content

Conversation

@chrisli30
Copy link
Member

  • fix: add BalanceNode smart defaults and template variable support for token addresses
  • Added .find() function test case to Branch
  • Add core/taskengine/vm_runner_contract_write_uniswap_test.go

Chris Li added 3 commits October 7, 2025 14:31
… token addresses

- Add intelligent address extraction from token objects (extracts id/address fields from {id, symbol} objects)
- Implement 3-phase token fetching strategy:
  * Phase 1: Fetch all tokens to get native token (ETH, BNB, etc.)
  * Phase 2: Fetch specific missing requested tokens
  * Phase 3: Synthesize zero-balance entries for tokens not returned by Moralis
- Add smart default: auto-enable includeZeroBalances when tokenAddresses is provided
- Ensure explicitly requested tokens are always returned, even with zero balance
- Add comprehensive test coverage for template variables and token synthesis
- Handle Moralis API limitation where tokens wallet never held are not returned

This fixes the issue where users requesting specific token addresses would not receive
all requested tokens if the wallet had never interacted with some of them.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds smart defaults and template variable support for token addresses in BalanceNode, implements comprehensive test cases for JavaScript find() expressions in Branch nodes, and introduces a complete Uniswap V3 contract interaction test demonstrating tuple parameter handling.

  • Enhances BalanceNode to intelligently extract addresses from token objects and automatically enable zero balance inclusion for specific token requests
  • Adds extensive test coverage for Branch node JavaScript expressions including case-sensitive address comparisons and numeric conversions
  • Creates comprehensive Uniswap V3 integration test with detailed documentation on ERC20 state overrides

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
core/taskengine/vm_runner_contract_write_uniswap_test.go New comprehensive Uniswap V3 test with tuple parameter handling and ERC20 state override documentation
core/taskengine/vm_runner_balance_test.go Added tests for template variable resolution and address extraction from token objects
core/taskengine/vm_runner_balance.go Enhanced token address resolution with smart defaults for zero balance inclusion
core/taskengine/vm_branch_execution_test.go Added extensive test cases for JavaScript find() expressions and case sensitivity
core/taskengine/TENDERLY_STATE_OVERRIDES.md New documentation file explaining ERC20 state override calculations
MANUAL_BLOCK_TRIGGER_IMPLEMENTATION.md Removed outdated implementation documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@chrisli30 chrisli30 merged commit a13baf9 into staging Oct 8, 2025
17 checks passed
@chrisli30 chrisli30 changed the title chris update staging fix: add BalanceNode smart defaults and template variable support for token addresses Oct 8, 2025
@chrisli30 chrisli30 deleted the chris-update_staging branch October 8, 2025 05:20
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.

2 participants