ERC1155Pausable.sol 1017 B

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)
  3. pragma solidity ^0.8.0;
  4. import "../ERC1155.sol";
  5. import "../../../security/Pausable.sol";
  6. /**
  7. * @dev ERC1155 token with pausable token transfers, minting and burning.
  8. *
  9. * Useful for scenarios such as preventing trades until the end of an evaluation
  10. * period, or having an emergency switch for freezing all token transfers in the
  11. * event of a large bug.
  12. *
  13. * _Available since v3.1._
  14. */
  15. abstract contract ERC1155Pausable is ERC1155, Pausable {
  16. /**
  17. * @dev See {ERC1155-_update}.
  18. *
  19. * Requirements:
  20. *
  21. * - the contract must not be paused.
  22. */
  23. function _update(
  24. address from,
  25. address to,
  26. uint256[] memory ids,
  27. uint256[] memory amounts,
  28. bytes memory data
  29. ) internal virtual override {
  30. require(!paused(), "ERC1155Pausable: token transfer while paused");
  31. super._update(from, to, ids, amounts, data);
  32. }
  33. }