1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- // SPDX-License-Identifier: MIT
- // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/ERC20Pausable.sol)
- pragma solidity ^0.8.0;
- import "../ERC20Upgradeable.sol";
- import "../../../security/PausableUpgradeable.sol";
- import "../../../proxy/utils/Initializable.sol";
- /**
- * @dev ERC20 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.
- */
- abstract contract ERC20PausableUpgradeable is Initializable, ERC20Upgradeable, PausableUpgradeable {
- function __ERC20Pausable_init() internal onlyInitializing {
- __Pausable_init_unchained();
- }
- function __ERC20Pausable_init_unchained() internal onlyInitializing {
- }
- /**
- * @dev See {ERC20-_beforeTokenTransfer}.
- *
- * Requirements:
- *
- * - the contract must not be paused.
- */
- function _beforeTokenTransfer(
- address from,
- address to,
- uint256 amount
- ) internal virtual override {
- super._beforeTokenTransfer(from, to, amount);
- require(!paused(), "ERC20Pausable: token transfer while paused");
- }
- /**
- * This empty reserved space is put in place to allow future versions to add new
- * variables without shifting down storage in the inheritance chain.
- * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
- */
- uint256[50] private __gap;
- }
|