interface LoanOfferingVerifier {

    /**
     * Function a smart contract must implement to be able to consent to a loan. The loan offering
     * will be generated off-chain. The "loan owner" address will own the loan-side of the resulting
     * position.
     *
     * If true is returned, and no errors are thrown by the Margin contract, the loan will have
     * occurred. This means that verifyLoanOffering can also be used to update internal contract
     * state on a loan.
     *
     * @param  addresses    Array of addresses:
     *
     *  [0] = owedToken
     *  [1] = heldToken
     *  [2] = loan payer
     *  [3] = loan owner
     *  [4] = loan taker
     *  [5] = loan positionOwner
     *  [6] = loan fee recipient
     *  [7] = loan lender fee token
     *  [8] = loan taker fee token
     *
     * @param  values256    Values corresponding to:
     *
     *  [0] = loan maximum amount
     *  [1] = loan minimum amount
     *  [2] = loan minimum heldToken
     *  [3] = loan lender fee
     *  [4] = loan taker fee
     *  [5] = loan expiration timestamp (in seconds)
     *  [6] = loan salt
     *
     * @param  values32     Values corresponding to:
     *
     *  [0] = loan call time limit (in seconds)
     *  [1] = loan maxDuration (in seconds)
     *  [2] = loan interest rate (annual nominal percentage times 10**6)
     *  [3] = loan interest update period (in seconds)
     *
     * @param  positionId   Unique ID of the position
     * @param  signature    Arbitrary bytes; may or may not be an ECDSA signature
     * @return              This address to accept, a different address to ask that contract
     */
    function verifyLoanOffering(
        address[9] addresses,
        uint256[7] values256,
        uint32[4] values32,
        bytes32 positionId,
        bytes signature
    )
        external
        /* onlyMargin */
        returns (address);
}
/**
 * @title LoanOfferingVerifier
 * @author dYdX
 *
 * Interface that smart contracts must implement to be able to make off-chain generated
 * loan offerings.
 *
 * NOTE: Any contract implementing this interface should also use OnlyMargin to control access
 *       to these functions
 */
function verifyLoanOffering(
    address[9] addresses,
    uint256[7] values256,
    uint32[4] values32,
    bytes32 positionId,
    bytes signature
)
    external
    /* onlyMargin */
    returns (address);

/**
 * Function a smart contract must implement to be able to consent to a loan. The loan offering
 * will be generated off-chain. The "loan owner" address will own the loan-side of the resulting
 * position.
 *
 * If true is returned, and no errors are thrown by the Margin contract, the loan will have
 * occurred. This means that verifyLoanOffering can also be used to update internal contract
 * state on a loan.
 *
 * @param  addresses    Array of addresses:
 *
 *  [0] = owedToken
 *  [1] = heldToken
 *  [2] = loan payer
 *  [3] = loan owner
 *  [4] = loan taker
 *  [5] = loan positionOwner
 *  [6] = loan fee recipient
 *  [7] = loan lender fee token
 *  [8] = loan taker fee token
 *
 * @param  values256    Values corresponding to:
 *
 *  [0] = loan maximum amount
 *  [1] = loan minimum amount
 *  [2] = loan minimum heldToken
 *  [3] = loan lender fee
 *  [4] = loan taker fee
 *  [5] = loan expiration timestamp (in seconds)
 *  [6] = loan salt
 *
 * @param  values32     Values corresponding to:
 *
 *  [0] = loan call time limit (in seconds)
 *  [1] = loan maxDuration (in seconds)
 *  [2] = loan interest rate (annual nominal percentage times 10**6)
 *  [3] = loan interest update period (in seconds)
 *
 * @param  positionId   Unique ID of the position
 * @param  signature    Arbitrary bytes; may or may not be an ECDSA signature
 * @return              This address to accept, a different address to ask that contract
 */