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

ERC721VotesUpgradeable

Inherits: Initializable, ERC721Upgradeable, VotesUpgradeable

Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts as 1 vote unit. Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of the votes in governance decisions, or they can delegate to themselves to be their own representative.

Functions

__ERC721Votes_init

function __ERC721Votes_init() internal onlyInitializing;

__ERC721Votes_init_unchained

function __ERC721Votes_init_unchained() internal onlyInitializing;

_update

See ERC721-_update. Adjusts votes when tokens are transferred. Emits a {IVotes-DelegateVotesChanged} event.

function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address);

_getVotingUnits

Returns the balance of account. WARNING: Overriding this function will likely result in incorrect vote tracking.

function _getVotingUnits(address account) internal view virtual override returns (uint256);

_increaseBalance

See ERC721-_increaseBalance. We need that to account tokens that were minted in batch.

function _increaseBalance(address account, uint128 amount) internal virtual override;