contract Pausable is Owned {

    bool public paused;
    
    /**
     * @dev Internal `pause()` with no owner-only constraint.
     */
    function _pause()
        internal
    {
        if (!paused) {
            paused = true;
            emit Paused();
        }
    }

    /**
     * @notice Pause operations of the contract.
     * @dev Functions modified with `onlyUnpaused` will cease to operate,
     *      while functions with `onlyPaused` will start operating.
     *      If this is called while the contract is paused, nothing will happen. 
     */
    function pause() 
        public
        onlyOwner
    {
        _pause();
    }

    /**
     * @dev Internal `unpause()` with no owner-only constraint.
     */
    function _unpause()
        internal
    {
        if (paused) {
            paused = false;
            emit Unpaused();
        }
    }

    /**
     * @notice Unpause operations of the contract.
     * @dev Functions modified with `onlyPaused` will cease to operate,
     *      while functions with `onlyUnpaused` will start operating.
     *      If this is called while the contract is unpaused, nothing will happen. 
     */
    function unpause()
        public
        onlyOwner
    {
        _unpause();
    }

    modifier onlyPaused {
        require(paused, "Contract must be paused.");
        _;
    }

    modifier pausable {
        require(!paused, "Contract must not be paused.");
        _;
    }

    event Paused();
    event Unpaused();

}
/**
 * @title A pausable contract.
 * @dev The inheriting contract must itself inherit from Owned, and initialise it.
 */
function _pause()
    internal
{
    if (!paused) {
        paused = true;
        emit Paused();
    }
}

/**
 * @dev Internal `pause()` with no owner-only constraint.
 */