-
Notifications
You must be signed in to change notification settings - Fork 75
fix: add BalanceNode smart defaults and template variable support for token addresses #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
chrisli30
commented
Oct 8, 2025
- 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
… 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.
There was a problem hiding this 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.