fix: second-class evm adapter tokens fetching - #11550
Conversation
The SecondClassEvmAdapter was using a static knownTokens array set at construction time. Due to initialization order (PluginProvider creates adapters before AppProvider loads assets), the token list was always empty. Changed to a getter function pattern so tokens are fetched from the asset service at call time, ensuring they're always available after the app initializes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe PR converts token provisioning across EVM chain adapters from static properties to lazy-evaluated getter functions, affecting the SecondClassEvmAdapter core class and all dependent chain implementations and plugin initializers. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (7)
🧰 Additional context used📓 Path-based instructions (6)**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{tsx,jsx}📄 CodeRabbit inference engine (.cursor/rules/error-handling.mdc)
Files:
**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/naming-conventions.mdc)
Files:
**/*.{jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/react-best-practices.mdc)
Files:
**/*.tsx📄 CodeRabbit inference engine (.cursor/rules/react-best-practices.mdc)
Files:
🧠 Learnings (15)📓 Common learnings📚 Learning: 2025-12-04T22:57:50.850ZApplied to files:
📚 Learning: 2025-12-17T14:50:01.629ZApplied to files:
📚 Learning: 2025-09-08T15:53:09.362ZApplied to files:
📚 Learning: 2025-11-12T12:49:17.895ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-10-23T14:27:19.073ZApplied to files:
📚 Learning: 2025-08-26T19:04:38.672ZApplied to files:
📚 Learning: 2025-09-04T17:29:59.479ZApplied to files:
📚 Learning: 2025-12-27T16:02:52.792ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-19T16:59:50.569ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
🧬 Code graph analysis (3)packages/chain-adapters/src/evm/hyperevm/HyperEvmChainAdapter.ts (4)
packages/chain-adapters/src/evm/plasma/PlasmaChainAdapter.ts (1)
src/plugins/plasma/index.tsx (5)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (9)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Going to yeet once CI passes to unrug release. |
Description
Fix race condition where second-class EVM chain adapters (HyperEVM, Monad, Plasma) were created with an empty token list because the asset service hadn't loaded yet. Changed from static
knownTokensarray to agetKnownTokens()getter function that fetches tokens dynamically at call time.Issue (if applicable)
closes #11549
Risk
Low - only affects second-class EVM chains token balance fetching. No changes to transaction handling or core functionality.
HyperEVM, Monad, and Plasma token balance display.
Testing
Engineering
Operations
Screenshots (if applicable)
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.