/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, ContractFactory, ContractTransactionResponse, Interface } from 'ethers'
import type { Signer, BigNumberish, AddressLike, ContractDeployTransaction, ContractRunner } from 'ethers'
import type { NonPayableOverrides } from '../../../common'
import type { PaymentsEscrow, PaymentsEscrowInterface } from '../../../contracts/payments/PaymentsEscrow'

const _abi = [
  {
    inputs: [
      {
        internalType: 'address',
        name: 'controller',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'withdrawEscrowThawingPeriod',
        type: 'uint256',
      },
    ],
    stateMutability: 'nonpayable',
    type: 'constructor',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'target',
        type: 'address',
      },
    ],
    name: 'AddressEmptyCode',
    type: 'error',
  },
  {
    inputs: [],
    name: 'FailedCall',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'bytes',
        name: 'contractName',
        type: 'bytes',
      },
    ],
    name: 'GraphDirectoryInvalidZeroAddress',
    type: 'error',
  },
  {
    inputs: [],
    name: 'InvalidInitialization',
    type: 'error',
  },
  {
    inputs: [],
    name: 'NotInitializing',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'uint256',
        name: 'balanceBefore',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'balanceAfter',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'tokens',
        type: 'uint256',
      },
    ],
    name: 'PaymentsEscrowInconsistentCollection',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'uint256',
        name: 'balance',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'minBalance',
        type: 'uint256',
      },
    ],
    name: 'PaymentsEscrowInsufficientBalance',
    type: 'error',
  },
  {
    inputs: [],
    name: 'PaymentsEscrowInvalidZeroTokens',
    type: 'error',
  },
  {
    inputs: [],
    name: 'PaymentsEscrowIsPaused',
    type: 'error',
  },
  {
    inputs: [],
    name: 'PaymentsEscrowNotThawing',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'uint256',
        name: 'currentTimestamp',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'thawEndTimestamp',
        type: 'uint256',
      },
    ],
    name: 'PaymentsEscrowStillThawing',
    type: 'error',
  },
  {
    inputs: [
      {
        internalType: 'uint256',
        name: 'thawingPeriod',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'maxWaitPeriod',
        type: 'uint256',
      },
    ],
    name: 'PaymentsEscrowThawingPeriodTooLong',
    type: 'error',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: true,
        internalType: 'address',
        name: 'payer',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'collector',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'uint256',
        name: 'tokensThawing',
        type: 'uint256',
      },
      {
        indexed: false,
        internalType: 'uint256',
        name: 'thawEndTimestamp',
        type: 'uint256',
      },
    ],
    name: 'CancelThaw',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: true,
        internalType: 'address',
        name: 'payer',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'collector',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'uint256',
        name: 'tokens',
        type: 'uint256',
      },
    ],
    name: 'Deposit',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: true,
        internalType: 'enum IGraphPayments.PaymentTypes',
        name: 'paymentType',
        type: 'uint8',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'payer',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'collector',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'uint256',
        name: 'tokens',
        type: 'uint256',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'receiverDestination',
        type: 'address',
      },
    ],
    name: 'EscrowCollected',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: true,
        internalType: 'address',
        name: 'graphToken',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'graphStaking',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphPayments',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphEscrow',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'graphController',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphEpochManager',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphRewardsManager',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphTokenGateway',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphProxyAdmin',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'address',
        name: 'graphCuration',
        type: 'address',
      },
    ],
    name: 'GraphDirectoryInitialized',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: false,
        internalType: 'uint64',
        name: 'version',
        type: 'uint64',
      },
    ],
    name: 'Initialized',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: true,
        internalType: 'address',
        name: 'payer',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'collector',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'uint256',
        name: 'tokens',
        type: 'uint256',
      },
      {
        indexed: false,
        internalType: 'uint256',
        name: 'thawEndTimestamp',
        type: 'uint256',
      },
    ],
    name: 'Thaw',
    type: 'event',
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: true,
        internalType: 'address',
        name: 'payer',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'collector',
        type: 'address',
      },
      {
        indexed: true,
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
      {
        indexed: false,
        internalType: 'uint256',
        name: 'tokens',
        type: 'uint256',
      },
    ],
    name: 'Withdraw',
    type: 'event',
  },
  {
    inputs: [],
    name: 'MAX_WAIT_PERIOD',
    outputs: [
      {
        internalType: 'uint256',
        name: '',
        type: 'uint256',
      },
    ],
    stateMutability: 'view',
    type: 'function',
  },
  {
    inputs: [],
    name: 'WITHDRAW_ESCROW_THAWING_PERIOD',
    outputs: [
      {
        internalType: 'uint256',
        name: '',
        type: 'uint256',
      },
    ],
    stateMutability: 'view',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'collector',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
    ],
    name: 'cancelThaw',
    outputs: [],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'enum IGraphPayments.PaymentTypes',
        name: 'paymentType',
        type: 'uint8',
      },
      {
        internalType: 'address',
        name: 'payer',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'tokens',
        type: 'uint256',
      },
      {
        internalType: 'address',
        name: 'dataService',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'dataServiceCut',
        type: 'uint256',
      },
      {
        internalType: 'address',
        name: 'receiverDestination',
        type: 'address',
      },
    ],
    name: 'collect',
    outputs: [],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'collector',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'tokens',
        type: 'uint256',
      },
    ],
    name: 'deposit',
    outputs: [],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'payer',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'collector',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'tokens',
        type: 'uint256',
      },
    ],
    name: 'depositTo',
    outputs: [],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'payer',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'collector',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
    ],
    name: 'escrowAccounts',
    outputs: [
      {
        internalType: 'uint256',
        name: 'balance',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'tokensThawing',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'thawEndTimestamp',
        type: 'uint256',
      },
    ],
    stateMutability: 'view',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'payer',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'collector',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
    ],
    name: 'getBalance',
    outputs: [
      {
        internalType: 'uint256',
        name: '',
        type: 'uint256',
      },
    ],
    stateMutability: 'view',
    type: 'function',
  },
  {
    inputs: [],
    name: 'initialize',
    outputs: [],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'bytes[]',
        name: 'data',
        type: 'bytes[]',
      },
    ],
    name: 'multicall',
    outputs: [
      {
        internalType: 'bytes[]',
        name: 'results',
        type: 'bytes[]',
      },
    ],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'collector',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'tokens',
        type: 'uint256',
      },
    ],
    name: 'thaw',
    outputs: [],
    stateMutability: 'nonpayable',
    type: 'function',
  },
  {
    inputs: [
      {
        internalType: 'address',
        name: 'collector',
        type: 'address',
      },
      {
        internalType: 'address',
        name: 'receiver',
        type: 'address',
      },
    ],
    name: 'withdraw',
    outputs: [],
    stateMutability: 'nonpayable',
    type: 'function',
  },
] as const

