Improve Pausable docs

pull/2214/head^2
Nicolás Venturo 5 years ago
parent 4bc45e35c2
commit c20e620a06
  1. 16
      contracts/utils/Pausable.sol

@ -40,6 +40,10 @@ contract Pausable is Context {
/** /**
* @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.
*
* Requirements:
*
* - The contract must not be paused.
*/ */
modifier whenNotPaused() { modifier whenNotPaused() {
require(!_paused, "Pausable: paused"); require(!_paused, "Pausable: paused");
@ -48,6 +52,10 @@ contract Pausable is Context {
/** /**
* @dev Modifier to make a function callable only when the contract is paused. * @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/ */
modifier whenPaused() { modifier whenPaused() {
require(_paused, "Pausable: not paused"); require(_paused, "Pausable: not paused");
@ -56,6 +64,10 @@ contract Pausable is Context {
/** /**
* @dev Triggers stopped state. * @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/ */
function _pause() internal virtual whenNotPaused { function _pause() internal virtual whenNotPaused {
_paused = true; _paused = true;
@ -64,6 +76,10 @@ contract Pausable is Context {
/** /**
* @dev Returns to normal state. * @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/ */
function _unpause() internal virtual whenPaused { function _unpause() internal virtual whenPaused {
_paused = false; _paused = false;

Loading…
Cancel
Save