ERC20Pausable.sol 786 B

1234567891011121314151617181920212223242526
  1. pragma solidity ^0.6.0;
  2. import "./ERC20.sol";
  3. import "../../utils/Pausable.sol";
  4. /**
  5. * @dev ERC20 token with pausable token transfers, minting and burning.
  6. *
  7. * Useful for scenarios such as preventing trades until the end of an evaluation
  8. * period, or having an emergency switch for freezing all token transfers in the
  9. * event of a large bug.
  10. */
  11. abstract contract ERC20Pausable is ERC20, Pausable {
  12. /**
  13. * @dev See {ERC20-_beforeTokenTransfer}.
  14. *
  15. * Requirements:
  16. *
  17. * - the contract must not be paused.
  18. */
  19. function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
  20. super._beforeTokenTransfer(from, to, amount);
  21. require(!paused(), "ERC20Pausable: token transfer while paused");
  22. }
  23. }