Closed jnishiyama closed 2 years ago
Hello @jnishiyama
The code in this repo is transpired from the "OpenZeppelin/OpenZeppelin-contracts" repository. This issue, and any corresponding PR should be submitted there.
Hope to see you soon there.
Understood, leaving link to this issue on main repo for posterity: https://github.com/OpenZeppelin/openzeppelin-contracts/issues/3222
🧐 Motivation The idea here is to optimize contract size impact of modifiers by moving
require
statements to function that is separate from the modifier itself.📝 Details I am fairly new to Web3 development, and I haven't checked throughout the repo, but in both
OwnableUpgradeable
andPausableUpgradeable
the require statements are contained in the modifier. By simply creating a function that contains therequire
statement and calling it from the modifier, we can reduce the impact on the overall contract size of contracts using these.e.g.
Depending on how much the modifier is used, the size reduction can be significant.
I'd be happy to make a PR if necessary.