You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
902 B
Solidity
30 lines
902 B
Solidity
2 years ago
|
// SPDX-License-Identifier: MIT
|
||
|
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/ERC20Pausable.sol)
|
||
|
|
||
|
pragma solidity ^0.8.0;
|
||
|
|
||
|
import "../ERC20.sol";
|
||
|
import "../../../security/Pausable.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 ERC20Pausable is ERC20, Pausable {
|
||
|
/**
|
||
|
* @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");
|
||
|
}
|
||
|
}
|