I'm working on my ERC20 token and I'm in need of capping the total supply. For this purpose I found the ERC20Capped extension of ERC20 standard, but I noticed, that if I mint all my tokens (So reaching the cap) and then burn some, I would again be able to mint more tokens, because the total supply decreases when tokens are burned, but the token cap does not. What I would like to have is a token with a total cap (set at the contract creation like it is in ERC20Capped) so that I could not mint more than the cap, but also when any tokens are burned, it would decrease this token cap, in a way, achieving true deflation.
Is there a standard solution for such an ERC20 token, or I should get creative?
Easiest solution would be to mint all at contract creation and not have an external mint function, but I'd like to keep the possibility of minting in batches.