interface DepositCollateralDelegator {

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

    /**
     * Function a contract must implement in order to let other addresses call depositCollateral().
     *
     * @param  depositor   Address of the caller of the depositCollateral() function
     * @param  positionId  Unique ID of the position
     * @param  amount      Requested deposit amount
     * @return             This address to accept, a different address to ask that contract
     */
    function depositCollateralOnBehalfOf(
        address depositor,
        bytes32 positionId,
        uint256 amount
    )
        external
        /* onlyMargin */
        returns (address);
}
/**
 * @title DepositCollateralDelegator
 * @author dYdX
 *
 * Interface that smart contracts must implement in order to let other addresses deposit heldTokens
 * into a position owned by the smart contract.
 *
 * NOTE: Any contract implementing this interface should also use OnlyMargin to control access
 *       to these functions
 */
function depositCollateralOnBehalfOf(
    address depositor,
    bytes32 positionId,
    uint256 amount
)
    external
    /* onlyMargin */
    returns (address);

/**
 * Function a contract must implement in order to let other addresses call depositCollateral().
 *
 * @param  depositor   Address of the caller of the depositCollateral() function
 * @param  positionId  Unique ID of the position
 * @param  amount      Requested deposit amount
 * @return             This address to accept, a different address to ask that contract
 */