/evm-balances

`balanceOf` except it checks against many ERC20 tokens at once

Primary LanguageTypeScriptGNU General Public License v3.0GPL-3.0

EVM Multicoin Balances Smart Contract and HTTP API

This is like balanceOf but for multiple coins. It takes 2 inputs, a wallet address and an array of coin addresses. It returns an array of balances for each coin. The first element of the array is the wallet balance of the native coin of the chain.

For contract code, see packages/core/src/Balances.sol.

For usage example, see the packages/core/example/balances.ts.

For HTTP API (deployed on Cloudflare Workers), see apps/api.

Deployed Contracts

Network Address
Ethereum 0x13675852Ac733AEd5679985778BE5c18E64E97FA
Arbitrum 0x77e883446e4cDE8955b4ce07DfCf0E9887B0e66c
Optimism 0xc9bA77C9b27481B6789840A7C3128D4f691f8296
Polygon 0x8b08FE6F8443f7bBbEde50Ecc8B020d9e44997a2
Avalanche 0xc9bA77C9b27481B6789840A7C3128D4f691f8296
Celo 0x5D88da6682B9088B9e31c900Be850de20cF20B11
Gnosis 0x5D88da6682B9088B9e31c900Be850de20cF20B11
Harmony One 0xc9bA77C9b27481B6789840A7C3128D4f691f8296
Moonbeam 0x5D88da6682B9088B9e31c900Be850de20cF20B11
Fantom 0xc9bA77C9b27481B6789840A7C3128D4f691f8296
BSC 0xc9bA77C9b27481B6789840A7C3128D4f691f8296
Aurora 0xc9bA77C9b27481B6789840A7C3128D4f691f8296
Goerli 0x694be3BCecAf1dD69ba91D21c54E22C87882a595
Sepolia 0x5D88da6682B9088B9e31c900Be850de20cF20B11
Polygon Mumbai 0x5D88da6682B9088B9e31c900Be850de20cF20B11
Optimism Goerli 0x5D88da6682B9088B9e31c900Be850de20cF20B11
Arbitrum Goerli 0xc9bA77C9b27481B6789840A7C3128D4f691f8296
Fantom Testnet 0xc9bA77C9b27481B6789840A7C3128D4f691f8296
Base Goerli 0x4a54047B53C5B011b00AcBdec84c090e6Cc175E2
{
  "ethereum": "0x13675852Ac733AEd5679985778BE5c18E64E97FA",
  "arbitrum": "0x77e883446e4cDE8955b4ce07DfCf0E9887B0e66c",
  "optimism": "0xc9bA77C9b27481B6789840A7C3128D4f691f8296",
  "polygon": "0x8b08FE6F8443f7bBbEde50Ecc8B020d9e44997a2",
  "celo": "0x5D88da6682B9088B9e31c900Be850de20cF20B11",
  "gnosis": "0x5D88da6682B9088B9e31c900Be850de20cF20B11",
  "harmonyOne": "0xc9bA77C9b27481B6789840A7C3128D4f691f8296",
  "moonbeam": "0x5D88da6682B9088B9e31c900Be850de20cF20B11",
  "avalanche": "0xc9bA77C9b27481B6789840A7C3128D4f691f8296",
  "fantom": "0xc9bA77C9b27481B6789840A7C3128D4f691f8296",
  "bsc": "0xc9bA77C9b27481B6789840A7C3128D4f691f8296",
  "aurora": "0xc9bA77C9b27481B6789840A7C3128D4f691f8296",
  "goerli": "0x694be3BCecAf1dD69ba91D21c54E22C87882a595",
  "sepolia": "0x5D88da6682B9088B9e31c900Be850de20cF20B11",
  "polygonMumbai": "0x5D88da6682B9088B9e31c900Be850de20cF20B11",
  "optimismGoerli": "0x5D88da6682B9088B9e31c900Be850de20cF20B11",
  "arbitrumGoerli": "0xc9bA77C9b27481B6789840A7C3128D4f691f8296",
  "fantomTestnet": "0xc9bA77C9b27481B6789840A7C3128D4f691f8296",
  "avalancheFuji": "0xc9bA77C9b27481B6789840A7C3128D4f691f8296",
  "baseGoerli": "0x4a54047B53C5B011b00AcBdec84c090e6Cc175E2"
}