Skip to content

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

Notifications You must be signed in to change notification settings

zhanymkanov/evm-multicall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Topics

Resources

Stars

Watchers

Forks

Languages