abstract contract Pausable is Ownable {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() internal {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public virtual view returns (bool) {
        return _paused;
    }

    /**
     * @dev Pause the tokens.
     *
     *  Requirements:
     *
     * - Only owner can call this fundction.
     */
    function pause() public virtual onlyOwner returns (bool) {
        _pause();
        return true;
    }

    /**
     * @dev Unpause the tokens.
     *
     * Requirements:
     *
     * - Only owner can call this fundction.
     */
    function unpause() public virtual onlyOwner returns (bool) {
        _unpause();
        return true;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), 'Pausable: paused');
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), 'Pausable: not paused');
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}
function paused() public virtual view returns (bool) {
    return _paused;
}

/**
 * @dev Returns true if the contract is paused, and false otherwise.
 */