/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */

import {
  ethers,
  EventFilter,
  Signer,
  BigNumber,
  BigNumberish,
  PopulatedTransaction,
  BaseContract,
  ContractTransaction,
  Overrides,
  CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import type { TypedEventFilter, TypedEvent, TypedListener } from "./common";

interface OsdBorrowInterface extends ethers.utils.Interface {
  functions: {
    "asset()": FunctionFragment;
    "assetList(uint256)": FunctionFragment;
    "assets(address)": FunctionFragment;
    "borrow(uint256,tuple[],address)": FunctionFragment;
    "extractProtocolRevenue()": FunctionFragment;
    "getAccountDebt(address,uint256)": FunctionFragment;
    "getAssetList()": FunctionFragment;
    "getAssetsView()": FunctionFragment;
    "getCollaterals(address)": FunctionFragment;
    "getMaxAmountOfBorrow(address,tuple[],address)": FunctionFragment;
    "getMaxAmountOfRepay(address,tuple[])": FunctionFragment;
    "getPositionsView(address)": FunctionFragment;
    "liquidatable(address)": FunctionFragment;
    "liquidatableAmount(address,address)": FunctionFragment;
    "liquidate(address,address,uint256,address)": FunctionFragment;
    "liquidateThresholdValue()": FunctionFragment;
    "minBorrowValue()": FunctionFragment;
    "oracle()": FunctionFragment;
    "osd()": FunctionFragment;
    "owner()": FunctionFragment;
    "positions(address)": FunctionFragment;
    "renounceOwnership()": FunctionFragment;
    "repay(address,uint256,tuple[],address)": FunctionFragment;
    "setLiquidateThresholdValue(uint256)": FunctionFragment;
    "setMinBorrowValue(uint256)": FunctionFragment;
    "setOracle(address)": FunctionFragment;
    "setRouter(address)": FunctionFragment;
    "transferOwnership(address)": FunctionFragment;
    "updateAsset(address,uint16,uint16,uint16,uint16,uint8,uint8,uint8)": FunctionFragment;
    "updateProtocolRevenue(address,uint8,uint8,uint16)": FunctionFragment;
  };

  encodeFunctionData(functionFragment: "asset", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "assetList",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(functionFragment: "assets", values: [string]): string;
  encodeFunctionData(
    functionFragment: "borrow",
    values: [BigNumberish, { token: string; amount: BigNumberish }[], string]
  ): string;
  encodeFunctionData(
    functionFragment: "extractProtocolRevenue",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "getAccountDebt",
    values: [string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getAssetList",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "getAssetsView",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "getCollaterals",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "getMaxAmountOfBorrow",
    values: [string, { token: string; amount: BigNumberish }[], string]
  ): string;
  encodeFunctionData(
    functionFragment: "getMaxAmountOfRepay",
    values: [string, { token: string; amount: BigNumberish }[]]
  ): string;
  encodeFunctionData(
    functionFragment: "getPositionsView",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "liquidatable",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "liquidatableAmount",
    values: [string, string]
  ): string;
  encodeFunctionData(
    functionFragment: "liquidate",
    values: [string, string, BigNumberish, string]
  ): string;
  encodeFunctionData(
    functionFragment: "liquidateThresholdValue",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "minBorrowValue",
    values?: undefined
  ): string;
  encodeFunctionData(functionFragment: "oracle", values?: undefined): string;
  encodeFunctionData(functionFragment: "osd", values?: undefined): string;
  encodeFunctionData(functionFragment: "owner", values?: undefined): string;
  encodeFunctionData(functionFragment: "positions", values: [string]): string;
  encodeFunctionData(
    functionFragment: "renounceOwnership",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "repay",
    values: [
      string,
      BigNumberish,
      { token: string; amount: BigNumberish }[],
      string
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "setLiquidateThresholdValue",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "setMinBorrowValue",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(functionFragment: "setOracle", values: [string]): string;
  encodeFunctionData(functionFragment: "setRouter", values: [string]): string;
  encodeFunctionData(
    functionFragment: "transferOwnership",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "updateAsset",
    values: [
      string,
      BigNumberish,
      BigNumberish,
      BigNumberish,
      BigNumberish,
      BigNumberish,
      BigNumberish,
      BigNumberish
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "updateProtocolRevenue",
    values: [string, BigNumberish, BigNumberish, BigNumberish]
  ): string;

  decodeFunctionResult(functionFragment: "asset", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "assetList", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "assets", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "borrow", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "extractProtocolRevenue",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getAccountDebt",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getAssetList",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getAssetsView",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getCollaterals",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getMaxAmountOfBorrow",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getMaxAmountOfRepay",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getPositionsView",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "liquidatable",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "liquidatableAmount",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "liquidate", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "liquidateThresholdValue",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "minBorrowValue",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "oracle", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "osd", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "positions", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "renounceOwnership",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "repay", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "setLiquidateThresholdValue",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "setMinBorrowValue",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "setOracle", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "setRouter", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "transferOwnership",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "updateAsset",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "updateProtocolRevenue",
    data: BytesLike
  ): Result;

  events: {
    "Borrow(address,address,uint256)": EventFragment;
    "CollateralAdd(address,address,address,uint256)": EventFragment;
    "CollateralRemove(address,address,address,uint256)": EventFragment;
    "Liquidate(address,address,uint256)": EventFragment;
    "OwnershipTransferred(address,address)": EventFragment;
    "Repay(address,address,uint256)": EventFragment;
    "UpdateDebtPosition(address,address,uint256)": EventFragment;
  };

  getEvent(nameOrSignatureOrTopic: "Borrow"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "CollateralAdd"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "CollateralRemove"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "Liquidate"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "Repay"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "UpdateDebtPosition"): EventFragment;
}

export type BorrowEvent = TypedEvent<
  [string, string, BigNumber] & {
    asset: string;
    account: string;
    amount: BigNumber;
  }
>;

export type CollateralAddEvent = TypedEvent<
  [string, string, string, BigNumber] & {
    asset: string;
    account: string;
    colAsset: string;
    amount: BigNumber;
  }
>;

export type CollateralRemoveEvent = TypedEvent<
  [string, string, string, BigNumber] & {
    asset: string;
    account: string;
    colAsset: string;
    amount: BigNumber;
  }
>;

export type LiquidateEvent = TypedEvent<
  [string, string, BigNumber] & {
    asset: string;
    account: string;
    amount: BigNumber;
  }
>;

export type OwnershipTransferredEvent = TypedEvent<
  [string, string] & { previousOwner: string; newOwner: string }
>;

export type RepayEvent = TypedEvent<
  [string, string, BigNumber] & {
    asset: string;
    account: string;
    amount: BigNumber;
  }
>;

export type UpdateDebtPositionEvent = TypedEvent<
  [string, string, BigNumber] & {
    asset: string;
    account: string;
    debt: BigNumber;
  }
>;

export class OsdBorrow extends BaseContract {
  connect(signerOrProvider: Signer | Provider | string): this;
  attach(addressOrName: string): this;
  deployed(): Promise<this>;

  listeners<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
  ): Array<TypedListener<EventArgsArray, EventArgsObject>>;
  off<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  on<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  once<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
  ): this;

  listeners(eventName?: string): Array<Listener>;
  off(eventName: string, listener: Listener): this;
  on(eventName: string, listener: Listener): this;
  once(eventName: string, listener: Listener): this;
  removeListener(eventName: string, listener: Listener): this;
  removeAllListeners(eventName?: string): this;

  queryFilter<EventArgsArray extends Array<any>, EventArgsObject>(
    event: TypedEventFilter<EventArgsArray, EventArgsObject>,
    fromBlockOrBlockhash?: string | number | undefined,
    toBlock?: string | number | undefined
  ): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;

  interface: OsdBorrowInterface;

  functions: {
    asset(
      overrides?: CallOverrides
    ): Promise<
      [
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        number,
        number,
        number,
        number,
        number,
        number,
        number,
        number
      ] & {
        debt: BigNumber;
        protocolRevenueAmount: BigNumber;
        protocolRevenueAmountExtract: BigNumber;
        r0: BigNumber;
        relativeInterest: BigNumber;
        updatedAt: BigNumber;
        interestRate: number;
        base: number;
        optimal: number;
        slope1: number;
        slope2: number;
        borrowCredit: number;
        collateralCredit: number;
        penaltyRate: number;
      }
    >;

    assetList(arg0: BigNumberish, overrides?: CallOverrides): Promise<[string]>;

    assets(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<
      [
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        number,
        number,
        number,
        number,
        number,
        number,
        number,
        number
      ] & {
        debt: BigNumber;
        protocolRevenueAmount: BigNumber;
        protocolRevenueAmountExtract: BigNumber;
        r0: BigNumber;
        relativeInterest: BigNumber;
        updatedAt: BigNumber;
        interestRate: number;
        base: number;
        optimal: number;
        slope1: number;
        slope2: number;
        borrowCredit: number;
        collateralCredit: number;
        penaltyRate: number;
      }
    >;

    borrow(
      amount: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    extractProtocolRevenue(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    getAccountDebt(
      _account: string,
      delaySeconds: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[BigNumber]>;

    getAssetList(overrides?: CallOverrides): Promise<[string[]]>;

    getAssetsView(
      overrides?: CallOverrides
    ): Promise<
      [
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        number,
        number,
        number,
        number,
        number,
        number,
        number,
        number
      ] & {
        debt: BigNumber;
        r0: BigNumber;
        relativeInterest: BigNumber;
        updatedAt: BigNumber;
        interestRate: number;
        base: number;
        optimal: number;
        slope1: number;
        slope2: number;
        borrowCredit: number;
        collateralCredit: number;
        penaltyRate: number;
      }
    >;

    getCollaterals(
      _account: string,
      overrides?: CallOverrides
    ): Promise<
      [([string, BigNumber] & { token: string; amount: BigNumber })[]]
    >;

    getMaxAmountOfBorrow(
      _asset: string,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: CallOverrides
    ): Promise<[BigNumber]>;

    getMaxAmountOfRepay(
      _asset: string,
      collaterals: { token: string; amount: BigNumberish }[],
      overrides?: CallOverrides
    ): Promise<[BigNumber]>;

    getPositionsView(
      _account: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber, string[], BigNumber[]] & {
        debt: BigNumber;
        r0: BigNumber;
        collateralTokens: string[];
        collateralAmounts: BigNumber[];
      }
    >;

    liquidatable(
      _account: string,
      overrides?: CallOverrides
    ): Promise<[boolean]>;

    liquidatableAmount(
      _asset: string,
      account: string,
      overrides?: CallOverrides
    ): Promise<[BigNumber]>;

    liquidate(
      _asset: string,
      account: string,
      amount: BigNumberish,
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    liquidateThresholdValue(overrides?: CallOverrides): Promise<[BigNumber]>;

    minBorrowValue(overrides?: CallOverrides): Promise<[BigNumber]>;

    oracle(overrides?: CallOverrides): Promise<[string]>;

    osd(overrides?: CallOverrides): Promise<[string]>;

    owner(overrides?: CallOverrides): Promise<[string]>;

    positions(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<[BigNumber, BigNumber] & { debt: BigNumber; r0: BigNumber }>;

    renounceOwnership(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    repay(
      _asset: string,
      amountMax: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    setLiquidateThresholdValue(
      _liquidateThresholdValue: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    setMinBorrowValue(
      _minBorrowValue: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    setOracle(
      _oracle: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    setRouter(
      _router: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    transferOwnership(
      newOwner: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    updateAsset(
      _asset: string,
      base: BigNumberish,
      optimal: BigNumberish,
      slope1: BigNumberish,
      slope2: BigNumberish,
      borrowCredit: BigNumberish,
      collateralCredit: BigNumberish,
      penaltyRate: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    updateProtocolRevenue(
      _protocolRevenueAddress: string,
      _protocolRevenueRate: BigNumberish,
      _protocolRevenueFlashRate: BigNumberish,
      _flashLoanFeeRate: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;
  };

  asset(
    overrides?: CallOverrides
  ): Promise<
    [
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      number,
      number,
      number,
      number,
      number,
      number,
      number,
      number
    ] & {
      debt: BigNumber;
      protocolRevenueAmount: BigNumber;
      protocolRevenueAmountExtract: BigNumber;
      r0: BigNumber;
      relativeInterest: BigNumber;
      updatedAt: BigNumber;
      interestRate: number;
      base: number;
      optimal: number;
      slope1: number;
      slope2: number;
      borrowCredit: number;
      collateralCredit: number;
      penaltyRate: number;
    }
  >;

  assetList(arg0: BigNumberish, overrides?: CallOverrides): Promise<string>;

  assets(
    arg0: string,
    overrides?: CallOverrides
  ): Promise<
    [
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      number,
      number,
      number,
      number,
      number,
      number,
      number,
      number
    ] & {
      debt: BigNumber;
      protocolRevenueAmount: BigNumber;
      protocolRevenueAmountExtract: BigNumber;
      r0: BigNumber;
      relativeInterest: BigNumber;
      updatedAt: BigNumber;
      interestRate: number;
      base: number;
      optimal: number;
      slope1: number;
      slope2: number;
      borrowCredit: number;
      collateralCredit: number;
      penaltyRate: number;
    }
  >;

  borrow(
    amount: BigNumberish,
    collaterals: { token: string; amount: BigNumberish }[],
    to: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  extractProtocolRevenue(
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  getAccountDebt(
    _account: string,
    delaySeconds: BigNumberish,
    overrides?: CallOverrides
  ): Promise<BigNumber>;

  getAssetList(overrides?: CallOverrides): Promise<string[]>;

  getAssetsView(
    overrides?: CallOverrides
  ): Promise<
    [
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      number,
      number,
      number,
      number,
      number,
      number,
      number,
      number
    ] & {
      debt: BigNumber;
      r0: BigNumber;
      relativeInterest: BigNumber;
      updatedAt: BigNumber;
      interestRate: number;
      base: number;
      optimal: number;
      slope1: number;
      slope2: number;
      borrowCredit: number;
      collateralCredit: number;
      penaltyRate: number;
    }
  >;

  getCollaterals(
    _account: string,
    overrides?: CallOverrides
  ): Promise<([string, BigNumber] & { token: string; amount: BigNumber })[]>;

  getMaxAmountOfBorrow(
    _asset: string,
    collaterals: { token: string; amount: BigNumberish }[],
    to: string,
    overrides?: CallOverrides
  ): Promise<BigNumber>;

  getMaxAmountOfRepay(
    _asset: string,
    collaterals: { token: string; amount: BigNumberish }[],
    overrides?: CallOverrides
  ): Promise<BigNumber>;

  getPositionsView(
    _account: string,
    overrides?: CallOverrides
  ): Promise<
    [BigNumber, BigNumber, string[], BigNumber[]] & {
      debt: BigNumber;
      r0: BigNumber;
      collateralTokens: string[];
      collateralAmounts: BigNumber[];
    }
  >;

  liquidatable(_account: string, overrides?: CallOverrides): Promise<boolean>;

  liquidatableAmount(
    _asset: string,
    account: string,
    overrides?: CallOverrides
  ): Promise<BigNumber>;

  liquidate(
    _asset: string,
    account: string,
    amount: BigNumberish,
    to: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  liquidateThresholdValue(overrides?: CallOverrides): Promise<BigNumber>;

  minBorrowValue(overrides?: CallOverrides): Promise<BigNumber>;

  oracle(overrides?: CallOverrides): Promise<string>;

  osd(overrides?: CallOverrides): Promise<string>;

  owner(overrides?: CallOverrides): Promise<string>;

  positions(
    arg0: string,
    overrides?: CallOverrides
  ): Promise<[BigNumber, BigNumber] & { debt: BigNumber; r0: BigNumber }>;

  renounceOwnership(
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  repay(
    _asset: string,
    amountMax: BigNumberish,
    collaterals: { token: string; amount: BigNumberish }[],
    to: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  setLiquidateThresholdValue(
    _liquidateThresholdValue: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  setMinBorrowValue(
    _minBorrowValue: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  setOracle(
    _oracle: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  setRouter(
    _router: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  transferOwnership(
    newOwner: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  updateAsset(
    _asset: string,
    base: BigNumberish,
    optimal: BigNumberish,
    slope1: BigNumberish,
    slope2: BigNumberish,
    borrowCredit: BigNumberish,
    collateralCredit: BigNumberish,
    penaltyRate: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  updateProtocolRevenue(
    _protocolRevenueAddress: string,
    _protocolRevenueRate: BigNumberish,
    _protocolRevenueFlashRate: BigNumberish,
    _flashLoanFeeRate: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  callStatic: {
    asset(
      overrides?: CallOverrides
    ): Promise<
      [
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        number,
        number,
        number,
        number,
        number,
        number,
        number,
        number
      ] & {
        debt: BigNumber;
        protocolRevenueAmount: BigNumber;
        protocolRevenueAmountExtract: BigNumber;
        r0: BigNumber;
        relativeInterest: BigNumber;
        updatedAt: BigNumber;
        interestRate: number;
        base: number;
        optimal: number;
        slope1: number;
        slope2: number;
        borrowCredit: number;
        collateralCredit: number;
        penaltyRate: number;
      }
    >;

    assetList(arg0: BigNumberish, overrides?: CallOverrides): Promise<string>;

    assets(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<
      [
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        number,
        number,
        number,
        number,
        number,
        number,
        number,
        number
      ] & {
        debt: BigNumber;
        protocolRevenueAmount: BigNumber;
        protocolRevenueAmountExtract: BigNumber;
        r0: BigNumber;
        relativeInterest: BigNumber;
        updatedAt: BigNumber;
        interestRate: number;
        base: number;
        optimal: number;
        slope1: number;
        slope2: number;
        borrowCredit: number;
        collateralCredit: number;
        penaltyRate: number;
      }
    >;

    borrow(
      amount: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: CallOverrides
    ): Promise<void>;

    extractProtocolRevenue(overrides?: CallOverrides): Promise<void>;

    getAccountDebt(
      _account: string,
      delaySeconds: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getAssetList(overrides?: CallOverrides): Promise<string[]>;

    getAssetsView(
      overrides?: CallOverrides
    ): Promise<
      [
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        number,
        number,
        number,
        number,
        number,
        number,
        number,
        number
      ] & {
        debt: BigNumber;
        r0: BigNumber;
        relativeInterest: BigNumber;
        updatedAt: BigNumber;
        interestRate: number;
        base: number;
        optimal: number;
        slope1: number;
        slope2: number;
        borrowCredit: number;
        collateralCredit: number;
        penaltyRate: number;
      }
    >;

    getCollaterals(
      _account: string,
      overrides?: CallOverrides
    ): Promise<([string, BigNumber] & { token: string; amount: BigNumber })[]>;

    getMaxAmountOfBorrow(
      _asset: string,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getMaxAmountOfRepay(
      _asset: string,
      collaterals: { token: string; amount: BigNumberish }[],
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getPositionsView(
      _account: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber, string[], BigNumber[]] & {
        debt: BigNumber;
        r0: BigNumber;
        collateralTokens: string[];
        collateralAmounts: BigNumber[];
      }
    >;

    liquidatable(_account: string, overrides?: CallOverrides): Promise<boolean>;

    liquidatableAmount(
      _asset: string,
      account: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    liquidate(
      _asset: string,
      account: string,
      amount: BigNumberish,
      to: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    liquidateThresholdValue(overrides?: CallOverrides): Promise<BigNumber>;

    minBorrowValue(overrides?: CallOverrides): Promise<BigNumber>;

    oracle(overrides?: CallOverrides): Promise<string>;

    osd(overrides?: CallOverrides): Promise<string>;

    owner(overrides?: CallOverrides): Promise<string>;

    positions(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<[BigNumber, BigNumber] & { debt: BigNumber; r0: BigNumber }>;

    renounceOwnership(overrides?: CallOverrides): Promise<void>;

    repay(
      _asset: string,
      amountMax: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    setLiquidateThresholdValue(
      _liquidateThresholdValue: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    setMinBorrowValue(
      _minBorrowValue: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    setOracle(_oracle: string, overrides?: CallOverrides): Promise<void>;

    setRouter(_router: string, overrides?: CallOverrides): Promise<void>;

    transferOwnership(
      newOwner: string,
      overrides?: CallOverrides
    ): Promise<void>;

    updateAsset(
      _asset: string,
      base: BigNumberish,
      optimal: BigNumberish,
      slope1: BigNumberish,
      slope2: BigNumberish,
      borrowCredit: BigNumberish,
      collateralCredit: BigNumberish,
      penaltyRate: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    updateProtocolRevenue(
      _protocolRevenueAddress: string,
      _protocolRevenueRate: BigNumberish,
      _protocolRevenueFlashRate: BigNumberish,
      _flashLoanFeeRate: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;
  };

  filters: {
    "Borrow(address,address,uint256)"(
      asset?: string | null,
      account?: string | null,
      amount?: null
    ): TypedEventFilter<
      [string, string, BigNumber],
      { asset: string; account: string; amount: BigNumber }
    >;

    Borrow(
      asset?: string | null,
      account?: string | null,
      amount?: null
    ): TypedEventFilter<
      [string, string, BigNumber],
      { asset: string; account: string; amount: BigNumber }
    >;

    "CollateralAdd(address,address,address,uint256)"(
      asset?: string | null,
      account?: string | null,
      colAsset?: string | null,
      amount?: null
    ): TypedEventFilter<
      [string, string, string, BigNumber],
      { asset: string; account: string; colAsset: string; amount: BigNumber }
    >;

    CollateralAdd(
      asset?: string | null,
      account?: string | null,
      colAsset?: string | null,
      amount?: null
    ): TypedEventFilter<
      [string, string, string, BigNumber],
      { asset: string; account: string; colAsset: string; amount: BigNumber }
    >;

    "CollateralRemove(address,address,address,uint256)"(
      asset?: string | null,
      account?: string | null,
      colAsset?: string | null,
      amount?: null
    ): TypedEventFilter<
      [string, string, string, BigNumber],
      { asset: string; account: string; colAsset: string; amount: BigNumber }
    >;

    CollateralRemove(
      asset?: string | null,
      account?: string | null,
      colAsset?: string | null,
      amount?: null
    ): TypedEventFilter<
      [string, string, string, BigNumber],
      { asset: string; account: string; colAsset: string; amount: BigNumber }
    >;

    "Liquidate(address,address,uint256)"(
      asset?: string | null,
      account?: string | null,
      amount?: null
    ): TypedEventFilter<
      [string, string, BigNumber],
      { asset: string; account: string; amount: BigNumber }
    >;

    Liquidate(
      asset?: string | null,
      account?: string | null,
      amount?: null
    ): TypedEventFilter<
      [string, string, BigNumber],
      { asset: string; account: string; amount: BigNumber }
    >;

    "OwnershipTransferred(address,address)"(
      previousOwner?: string | null,
      newOwner?: string | null
    ): TypedEventFilter<
      [string, string],
      { previousOwner: string; newOwner: string }
    >;

    OwnershipTransferred(
      previousOwner?: string | null,
      newOwner?: string | null
    ): TypedEventFilter<
      [string, string],
      { previousOwner: string; newOwner: string }
    >;

    "Repay(address,address,uint256)"(
      asset?: string | null,
      account?: string | null,
      amount?: null
    ): TypedEventFilter<
      [string, string, BigNumber],
      { asset: string; account: string; amount: BigNumber }
    >;

    Repay(
      asset?: string | null,
      account?: string | null,
      amount?: null
    ): TypedEventFilter<
      [string, string, BigNumber],
      { asset: string; account: string; amount: BigNumber }
    >;

    "UpdateDebtPosition(address,address,uint256)"(
      asset?: string | null,
      account?: string | null,
      debt?: null
    ): TypedEventFilter<
      [string, string, BigNumber],
      { asset: string; account: string; debt: BigNumber }
    >;

    UpdateDebtPosition(
      asset?: string | null,
      account?: string | null,
      debt?: null
    ): TypedEventFilter<
      [string, string, BigNumber],
      { asset: string; account: string; debt: BigNumber }
    >;
  };

  estimateGas: {
    asset(overrides?: CallOverrides): Promise<BigNumber>;

    assetList(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    assets(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;

    borrow(
      amount: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    extractProtocolRevenue(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    getAccountDebt(
      _account: string,
      delaySeconds: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getAssetList(overrides?: CallOverrides): Promise<BigNumber>;

    getAssetsView(overrides?: CallOverrides): Promise<BigNumber>;

    getCollaterals(
      _account: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getMaxAmountOfBorrow(
      _asset: string,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getMaxAmountOfRepay(
      _asset: string,
      collaterals: { token: string; amount: BigNumberish }[],
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getPositionsView(
      _account: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    liquidatable(
      _account: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    liquidatableAmount(
      _asset: string,
      account: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    liquidate(
      _asset: string,
      account: string,
      amount: BigNumberish,
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    liquidateThresholdValue(overrides?: CallOverrides): Promise<BigNumber>;

    minBorrowValue(overrides?: CallOverrides): Promise<BigNumber>;

    oracle(overrides?: CallOverrides): Promise<BigNumber>;

    osd(overrides?: CallOverrides): Promise<BigNumber>;

    owner(overrides?: CallOverrides): Promise<BigNumber>;

    positions(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;

    renounceOwnership(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    repay(
      _asset: string,
      amountMax: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    setLiquidateThresholdValue(
      _liquidateThresholdValue: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    setMinBorrowValue(
      _minBorrowValue: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    setOracle(
      _oracle: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    setRouter(
      _router: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    transferOwnership(
      newOwner: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    updateAsset(
      _asset: string,
      base: BigNumberish,
      optimal: BigNumberish,
      slope1: BigNumberish,
      slope2: BigNumberish,
      borrowCredit: BigNumberish,
      collateralCredit: BigNumberish,
      penaltyRate: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    updateProtocolRevenue(
      _protocolRevenueAddress: string,
      _protocolRevenueRate: BigNumberish,
      _protocolRevenueFlashRate: BigNumberish,
      _flashLoanFeeRate: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;
  };

  populateTransaction: {
    asset(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    assetList(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    assets(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    borrow(
      amount: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    extractProtocolRevenue(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    getAccountDebt(
      _account: string,
      delaySeconds: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getAssetList(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    getAssetsView(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    getCollaterals(
      _account: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getMaxAmountOfBorrow(
      _asset: string,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getMaxAmountOfRepay(
      _asset: string,
      collaterals: { token: string; amount: BigNumberish }[],
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getPositionsView(
      _account: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    liquidatable(
      _account: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    liquidatableAmount(
      _asset: string,
      account: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    liquidate(
      _asset: string,
      account: string,
      amount: BigNumberish,
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    liquidateThresholdValue(
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    minBorrowValue(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    oracle(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    osd(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    positions(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    renounceOwnership(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    repay(
      _asset: string,
      amountMax: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    setLiquidateThresholdValue(
      _liquidateThresholdValue: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    setMinBorrowValue(
      _minBorrowValue: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    setOracle(
      _oracle: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    setRouter(
      _router: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    transferOwnership(
      newOwner: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    updateAsset(
      _asset: string,
      base: BigNumberish,
      optimal: BigNumberish,
      slope1: BigNumberish,
      slope2: BigNumberish,
      borrowCredit: BigNumberish,
      collateralCredit: BigNumberish,
      penaltyRate: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    updateProtocolRevenue(
      _protocolRevenueAddress: string,
      _protocolRevenueRate: BigNumberish,
      _protocolRevenueFlashRate: BigNumberish,
      _flashLoanFeeRate: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;
  };
}
