From 612d1fedc79ae2f2f38676e5065a647c1f00e7b4 Mon Sep 17 00:00:00 2001 From: uintgroup Date: Thu, 10 Aug 2023 19:15:10 -0400 Subject: [PATCH] Added PausableSelective_ to errors and events to avoid clashes --- src/PausableSelective.sol | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/PausableSelective.sol b/src/PausableSelective.sol index 7746ac1..1e9ff0c 100644 --- a/src/PausableSelective.sol +++ b/src/PausableSelective.sol @@ -12,17 +12,17 @@ abstract contract PausableSelective { /** * @dev Revert with this custom error when array lengths do not match. */ - error ArrayLengthMismatch(); + error PausableSelective_ArrayLengthMismatch(); /** * @dev Revert with this custom error when a function is called while paused. */ - error FunctionIsPaused(bytes4 functionSelector); + error PausableSelective_FunctionIsPaused(bytes4 functionSelector); /** * @dev Emitted when a functions pause state is changed */ - event FunctionIsPausedUpdate( + event PausableSelective_FunctionIsPausedUpdate( address indexed sender, bytes4 indexed functionSelector, bool indexed isPaused @@ -38,7 +38,9 @@ abstract contract PausableSelective { */ modifier whenNotPausedSelective(bool _pauseAfterCall) { if (functionIsPaused[_msgSigPausableSelective()]) { - revert FunctionIsPaused(_msgSigPausableSelective()); + revert PausableSelective_FunctionIsPaused( + _msgSigPausableSelective() + ); } _; functionIsPaused[_msgSigPausableSelective()] = _pauseAfterCall; @@ -52,7 +54,7 @@ abstract contract PausableSelective { bool _isPaused ) internal virtual { functionIsPaused[_functionSelector] = _isPaused; - emit FunctionIsPausedUpdate( + emit PausableSelective_FunctionIsPausedUpdate( _msgSenderPausableSelective(), _functionSelector, _isPaused @@ -67,12 +69,12 @@ abstract contract PausableSelective { bool[] calldata _isPaused ) internal virtual { if (_selectors.length != _isPaused.length) { - revert ArrayLengthMismatch(); + revert PausableSelective_ArrayLengthMismatch(); } for (uint256 i = 0; i < _selectors.length; i++) { functionIsPaused[_selectors[i]] = _isPaused[i]; - emit FunctionIsPausedUpdate( + emit PausableSelective_FunctionIsPausedUpdate( _msgSenderPausableSelective(), _selectors[i], _isPaused[i]