useTokenDecimals
Hook for fetching the decimals of an ERC20 token.
Tokens usually opt for a value of 18
, imitating the relationship between Ether and Wei.
Therefore, 18
is the default value returned by this function, unless your ERC20 contract explicitly overrides it.
Example
Parameters
Returns
The hook's data
property, once loaded, contains the number
that represents the number of decimals of the ERC20 token.