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

ERC6909TokenSupply

Inherits: ERC6909, IERC6909TokenSupply

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

State Variables

_totalSupplies

mapping(uint256 id => uint256) private _totalSupplies;

Functions

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;