|
@@ -34,13 +34,6 @@ abstract contract Pausable is Context {
|
|
_paused = false;
|
|
_paused = false;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * @dev Returns true if the contract is paused, and false otherwise.
|
|
|
|
- */
|
|
|
|
- function paused() public view virtual returns (bool) {
|
|
|
|
- return _paused;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* @dev Modifier to make a function callable only when the contract is not paused.
|
|
* @dev Modifier to make a function callable only when the contract is not paused.
|
|
*
|
|
*
|
|
@@ -49,7 +42,7 @@ abstract contract Pausable is Context {
|
|
* - The contract must not be paused.
|
|
* - The contract must not be paused.
|
|
*/
|
|
*/
|
|
modifier whenNotPaused() {
|
|
modifier whenNotPaused() {
|
|
- require(!paused(), "Pausable: paused");
|
|
|
|
|
|
+ _requireNotPaused();
|
|
_;
|
|
_;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -61,10 +54,31 @@ abstract contract Pausable is Context {
|
|
* - The contract must be paused.
|
|
* - The contract must be paused.
|
|
*/
|
|
*/
|
|
modifier whenPaused() {
|
|
modifier whenPaused() {
|
|
- require(paused(), "Pausable: not paused");
|
|
|
|
|
|
+ _requirePaused();
|
|
_;
|
|
_;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @dev Returns true if the contract is paused, and false otherwise.
|
|
|
|
+ */
|
|
|
|
+ function paused() public view virtual returns (bool) {
|
|
|
|
+ return _paused;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @dev Throws if the contract is paused.
|
|
|
|
+ */
|
|
|
|
+ function _requireNotPaused() internal view virtual {
|
|
|
|
+ require(!paused(), "Pausable: paused");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @dev Throws if the contract is not paused.
|
|
|
|
+ */
|
|
|
|
+ function _requirePaused() internal view virtual {
|
|
|
|
+ require(paused(), "Pausable: not paused");
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @dev Triggers stopped state.
|
|
* @dev Triggers stopped state.
|
|
*
|
|
*
|