> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tavchain.safeney.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Read an ERC-20 token balance

> Query ERC-20 balanceOf and decimals using a token contract, distinguish token balances from native TAV and format raw amounts safely.

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.

> [!NOTE]
>
> You can inspect the [verified GLD reference contract](https://explorer.tavchain.safeney.com/address/0x9FEE6A0eAf071Dc6fFa1B6193cE1ab52E085F525?tab=contract) on Tavchain Testnet, chain ID **771002**. It is a valueless demonstration token, separate from native TAV. The [Hardhat guide](https://docs.tavchain.safeney.com/tavchain/hardhat.md#example-deployment) 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](https://explorer.tavchain.safeney.com/).
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](https://docs.tavchain.safeney.com/tavchain/erc20-token.md#read-the-supply-and-balance) 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](https://docs.tavchain.safeney.com/tavchain/hardhat.md#example-deployment) 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](https://docs.tavchain.safeney.com/tavchain/erc20-token.md) · [Native balance](https://docs.tavchain.safeney.com/tavchain/api/account.md) · [RPC reference](https://docs.tavchain.safeney.com/tavchain/http-api.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.