// SPDX-License-Identifier: MIT // Klaytn Contract Library v1.0.0 (KIP/token/KIP17/extensions/draft-KIP17Votes.sol) // Based on OpenZeppelin Contracts v4.5.0 (token/ERC721/extensions/draft-ERC721Votes.sol) // https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v4.5.0 pragma solidity ^0.8.0; import "../KIP17.sol"; import "../../../../governance/utils/Votes.sol"; /** * @dev Extension of KIP17 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. * * _Available since v4.5._ */ abstract contract KIP17Votes is KIP17, Votes { /** * @dev Adjusts votes when tokens are transferred. * * Emits a {Votes-DelegateVotesChanged} event. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { _transferVotingUnits(from, to, 1); super._afterTokenTransfer(from, to, tokenId); } /** * @dev Returns the balance of `account`. */ function _getVotingUnits(address account) internal view virtual override returns (uint256) { return balanceOf(account); } }