@perfect-abstractions/compose/token/ERC20/Metadata/ERC20MetadataFacet.solRead-only access to the token name, symbol, and decimals
name(), symbol() and decimals().ERC20MetadataStorage at erc8042:erc20.metadata, a different slot from balances and allowances.ERC20MetadataMod.STORAGE_POSITIONbytes32keccak256("erc20.metadata"))Returns the descriptive name of the token, for example "My Token".
Returns:
-stringReturns the short ticker of the token, for example "MTK".
Returns:
-stringReturns how many decimal places wallets and interfaces should use when displaying balances.
Returns:
-uint80 if metadata was never set. 18 is the usual choice.ERC20DataFacet. Wallets and explorers expect both the balance functions and the metadata functions.ERC20MetadataMod.setMetadata. Reading this facet before that happens returns empty strings and 0.decimals before launch and leave it alone. Changing it later reinterprets every balance already held.This facet only reads storage, so it cannot corrupt token state on its own. Two consequences of the shared slot are worth knowing:
ERC20PermitFacet hashes the stored name into its EIP-712 domain, both in DOMAIN_SEPARATOR() and again inside permit(). If name changes, previously signed permits no longer verify and integrators that cached the old domain separator will produce failing signatures.decimals is display only. Nothing in Compose does arithmetic with it. Balances, allowances, and the total supply are raw integers, so treat this value as a hint for user interfaces rather than a unit of account.