Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ERC6909MetadataUpgradeable

Inherits: Initializable, ERC6909Upgradeable, IERC6909Metadata

Implementation of the Metadata extension defined in ERC6909. Exposes the name, symbol, and decimals of each token id.

State Variables

ERC6909MetadataStorageLocation

bytes32 private constant ERC6909MetadataStorageLocation =
    0xa0651e3d105d335a33d7d04897e080112be09c416f44637d6543e5b47885f800;

Functions

_getERC6909MetadataStorage

function _getERC6909MetadataStorage() private pure returns (ERC6909MetadataStorage storage $);

__ERC6909Metadata_init

function __ERC6909Metadata_init() internal onlyInitializing;

__ERC6909Metadata_init_unchained

function __ERC6909Metadata_init_unchained() internal onlyInitializing;

name

Returns the name of the token of type id.

function name(uint256 id) public view virtual override returns (string memory);

symbol

Returns the ticker symbol of the token of type id.

function symbol(uint256 id) public view virtual override returns (string memory);

decimals

Returns the number of decimals for the token of type id.

function decimals(uint256 id) public view virtual override returns (uint8);

_setName

Sets the name for a given token of type id. Emits an ERC6909NameUpdated event.

function _setName(uint256 id, string memory newName) internal virtual;

_setSymbol

Sets the symbol for a given token of type id. Emits an ERC6909SymbolUpdated event.

function _setSymbol(uint256 id, string memory newSymbol) internal virtual;

_setDecimals

Sets the decimals for a given token of type id. Emits an ERC6909DecimalsUpdated event.

function _setDecimals(uint256 id, uint8 newDecimals) internal virtual;

Events

ERC6909NameUpdated

The name of the token of type id was updated to newName.

event ERC6909NameUpdated(uint256 indexed id, string newName);

ERC6909SymbolUpdated

The symbol for the token of type id was updated to newSymbol.

event ERC6909SymbolUpdated(uint256 indexed id, string newSymbol);

ERC6909DecimalsUpdated

The decimals value for token of type id was updated to newDecimals.

event ERC6909DecimalsUpdated(uint256 indexed id, uint8 newDecimals);

Structs

TokenMetadata

struct TokenMetadata {
    string name;
    string symbol;
    uint8 decimals;
}

ERC6909MetadataStorage

Note: storage-location: erc7201:openzeppelin.storage.ERC6909Metadata

struct ERC6909MetadataStorage {
    mapping(uint256 id => TokenMetadata) _tokenMetadata;
}