Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pausable can be more gas efficient using a similar mechanism as in the ReentrancyGuard #4650

Open
eugenioclrc opened this issue Oct 4, 2023 · 0 comments 路 May be fixed by #4651
Open

Pausable can be more gas efficient using a similar mechanism as in the ReentrancyGuard #4650

eugenioclrc opened this issue Oct 4, 2023 · 0 comments 路 May be fixed by #4651
Labels
breaking change Changes that break backwards compatibility of the public API.

Comments

@eugenioclrc
Copy link

eugenioclrc commented Oct 4, 2023

I noticed that the Pausable contract can be optimized for gas usage by adopting a similar mechanism used in the ReentrancyGuard contract.

馃捇 Environment

OpenZeppelin Contracts 4.9.3

馃摑 Details

The ReentrancyGuard contract uses uint256 constants to avoid the extra gas costs associated with boolean operations. This mechanism can be applied to the Pausable contract to make it more gas-efficient.

馃敘 Code to reproduce bug

@ernestognw ernestognw added the breaking change Changes that break backwards compatibility of the public API. label Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Changes that break backwards compatibility of the public API.
Projects
None yet
2 participants