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

import BN from "bn.js";
import { EventData, PastEventOptions } from "web3-eth-contract";

export interface PenalizerContract extends Truffle.Contract<PenalizerInstance> {
  "new"(
    _penalizeBlockDelay: number | BN | string,
    _penalizeBlockExpiration: number | BN | string,
    meta?: Truffle.TransactionDetails
  ): Promise<PenalizerInstance>;
}

export interface CommitAdded {
  name: "CommitAdded";
  args: {
    sender: string;
    commitHash: string;
    readyBlockNumber: BN;
    0: string;
    1: string;
    2: BN;
  };
}

type AllEvents = CommitAdded;

export interface PenalizerInstance extends Truffle.ContractInstance {
  commits(arg0: string, txDetails?: Truffle.TransactionDetails): Promise<BN>;

  versionPenalizer(txDetails?: Truffle.TransactionDetails): Promise<string>;

  /**
   * Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
   */
  supportsInterface(
    interfaceId: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<boolean>;

  /**
   */
  getPenalizeBlockDelay(txDetails?: Truffle.TransactionDetails): Promise<BN>;

  /**
   */
  getPenalizeBlockExpiration(
    txDetails?: Truffle.TransactionDetails
  ): Promise<BN>;

  /**
   */
  isTransactionTypeValid(
    rawTransaction: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<boolean>;

  /**
   */
  decodeTransaction(
    rawTransaction: string,
    txDetails?: Truffle.TransactionDetails
  ): Promise<{ nonce: BN; gasLimit: BN; to: string; value: BN; data: string }>;

  /**
   * Called by the reporter as the first step in the commit-reveal process. Any sender can call it to make sure no-one can front-run it to claim this penalization.
   * @param commitHash The hash of the report of a penalizable behaviour the reporter wants to reveal. Calculated as `commit(keccak(encodedPenalizeFunction))`.
   */
  commit: {
    (commitHash: string, txDetails?: Truffle.TransactionDetails): Promise<
      Truffle.TransactionResponse<AllEvents>
    >;
    call(
      commitHash: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      commitHash: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      commitHash: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Called by the reporter as the second step in the commit-reveal process. If a Relay Worker attacked the system by signing multiple transactions with same nonce so only one is accepted, anyone can grab both transactions from the blockchain and submit them here. Check whether `unsignedTx1` != `unsignedTx2`, that both are signed by the same address, and that `unsignedTx1.nonce` == `unsignedTx2.nonce`. If all conditions are met, relay is considered an "offending relay". The offending relay will be unregistered immediately, its stake will be forfeited and given to the address who reported it (the `msg.sender`), thus incentivizing anyone to report offending relays.
   */
  penalizeRepeatedNonce: {
    (
      unsignedTx1: string,
      signature1: string,
      unsignedTx2: string,
      signature2: string,
      hub: string,
      randomValue: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      unsignedTx1: string,
      signature1: string,
      unsignedTx2: string,
      signature2: string,
      hub: string,
      randomValue: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      unsignedTx1: string,
      signature1: string,
      unsignedTx2: string,
      signature2: string,
      hub: string,
      randomValue: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      unsignedTx1: string,
      signature1: string,
      unsignedTx2: string,
      signature2: string,
      hub: string,
      randomValue: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  /**
   * Called by the reporter as the second step in the commit-reveal process. The Relay Workers are not allowed to make calls other than to the `relayCall` method.
   */
  penalizeIllegalTransaction: {
    (
      unsignedTx: string,
      signature: string,
      hub: string,
      randomValue: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<Truffle.TransactionResponse<AllEvents>>;
    call(
      unsignedTx: string,
      signature: string,
      hub: string,
      randomValue: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<void>;
    sendTransaction(
      unsignedTx: string,
      signature: string,
      hub: string,
      randomValue: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<string>;
    estimateGas(
      unsignedTx: string,
      signature: string,
      hub: string,
      randomValue: number | BN | string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<number>;
  };

  methods: {
    commits(arg0: string, txDetails?: Truffle.TransactionDetails): Promise<BN>;

    versionPenalizer(txDetails?: Truffle.TransactionDetails): Promise<string>;

    /**
     * Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.
     */
    supportsInterface(
      interfaceId: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<boolean>;

    /**
     */
    getPenalizeBlockDelay(txDetails?: Truffle.TransactionDetails): Promise<BN>;

    /**
     */
    getPenalizeBlockExpiration(
      txDetails?: Truffle.TransactionDetails
    ): Promise<BN>;

    /**
     */
    isTransactionTypeValid(
      rawTransaction: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<boolean>;

    /**
     */
    decodeTransaction(
      rawTransaction: string,
      txDetails?: Truffle.TransactionDetails
    ): Promise<{
      nonce: BN;
      gasLimit: BN;
      to: string;
      value: BN;
      data: string;
    }>;

    /**
     * Called by the reporter as the first step in the commit-reveal process. Any sender can call it to make sure no-one can front-run it to claim this penalization.
     * @param commitHash The hash of the report of a penalizable behaviour the reporter wants to reveal. Calculated as `commit(keccak(encodedPenalizeFunction))`.
     */
    commit: {
      (commitHash: string, txDetails?: Truffle.TransactionDetails): Promise<
        Truffle.TransactionResponse<AllEvents>
      >;
      call(
        commitHash: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        commitHash: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        commitHash: string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Called by the reporter as the second step in the commit-reveal process. If a Relay Worker attacked the system by signing multiple transactions with same nonce so only one is accepted, anyone can grab both transactions from the blockchain and submit them here. Check whether `unsignedTx1` != `unsignedTx2`, that both are signed by the same address, and that `unsignedTx1.nonce` == `unsignedTx2.nonce`. If all conditions are met, relay is considered an "offending relay". The offending relay will be unregistered immediately, its stake will be forfeited and given to the address who reported it (the `msg.sender`), thus incentivizing anyone to report offending relays.
     */
    penalizeRepeatedNonce: {
      (
        unsignedTx1: string,
        signature1: string,
        unsignedTx2: string,
        signature2: string,
        hub: string,
        randomValue: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        unsignedTx1: string,
        signature1: string,
        unsignedTx2: string,
        signature2: string,
        hub: string,
        randomValue: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        unsignedTx1: string,
        signature1: string,
        unsignedTx2: string,
        signature2: string,
        hub: string,
        randomValue: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        unsignedTx1: string,
        signature1: string,
        unsignedTx2: string,
        signature2: string,
        hub: string,
        randomValue: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };

    /**
     * Called by the reporter as the second step in the commit-reveal process. The Relay Workers are not allowed to make calls other than to the `relayCall` method.
     */
    penalizeIllegalTransaction: {
      (
        unsignedTx: string,
        signature: string,
        hub: string,
        randomValue: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<Truffle.TransactionResponse<AllEvents>>;
      call(
        unsignedTx: string,
        signature: string,
        hub: string,
        randomValue: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<void>;
      sendTransaction(
        unsignedTx: string,
        signature: string,
        hub: string,
        randomValue: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<string>;
      estimateGas(
        unsignedTx: string,
        signature: string,
        hub: string,
        randomValue: number | BN | string,
        txDetails?: Truffle.TransactionDetails
      ): Promise<number>;
    };
  };

  getPastEvents(event: string): Promise<EventData[]>;
  getPastEvents(
    event: string,
    options: PastEventOptions,
    callback: (error: Error, event: EventData) => void
  ): Promise<EventData[]>;
  getPastEvents(event: string, options: PastEventOptions): Promise<EventData[]>;
  getPastEvents(
    event: string,
    callback: (error: Error, event: EventData) => void
  ): Promise<EventData[]>;
}
