Skip to content

Commit bd9595d

Browse files
committed
document
1 parent b2cd627 commit bd9595d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

contracts/token/ERC20/extensions/ERC20Votes.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ abstract contract ERC20Votes is ERC20, Votes {
2828

2929
/**
3030
* @dev Maximum token supply. Defaults to `type(uint208).max` (2^208^ - 1).
31+
*
32+
* This maximum is enforced in {_update}. It limits the total supply of the token, which is otherwize a uint256, so
33+
* that checkpoints can be stored in Trace208 structure used by {{Votes}}. Increasing this value will not remove
34+
* the underlying limitation, and will the {_update} to fail because of a math overflow in {_transferVotingUnits}.
35+
* An override could be used to further restrict the total supply (to a lower value) if additional logic requires
36+
* it. When resolving override conflicts on this function, the minimum should be returned.
3137
*/
3238
function _maxSupply() internal view virtual returns (uint256) {
3339
return type(uint208).max;

0 commit comments

Comments
 (0)