contract CheezyExchangeAdmin is Ownable, Pausable, ReentrancyGuard {

    /* ****** */
    /* EVENTS */
    /* ****** */

    /// @notice This event is fired when the developer changes the fee applied
    ///  to successful trades. The fee is measured in basis points (hundredths
    ///  of a percent).
    /// @param newSuccessfulTradeFeeInBasisPoints  The new fee applying to
    ///  successful trades (measured in basis points/hundredths of a percent).
    event SuccessfulTradeFeeInBasisPointsUpdated(uint256 newSuccessfulTradeFeeInBasisPoints);

    /* ******* */
    /* STORAGE */
    /* ******* */

    /// @notice The amount of fees collected (in wei). This includes both fees to
    ///  the contract owner and fees to any referrers. Storing earnings saves
    ///  gas rather than performing an additional transfer() call on every
    ///  successful trade.
    mapping (address => uint256) public addressToFeeEarnings;

    /// @notice If a trade is successfully fulfilled, this fee applies before
    ///  the remaining funds are sent to the seller. This fee is measured in
    ///  basis points (hundredths of a percent), and is taken out of the total
    ///  value that the seller asked for when creating their order.
    uint256 public successfulTradeFeeInBasisPoints = 375;

    /* ********* */
    /* CONSTANTS */
    /* ********* */

    /// @notice The address of Core CheezeWizards contract, handling the ownership
    ///  and approval logic for any particular wizard.
    address public wizardGuildAddress = 0x0d8c864DA1985525e0af0acBEEF6562881827bd5;

    /* ********* */
    /* FUNCTIONS */
    /* ********* */

    /// @dev The owner is not capable of changing the address of the
    ///  CheezeWizards Core contract once the contract has been deployed.
    constructor() internal {

    }

    /// @notice Sets the successfulTradeFeeInBasisPoints value (in basis
    ///  points). Any trades that are successfully fulfilled will have this fee
    ///  deducted from amount sent to the seller.
    /// @dev Only callable by the owner.
    /// @dev As this configuration is a basis point, the value to set must be
    ///  less than or equal to 10000.
    /// @param _newSuccessfulTradeFeeInBasisPoints  The
    ///  successfulTradeFeeInBasisPoints value to set (measured in basis
    ///  points).
    function setSuccessfulTradeFeeInBasisPoints(uint256 _newSuccessfulTradeFeeInBasisPoints) external onlyOwner {
        require(_newSuccessfulTradeFeeInBasisPoints <= 10000, 'new successful trade fee must be in basis points (hundredths of a percent), not wei');
        successfulTradeFeeInBasisPoints = _newSuccessfulTradeFeeInBasisPoints;
        emit SuccessfulTradeFeeInBasisPointsUpdated(_newSuccessfulTradeFeeInBasisPoints);
    }

    /// @notice Withdraws the fees that have been earned by either the contract
    ///  owner or referrers.
    /// @notice Only callable by the address that had earned the fees.
    function withdrawFeeEarningsForAddress() external nonReentrant {
        uint256 balance = addressToFeeEarnings[msg.sender];
        require(balance > 0, 'there are no fees to withdraw for this address');
        addressToFeeEarnings[msg.sender] = 0;
        msg.sender.transfer(balance);
    }

    /// @notice Gives the authority for the contract owner to remove any
    ///  additional accounts that have been granted the ability to pause the
    ///  contract
    /// @dev Only callable by the owner.
    /// @param _account  The account to have the ability to pause the contract
    ///  revoked
    function removePauser(address _account) external onlyOwner {
        _removePauser(_account);
    }

    /// @dev By calling 'revert' in the fallback function, we prevent anyone
    ///  from accidentally sending funds directly to this contract.
    function() external payable {
        revert();
    }
}
/// @title Admin contract for CheezyExchange. This contract manages fees and
///  imports administrative functions.
function removePauser(address _account) external onlyOwner {
        _removePauser(_account);
    }
/// @notice Gives the authority for the contract owner to remove any
///  additional accounts that have been granted the ability to pause the
///  contract
/// @dev Only callable by the owner.
/// @param _account  The account to have the ability to pause the contract
///  revoked