You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.3 KiB
38 lines
1.3 KiB
// SPDX-License-Identifier: MIT
|
|
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/ERC1155Pausable.sol)
|
|
|
|
pragma solidity ^0.8.20;
|
|
|
|
import {ERC1155} from "../ERC1155.sol";
|
|
import {Pausable} from "../../../utils/Pausable.sol";
|
|
|
|
/**
|
|
* @dev ERC-1155 token with pausable token transfers, minting and burning.
|
|
*
|
|
* Useful for scenarios such as preventing trades until the end of an evaluation
|
|
* period, or having an emergency switch for freezing all token transfers in the
|
|
* event of a large bug.
|
|
*
|
|
* IMPORTANT: This contract does not include public pause and unpause functions. In
|
|
* addition to inheriting this contract, you must define both functions, invoking the
|
|
* {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate
|
|
* access control, e.g. using {AccessControl} or {Ownable}. Not doing so will
|
|
* make the contract pause mechanism of the contract unreachable, and thus unusable.
|
|
*/
|
|
abstract contract ERC1155Pausable is ERC1155, Pausable {
|
|
/**
|
|
* @dev See {ERC1155-_update}.
|
|
*
|
|
* Requirements:
|
|
*
|
|
* - the contract must not be paused.
|
|
*/
|
|
function _update(
|
|
address from,
|
|
address to,
|
|
uint256[] memory ids,
|
|
uint256[] memory values
|
|
) internal virtual override whenNotPaused {
|
|
super._update(from, to, ids, values);
|
|
}
|
|
}
|
|
|