From bd9595d894fe210a64d9f93d93b3f39120902e11 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 30 Aug 2023 10:37:41 +0200 Subject: [PATCH] document --- contracts/token/ERC20/extensions/ERC20Votes.sol | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contracts/token/ERC20/extensions/ERC20Votes.sol b/contracts/token/ERC20/extensions/ERC20Votes.sol index 2cd096990c3..d4806783a1e 100644 --- a/contracts/token/ERC20/extensions/ERC20Votes.sol +++ b/contracts/token/ERC20/extensions/ERC20Votes.sol @@ -28,6 +28,12 @@ abstract contract ERC20Votes is ERC20, Votes { /** * @dev Maximum token supply. Defaults to `type(uint208).max` (2^208^ - 1). + * + * This maximum is enforced in {_update}. It limits the total supply of the token, which is otherwize a uint256, so + * that checkpoints can be stored in Trace208 structure used by {{Votes}}. Increasing this value will not remove + * the underlying limitation, and will the {_update} to fail because of a math overflow in {_transferVotingUnits}. + * An override could be used to further restrict the total supply (to a lower value) if additional logic requires + * it. When resolving override conflicts on this function, the minimum should be returned. */ function _maxSupply() internal view virtual returns (uint256) { return type(uint208).max;