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

import { Contract, Signer, utils } from "ethers";
import type { Provider } from "@ethersproject/providers";
import type {
  TronMulticallHandler,
  TronMulticallHandlerInterface,
} from "../TronMulticallHandler";

const _abi = [
  {
    type: "receive",
    stateMutability: "payable",
  },
  {
    type: "function",
    name: "attemptCalls",
    inputs: [
      {
        name: "calls",
        type: "tuple[]",
        internalType: "struct MulticallHandler.Call[]",
        components: [
          {
            name: "target",
            type: "address",
            internalType: "address",
          },
          {
            name: "callData",
            type: "bytes",
            internalType: "bytes",
          },
          {
            name: "value",
            type: "uint256",
            internalType: "uint256",
          },
        ],
      },
    ],
    outputs: [],
    stateMutability: "nonpayable",
  },
  {
    type: "function",
    name: "drainLeftoverTokens",
    inputs: [
      {
        name: "token",
        type: "address",
        internalType: "address",
      },
      {
        name: "destination",
        type: "address",
        internalType: "address payable",
      },
    ],
    outputs: [],
    stateMutability: "nonpayable",
  },
  {
    type: "function",
    name: "handleV3AcrossMessage",
    inputs: [
      {
        name: "token",
        type: "address",
        internalType: "address",
      },
      {
        name: "",
        type: "uint256",
        internalType: "uint256",
      },
      {
        name: "",
        type: "address",
        internalType: "address",
      },
      {
        name: "message",
        type: "bytes",
        internalType: "bytes",
      },
    ],
    outputs: [],
    stateMutability: "nonpayable",
  },
  {
    type: "function",
    name: "makeCallWithBalance",
    inputs: [
      {
        name: "target",
        type: "address",
        internalType: "address",
      },
      {
        name: "callData",
        type: "bytes",
        internalType: "bytes",
      },
      {
        name: "value",
        type: "uint256",
        internalType: "uint256",
      },
      {
        name: "replacement",
        type: "tuple[]",
        internalType: "struct MulticallHandler.Replacement[]",
        components: [
          {
            name: "token",
            type: "address",
            internalType: "address",
          },
          {
            name: "offset",
            type: "uint256",
            internalType: "uint256",
          },
        ],
      },
    ],
    outputs: [],
    stateMutability: "nonpayable",
  },
  {
    type: "event",
    name: "CallsFailed",
    inputs: [
      {
        name: "calls",
        type: "tuple[]",
        indexed: false,
        internalType: "struct MulticallHandler.Call[]",
        components: [
          {
            name: "target",
            type: "address",
            internalType: "address",
          },
          {
            name: "callData",
            type: "bytes",
            internalType: "bytes",
          },
          {
            name: "value",
            type: "uint256",
            internalType: "uint256",
          },
        ],
      },
      {
        name: "fallbackRecipient",
        type: "address",
        indexed: true,
        internalType: "address",
      },
    ],
    anonymous: false,
  },
  {
    type: "event",
    name: "DrainedTokens",
    inputs: [
      {
        name: "recipient",
        type: "address",
        indexed: true,
        internalType: "address",
      },
      {
        name: "token",
        type: "address",
        indexed: true,
        internalType: "address",
      },
      {
        name: "amount",
        type: "uint256",
        indexed: true,
        internalType: "uint256",
      },
    ],
    anonymous: false,
  },
  {
    type: "error",
    name: "CallReverted",
    inputs: [
      {
        name: "index",
        type: "uint256",
        internalType: "uint256",
      },
      {
        name: "calls",
        type: "tuple[]",
        internalType: "struct MulticallHandler.Call[]",
        components: [
          {
            name: "target",
            type: "address",
            internalType: "address",
          },
          {
            name: "callData",
            type: "bytes",
            internalType: "bytes",
          },
          {
            name: "value",
            type: "uint256",
            internalType: "uint256",
          },
        ],
      },
    ],
  },
  {
    type: "error",
    name: "CalldataTooShort",
    inputs: [
      {
        name: "callDataLength",
        type: "uint256",
        internalType: "uint256",
      },
      {
        name: "offset",
        type: "uint256",
        internalType: "uint256",
      },
    ],
  },
  {
    type: "error",
    name: "InvalidCall",
    inputs: [
      {
        name: "index",
        type: "uint256",
        internalType: "uint256",
      },
      {
        name: "calls",
        type: "tuple[]",
        internalType: "struct MulticallHandler.Call[]",
        components: [
          {
            name: "target",
            type: "address",
            internalType: "address",
          },
          {
            name: "callData",
            type: "bytes",
            internalType: "bytes",
          },
          {
            name: "value",
            type: "uint256",
            internalType: "uint256",
          },
        ],
      },
    ],
  },
  {
    type: "error",
    name: "NotSelf",
    inputs: [],
  },
  {
    type: "error",
    name: "ReplacementCallFailed",
    inputs: [
      {
        name: "callData",
        type: "bytes",
        internalType: "bytes",
      },
    ],
  },
  {
    type: "error",
    name: "TronTransferBalanceMismatch",
    inputs: [],
  },
  {
    type: "error",
    name: "TronTransferCallReverted",
    inputs: [],
  },
] as const;

export class TronMulticallHandler__factory {
  static readonly abi = _abi;
  static createInterface(): TronMulticallHandlerInterface {
    return new utils.Interface(_abi) as TronMulticallHandlerInterface;
  }
  static connect(
    address: string,
    signerOrProvider: Signer | Provider
  ): TronMulticallHandler {
    return new Contract(
      address,
      _abi,
      signerOrProvider
    ) as TronMulticallHandler;
  }
}
