Skip to content

Conversation

@mablr
Copy link
Contributor

@mablr mablr commented Oct 27, 2025

Closes #1498

Batching balanceOf call for erc20 assets

@mablr mablr marked this pull request as ready for review October 29, 2025 17:16
@mablr mablr requested a review from joshieDo as a code owner October 29, 2025 17:16
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

cool

I find this section a bit harder to read now, because we have a few nested levels

any idea how to structure this a bit @joshieDo ?

src/rpc/relay.rs Outdated
Comment on lines 2760 to 2764
let mut multicall = chain_provider.multicall().dynamic();
for address in &erc20_addresses {
let erc20 = IERC20::new(address.address(), &chain_provider);
multicall = multicall.add_dynamic(erc20.balanceOf(request.account));
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this is basically

chain_provider.multicall().dynamic().extend(...);

then we can shorten this entire section a bit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just applied the change.

This is more idiomatic, but not significantly shorter.😅

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.

Improve wallet_getAssets

2 participants