Appearance
Solidity API
ERC20MetadataInternal
_Provides the internal implementation for ERC20 metadata management. This contract handles the storage and modification of token metadata including name, symbol, and decimals. It uses a dedicated storage contract to maintain upgrade safety in diamond implementations.
This contract is meant to be inherited by other contracts that need to manage ERC20 metadata internally, providing a clean separation between storage access and external interfaces._
_name
solidity
function _name() internal view virtual returns (string)Returns the name of the token
Reads the token name from the ERC20MetadataStorage layout
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | string | The name of the token as a string |
_symbol
solidity
function _symbol() internal view virtual returns (string)Returns the symbol of the token
Reads the token symbol from the ERC20MetadataStorage layout
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | string | The symbol of the token as a string |
_decimals
solidity
function _decimals() internal view virtual returns (uint8)Returns the number of decimals used for token display
Reads the decimals value from the ERC20MetadataStorage layout. The decimals value is used to determine how to interpret the token's raw numeric value. For example, if decimals is 2, a raw value of 100 should be displayed as 1.00
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint8 | The number of decimals places for token display |
_setName
solidity
function _setName(string name) internal virtualSets the name of the token
Updates the token name in the ERC20MetadataStorage layout
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | The new name to set for the token |
_setSymbol
solidity
function _setSymbol(string symbol) internal virtualSets the symbol of the token
Updates the token symbol in the ERC20MetadataStorage layout
Parameters
| Name | Type | Description |
|---|---|---|
| symbol | string | The new symbol to set for the token |
_setDecimals
solidity
function _setDecimals(uint8 decimals) internal virtualSets the number of decimals for token display
Updates the decimals value in the ERC20MetadataStorage layout
Parameters
| Name | Type | Description |
|---|---|---|
| decimals | uint8 | The new number of decimals to use for token display |