Labels: medium-difficulty, yul, tokens, gasguard
Difficulty: Medium
Module: contracts/utils/
🧠 Concept
Develop a view helper that queries balance states for multiple ERC-20 tokens across multiple accounts within a single static assembly call loop.
⚠️ Problem
Querying token balances individually over standard high-level interfaces incurs substantial call setup and return data decoding overhead per token.
📁 Implementation Scope
contracts/utils/BatchBalanceChecker.sol
test/utils/BatchBalanceChecker.test.ts
🛠️ Requirements
- Construct
balanceOf(address) selector in memory once.
- Iterate through target tokens and accounts using low-level
staticcall.
- Pack balance outputs directly into an assembly-allocated memory buffer.
🎯 Acceptance Criteria
Labels:
medium-difficulty,yul,tokens,gasguardDifficulty: Medium
Module:
contracts/utils/🧠 Concept
Develop a view helper that queries balance states for multiple ERC-20 tokens across multiple accounts within a single static assembly call loop.
Querying token balances individually over standard high-level interfaces incurs substantial call setup and return data decoding overhead per token.
📁 Implementation Scope
contracts/utils/BatchBalanceChecker.soltest/utils/BatchBalanceChecker.test.ts🛠️ Requirements
balanceOf(address)selector in memory once.staticcall.🎯 Acceptance Criteria