Skip to main content
Read an ERC-20 token balance by calling the deployed token’s balanceOf(address) method. Use that token’s ABI and contract address on Tavchain Testnet.
You can inspect the verified GLD reference contract on Tavchain Testnet, chain ID 771002. It is a valueless demonstration token, separate from native TAV. The Hardhat guide links its deployment and transfer transactions.

Choose the asset

Confirm the chain ID and token contract address before querying. A symbol such as GLD is not a unique identifier. Native TAV uses eth_getBalance; an ERC-20 keeps its own balances in contract state.

Read in Remix or the explorer

  1. Open your deployed ERC-20 in Remix, or open a verified token contract’s read interface in the explorer.
  2. Find balanceOf and enter the holder’s public EVM address.
  3. Read the returned integer.
  4. Read decimals() from that same contract and use it to format the amount.
The ERC-20 tutorial provides the complete GLD workflow and expected initial supply and balance. For the reference contract, decimals() returns 18 and totalSupply() returns 1000000000000000000000 (1,000 GLD). Holder balances depend on the queried block; the reference transfer records a comparison at block 10833.

Read from an application

Use an EVM client library with the token ABI to encode balanceOf(address) and perform eth_call against the token contract. The call returns ABI-encoded data, which the library decodes to an integer. Use a specific block when you need a reproducible comparison. A read-only call does not submit a transaction or require a wallet signature. Check RPC errors and confirm the contract actually implements the expected interface.

Decimals

Token decimals are independent of native TAV’s 18 decimals. For a token with 18 decimals, a raw balance of 1000000000000000000 displays as one token. Keep arithmetic integer-safe. Create an ERC-20 · Native balance · RPC reference