Files
openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Pausable.sol
2023-07-11 21:47:23 +02:00

35 lines
1.3 KiB
Solidity

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.2) (token/ERC721/extensions/ERC721Pausable.sol)
pragma solidity ^0.8.19;
import {ERC721} from "../ERC721.sol";
import {Pausable} from "../../../security/Pausable.sol";
/**
* @dev ERC721 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 ERC721Pausable is ERC721, Pausable {
/**
* @dev See {ERC721-_update}.
*
* Requirements:
*
* - the contract must not be paused.
*/
function _update(address to, uint256 tokenId, address operatorCheck) internal virtual override returns (address) {
_requireNotPaused();
return super._update(to, tokenId, operatorCheck);
}
}