Skip to main content

Helpers

Helpers

getSymbol

function getSymbol(address _token) internal view returns (string)

Fetch the symbol() from an ERC20 token

Grabs the symbol() from a contract

Parameters

NameTypeDescription
_tokenaddressAddress of the ERC20 token

Return Values

NameTypeDescription
[0]stringstring Symbol of the ERC20 token

getDecimals

function getDecimals(address _token) internal view returns (uint256)

Fetch the decimals() from an ERC20 token

Grabs the decimals() from a contract and fails if the decimal value does not live within a certain range

Parameters

NameTypeDescription
_tokenaddressAddress of the ERC20 token

Return Values

NameTypeDescription
[0]uint256uint256 Decimals of the ERC20 token