Inflationary token using `ERC20Capped` - can not read _cap

I wanted to create an inflationary token using ERC20Capped but ran into issues because I can not access _cap ... any suggestions ?

https://github.com/OpenZeppelin/openzeppelin-contracts/issues/4459

That capped contract code is maybe 20 lines of code, you could just copy it and modify it to your needs :slight_smile:

2 Likes

This is a bit of an oxymoron - either it's inflationary, or it's capped.

Namely, the idea about _cap is that it is set once (upon deployment) and remains constant forever, serving as a guarantee that it never inflates beyond a certain point.

If it's not constant (for example, if it can be reconfigured by an admin), then this feature becomes worthless, and token holders cannot rely on that guarantee.

I found a solution and there is a (for example) a 2% inflation/year "set in stone" and nobody can change it after deployment.