interface CancelMarginCallDelegator {

    // ============ Public Interface functions ============

    /**
     * Function a contract must implement in order to let other addresses call cancelMarginCall().
     *
     * NOTE: If not returning zero (or not reverting), this contract must assume that Margin will
     * either revert the entire transaction or that the margin-call was successfully canceled.
     *
     * @param  canceler    Address of the caller of the cancelMarginCall function
     * @param  positionId  Unique ID of the position
     * @return             This address to accept, a different address to ask that contract
     */
    function cancelMarginCallOnBehalfOf(
        address canceler,
        bytes32 positionId
    )
        external
        /* onlyMargin */
        returns (address);
}
/**
 * @title CancelMarginCallDelegator
 * @author dYdX
 *
 * Interface that smart contracts must implement in order to let other addresses cancel a
 * margin-call for a loan owned by the smart contract.
 *
 * NOTE: Any contract implementing this interface should also use OnlyMargin to control access
 *       to these functions
 */
function cancelMarginCallOnBehalfOf(
    address canceler,
    bytes32 positionId
)
    external
    /* onlyMargin */
    returns (address);

/**
 * Function a contract must implement in order to let other addresses call cancelMarginCall().
 *
 * NOTE: If not returning zero (or not reverting), this contract must assume that Margin will
 * either revert the entire transaction or that the margin-call was successfully canceled.
 *
 * @param  canceler    Address of the caller of the cancelMarginCall function
 * @param  positionId  Unique ID of the position
 * @return             This address to accept, a different address to ask that contract
 */