Skip to content

ERC20

This section is meant to be used inside the requester.Client, but it can be directly called from the erc20 package.

Constructor

To avoid passing the endpoint to each smart contract call, an ERC20 struct is used

client := erc20.NewERC20("https://proxy.evmos.org/web3")

Getters

The ERC20 object exposes a couple of functions to get on-chain data:

Total Supply

Total supply returns the total supply of a given smart contract.

supply, err := client.GetTotalSupply(contractAddress, height)

Get Balance

The function GetBalance returns the token balance of a given wallet.

balance, err := client.GetBalance(contractAddress, wallet, height)