contract RebalancingBid is
    RebalancingSetState
{
    using SafeMath for uint256;

    /* ============ Internal Functions ============ */

    /*
     * Validates conditions to retrieve a Bid Price:
     *  - State is Rebalance
     *  - Quanity is greater than zero
     *
     * @param _quantity                 The amount of currentSet to be rebalanced
     */
    function validateGetBidPrice(
        uint256 _quantity
    )
        internal
        view
    {
        validateRebalanceStateIs(RebalancingLibrary.State.Rebalance);

        require(
            _quantity > 0,
            "Bid not > 0"
        );
    }

    /*
     * Validations for placeBid:
     *  - Module is sender
     *  - getBidPrice validations
     *
     * @param _quantity                 The amount of currentSet to be rebalanced
     */
    function validatePlaceBid(
        uint256 _quantity
    )
        internal
        view
    {
        validateCallerIsModule();

        validateGetBidPrice(_quantity);
    }

    /*
     * If a successful bid has been made, flip the hasBidded boolean.
     */
    function updateHasBiddedIfNecessary()
        internal
    {
        if (!hasBidded) {
            hasBidded = true;
        }
    }

}
/**
 * @title RebalancingBid
 * @author Set Protocol
 *
 * Implementation of Rebalancing Set Token V2 bidding-related functionality.
 */
function validateGetBidPrice(
    uint256 _quantity
)
    internal
    view
{
    validateRebalanceStateIs(RebalancingLibrary.State.Rebalance);

    require(
        _quantity > 0,
        "Bid not > 0"
    );
}

/*
 * Validates conditions to retrieve a Bid Price:
 *  - State is Rebalance
 *  - Quanity is greater than zero
 *
 * @param _quantity                 The amount of currentSet to be rebalanced
 */