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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a gas optimization in Pausable similar to the one used in the ReentrancyGuard #4651

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

eugenioclrc
Copy link

Fixes #4650

I noticed that the Pausable contract can be optimized for gas usage by adopting a similar mechanism used in the ReentrancyGuard contract.
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.

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

@changeset-bot
Copy link

changeset-bot bot commented Oct 4, 2023

🦋 Changeset detected

Latest commit: dfa3959

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pausable can be more gas efficient using a similar mechanism as in the ReentrancyGuard
1 participant