Skip to main content

Overview

The Bank precompile provides ERC20-style access to native Cosmos SDK tokens, enabling smart contracts to query balances and token supplies through standardized interfaces. It serves as a Solidity wrapper around the Cosmos SDK x/bank module. Address: 0x0000000000000000000000000000000000000804 Related Module: x/bank

Primary Methods

balances

Signature: balances(address account) → Balance[] memory Description: Queries all native token balances for a specific account address and returns an array of Balance (ERC-20 contract address & amount) structures.
Parameters:
  • account (address): The account address to query balances for
Returns: Array of Balance structures with contractAddress and amount fields

totalSupply

Signature: totalSupply() → Balance[] memory Description: Queries the total supply of all native tokens in the system. Returns comprehensive supply information for every token registered in the system.
Parameters: None Returns: Array of Balance structures showing total supply for each token

supplyOf

Signature: supplyOf(address erc20Address) → uint256 Description: Queries the total supply of a specific token by providing its ERC20 contract address. More efficient when you need supply information for a single token.
Parameters:
  • erc20Address (address): The ERC20 contract address of the token
Returns: Total supply of the specified token as uint256

Data Structures ->

Balance

The Balance struct represents a token balance with its associated ERC20 contract address:
  • contractAddress (address): The ERC20 contract address representing the native token
  • amount (uint256): Token amount in the smallest denomination

Full Interface & ABI

Bank Solidity Interface
Bank ABI