const _bytecode =
  ' '

type PaymentsEscrowConstructorParams = [signer?: Signer] | ConstructorParameters<typeof ContractFactory>

const isSuperArgs = (xs: PaymentsEscrowConstructorParams): xs is ConstructorParameters<typeof ContractFactory> =>
  xs.length > 1

export class PaymentsEscrow__factory extends ContractFactory {
  constructor(...args: PaymentsEscrowConstructorParams) {
    if (isSuperArgs(args)) {
      super(...args)
    } else {
      super(_abi, _bytecode, args[0])
    }
  }

  override getDeployTransaction(
    controller: AddressLike,
    withdrawEscrowThawingPeriod: BigNumberish,
    overrides?: NonPayableOverrides & { from?: string },
  ): Promise<ContractDeployTransaction> {
    return super.getDeployTransaction(controller, withdrawEscrowThawingPeriod, overrides || {})
  }
  override deploy(
    controller: AddressLike,
    withdrawEscrowThawingPeriod: BigNumberish,
    overrides?: NonPayableOverrides & { from?: string },
  ) {
    return super.deploy(controller, withdrawEscrowThawingPeriod, overrides || {}) as Promise<
      PaymentsEscrow & {
        deploymentTransaction(): ContractTransactionResponse
      }
    >
  }
  override connect(runner: ContractRunner | null): PaymentsEscrow__factory {
    return super.connect(runner) as PaymentsEscrow__factory
  }

  static readonly bytecode = _bytecode
  static readonly abi = _abi
  static createInterface(): PaymentsEscrowInterface {
    return new Interface(_abi) as PaymentsEscrowInterface
  }
  static connect(address: string, runner?: ContractRunner | null): PaymentsEscrow {
    return new Contract(address, _abi, runner) as unknown as PaymentsEscrow
  }
}
