Why increaseAllowance and decreaseAllowance are removed from v5.x?

Curious to know why they're removed from v5.x or if they're moved to an extension? And if I should use 4.x to have them if I'm just deploying a very basic/static ERC20 token?

Talking about @openzeppelin/contracts/token/ERC20/ERC20.sol

Primarily because they are not part of the ERC20 standard.
A secondary benefit is a reduction in byte-code size.
See issue 4583 for more details.

1 Like

Thanks for that! & quite a point by banteg... A question for you: I've been viewing changelogs and PR that got it approved, so the question is, if you were to implement a simple ERC20 token, no particular requirements, would you use v4.x because of increase/decrease allowances or just go for v5.x without any extension for it?

You can read about the security risk which had originally led to the implementation of these two functions, and then decide for yourself whether or not you consider this issue sufficiently risky.

1 Like