Skip to content

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

Open
@eugenioclrc

Description

@eugenioclrc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeChanges that break backwards compatibility of the public API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions