/* 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 { TypedEventFilter, TypedEvent, TypedListener } from "./commons";

interface EpochManagerInterface extends ethers.utils.Interface {
  functions: {
    "acceptProxy(address)": FunctionFragment;
    "acceptProxyAndCall(address,bytes)": FunctionFragment;
    "blockHash(uint256)": FunctionFragment;
    "blockNum()": FunctionFragment;
    "controller()": FunctionFragment;
    "currentEpoch()": FunctionFragment;
    "currentEpochBlock()": FunctionFragment;
    "currentEpochBlockSinceStart()": FunctionFragment;
    "epochLength()": FunctionFragment;
    "epochsSince(uint256)": FunctionFragment;
    "epochsSinceUpdate()": FunctionFragment;
    "initialize(address,uint256)": FunctionFragment;
    "isCurrentEpochRun()": FunctionFragment;
    "lastLengthUpdateBlock()": FunctionFragment;
    "lastLengthUpdateEpoch()": FunctionFragment;
    "lastRunEpoch()": FunctionFragment;
    "runEpoch()": FunctionFragment;
    "setController(address)": FunctionFragment;
    "setEpochLength(uint256)": FunctionFragment;
    "syncAllContracts()": FunctionFragment;
  };

  encodeFunctionData(functionFragment: "acceptProxy", values: [string]): string;
  encodeFunctionData(
    functionFragment: "acceptProxyAndCall",
    values: [string, BytesLike]
  ): string;
  encodeFunctionData(
    functionFragment: "blockHash",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(functionFragment: "blockNum", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "controller",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "currentEpoch",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "currentEpochBlock",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "currentEpochBlockSinceStart",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "epochLength",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "epochsSince",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "epochsSinceUpdate",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "initialize",
    values: [string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "isCurrentEpochRun",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "lastLengthUpdateBlock",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "lastLengthUpdateEpoch",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "lastRunEpoch",
    values?: undefined
  ): string;
  encodeFunctionData(functionFragment: "runEpoch", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "setController",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "setEpochLength",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "syncAllContracts",
    values?: undefined
  ): string;

  decodeFunctionResult(
    functionFragment: "acceptProxy",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "acceptProxyAndCall",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "blockHash", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "blockNum", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "controller", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "currentEpoch",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "currentEpochBlock",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "currentEpochBlockSinceStart",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "epochLength",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "epochsSince",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "epochsSinceUpdate",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "isCurrentEpochRun",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "lastLengthUpdateBlock",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "lastLengthUpdateEpoch",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "lastRunEpoch",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "runEpoch", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "setController",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "setEpochLength",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "syncAllContracts",
    data: BytesLike
  ): Result;

  events: {
    "ContractSynced(bytes32,address)": EventFragment;
    "EpochLengthUpdate(uint256,uint256)": EventFragment;
    "EpochRun(uint256,address)": EventFragment;
    "ParameterUpdated(string)": EventFragment;
    "SetController(address)": EventFragment;
  };

  getEvent(nameOrSignatureOrTopic: "ContractSynced"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "EpochLengthUpdate"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "EpochRun"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "ParameterUpdated"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "SetController"): EventFragment;
}

export class EpochManager 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: EpochManagerInterface;

  functions: {
    acceptProxy(
      _proxy: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    acceptProxyAndCall(
      _proxy: string,
      _data: BytesLike,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    blockHash(
      _block: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[string]>;

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

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

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

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

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

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

    epochsSince(
      _epoch: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[BigNumber]>;

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

    initialize(
      _controller: string,
      _epochLength: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    isCurrentEpochRun(overrides?: CallOverrides): Promise<[boolean]>;

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

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

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

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

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

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

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

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

  acceptProxyAndCall(
    _proxy: string,
    _data: BytesLike,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  blockHash(_block: BigNumberish, overrides?: CallOverrides): Promise<string>;

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

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

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

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

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

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

  epochsSince(
    _epoch: BigNumberish,
    overrides?: CallOverrides
  ): Promise<BigNumber>;

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

  initialize(
    _controller: string,
    _epochLength: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  isCurrentEpochRun(overrides?: CallOverrides): Promise<boolean>;

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

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

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

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

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

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

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

  callStatic: {
    acceptProxy(_proxy: string, overrides?: CallOverrides): Promise<void>;

    acceptProxyAndCall(
      _proxy: string,
      _data: BytesLike,
      overrides?: CallOverrides
    ): Promise<void>;

    blockHash(_block: BigNumberish, overrides?: CallOverrides): Promise<string>;

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

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

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

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

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

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

    epochsSince(
      _epoch: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

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

    initialize(
      _controller: string,
      _epochLength: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    isCurrentEpochRun(overrides?: CallOverrides): Promise<boolean>;

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

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

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

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

    setController(
      _controller: string,
      overrides?: CallOverrides
    ): Promise<void>;

    setEpochLength(
      _epochLength: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    syncAllContracts(overrides?: CallOverrides): Promise<void>;
  };

  filters: {
    ContractSynced(
      nameHash?: BytesLike | null,
      contractAddress?: null
    ): TypedEventFilter<
      [string, string],
      { nameHash: string; contractAddress: string }
    >;

    EpochLengthUpdate(
      epoch?: BigNumberish | null,
      epochLength?: null
    ): TypedEventFilter<
      [BigNumber, BigNumber],
      { epoch: BigNumber; epochLength: BigNumber }
    >;

    EpochRun(
      epoch?: BigNumberish | null,
      caller?: null
    ): TypedEventFilter<
      [BigNumber, string],
      { epoch: BigNumber; caller: string }
    >;

    ParameterUpdated(
      param?: null
    ): TypedEventFilter<[string], { param: string }>;

    SetController(
      controller?: null
    ): TypedEventFilter<[string], { controller: string }>;
  };

  estimateGas: {
    acceptProxy(
      _proxy: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    acceptProxyAndCall(
      _proxy: string,
      _data: BytesLike,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    blockHash(
      _block: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

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

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

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

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

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

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

    epochsSince(
      _epoch: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

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

    initialize(
      _controller: string,
      _epochLength: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

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

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

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

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

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

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

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

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

  populateTransaction: {
    acceptProxy(
      _proxy: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    acceptProxyAndCall(
      _proxy: string,
      _data: BytesLike,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    blockHash(
      _block: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

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

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

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

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

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

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

    epochsSince(
      _epoch: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

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

    initialize(
      _controller: string,
      _epochLength: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

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

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

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

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

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

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

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

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