Skip to content

@token:decimals

Number of decimals of a token.

Returns: number

@token:decimals(tokenSymbol)
NameTypeDescription
tokenSymboltoken-symbolToken symbol (e.g. DAI) or address
# Read the decimals of a token
set $decimals @token:decimals(DAI)
# Scale an amount manually
set $base @num(25 * 10 ^ @token:decimals(DAI))

Read decimals() at assertion time. The symbol resolves to the token address at composition time (like the plain face); the native token folds to its chain constant at build time.