ERC20

A standard interface for tokens.

This section contains the different types of ERC20 methods that can be used in the Unity SDK. For additional operations and methods please refer to the ChainSafe Documentation.

Balance Of

Counts all ERC721 tokens assigned to an owner

string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
string contract = "CONTRACT_ADDRESS";
string account = "WALLET_ADDRESS";

BigInteger balanceOf = await ERC20.BalanceOf(chain, network, contract, account);
print(balanceOf);

Name

Returns the name of the token.

string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
string contract = "CONTRACT_ADDRESS";

string name = await ERC20.Name(chain, network, contract);
print(name);

Symbol

Returns the symbol of the token

Decimals

Returns the number of decimals the token uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation.

Total Supply

Returns the total token supply.

Last updated

Was this helpful?