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

ERC6909TokenSupplyUpgradeable

Inherits: Initializable, ERC6909Upgradeable, IERC6909TokenSupply

Implementation of the Token Supply extension defined in ERC6909. Tracks the total supply of each token id individually.

State Variables

ERC6909TokenSupplyStorageLocation

bytes32 private constant ERC6909TokenSupplyStorageLocation =
    0x9cc5ac148333cfaf4365d2d67a9c6e8fab8e8f4df7b569f769d68102db719600;

Functions

_getERC6909TokenSupplyStorage

function _getERC6909TokenSupplyStorage() private pure returns (ERC6909TokenSupplyStorage storage $);

__ERC6909TokenSupply_init

function __ERC6909TokenSupply_init() internal onlyInitializing;

__ERC6909TokenSupply_init_unchained

function __ERC6909TokenSupply_init_unchained() internal onlyInitializing;

totalSupply

Returns the total supply of the token of type id.

function totalSupply(uint256 id) public view virtual override returns (uint256);

_update

Override the _update function to update the total supply of each token id as necessary.

function _update(address from, address to, uint256 id, uint256 amount) internal virtual override;

Structs

ERC6909TokenSupplyStorage

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

struct ERC6909TokenSupplyStorage {
    mapping(uint256 id => uint256) _totalSupplies;
}