Add ERC1155.totalSupply that returns overall supply count by JulissaDantes · Pull Request #3962 · OpenZeppelin/openzeppelin-contracts (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is something terribly wrong here:
totalAmountstarts at 0- you increase is for every new token
- you add that sum to the
_totalSupplyAll - you then increase it again (without resetting it) with every token being burned
- you decrease that from the
_totalSupplyAll
So if someone transfers from 0 to 0 (which would happen with the new _update transition), you would mess up the _totalSupplyAll :/
Also, on a completely different point, this change will restrict a total of 2**256-1 tokens minted accross ALL ids. This is a significant change, which needs to be documented.