zhanymkanov / evm-multicall

1 RPC call to get balance from N tokens built with Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EVM Multicall with Rust & Web3

Request address's balance for USDC, USDT, and DAI/BUSD on Ethereum and BSC with 2 RPC calls, instead of 6.

How does it work

The program aggregates calls to each ERC-20's smart contract balanceOf methods and sends the bulk calldata to the chain's multicall contract.

Asynchronously, for each chain:

  1. Init a list of tokens to parse (e.g. USDC, USDT, BUSD) from ETH and BSC.
  2. Prepare ERC-20 calldata for each token smart contract.
  3. Convert ERC-20 calldata to Multicall calldata.
  4. Send calldata to multicall contract.

About

1 RPC call to get balance from N tokens built with Rust


Languages

Language:Rust 100.0%