Untitled

mail@pastecode.io avatar
unknown
typescript
2 months ago
9.6 kB
3
Indexable
Never
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */

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

const _abi = [
  {
    inputs: [
      {
        internalType: "address",
        name: "dist_addr",
        type: "address",
      },
    ],
    stateMutability: "nonpayable",
    type: "constructor",
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: false,
        internalType: "address",
        name: "staff_addr",
        type: "address",
      },
      {
        indexed: false,
        internalType: "string",
        name: "location",
        type: "string",
      },
    ],
    name: "AddedStaff",
    type: "event",
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: false,
        internalType: "address",
        name: "buyer_addr",
        type: "address",
      },
      {
        indexed: false,
        internalType: "string",
        name: "name",
        type: "string",
      },
      {
        indexed: false,
        internalType: "string",
        name: "cert_hash",
        type: "string",
      },
    ],
    name: "BuyerCreated",
    type: "event",
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: false,
        internalType: "uint256",
        name: "order_id",
        type: "uint256",
      },
    ],
    name: "MarkedAsReceived",
    type: "event",
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: false,
        internalType: "address",
        name: "buyer",
        type: "address",
      },
      {
        indexed: false,
        internalType: "uint256",
        name: "product_id",
        type: "uint256",
      },
      {
        indexed: false,
        internalType: "uint256",
        name: "order_id",
        type: "uint256",
      },
    ],
    name: "ProductBought",
    type: "event",
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: false,
        internalType: "address",
        name: "manufacturer",
        type: "address",
      },
      {
        indexed: false,
        internalType: "string",
        name: "name",
        type: "string",
      },
      {
        indexed: false,
        internalType: "string",
        name: "img_hash",
        type: "string",
      },
      {
        indexed: false,
        internalType: "string",
        name: "desc",
        type: "string",
      },
      {
        indexed: false,
        internalType: "uint256",
        name: "price",
        type: "uint256",
      },
      {
        indexed: false,
        internalType: "uint256",
        name: "quantity",
        type: "uint256",
      },
      {
        indexed: false,
        internalType: "uint256",
        name: "id",
        type: "uint256",
      },
    ],
    name: "ProductCreated",
    type: "event",
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: false,
        internalType: "address",
        name: "staff_addr",
        type: "address",
      },
      {
        indexed: false,
        internalType: "uint256",
        name: "order_id",
        type: "uint256",
      },
    ],
    name: "UpdatedLocation",
    type: "event",
  },
  {
    anonymous: false,
    inputs: [
      {
        indexed: false,
        internalType: "address",
        name: "buyer_addr",
        type: "address",
      },
    ],
    name: "VerifiedBuyer",
    type: "event",
  },
  {
    inputs: [
      {
        internalType: "address",
        name: "staff",
        type: "address",
      },
      {
        internalType: "string",
        name: "location",
        type: "string",
      },
    ],
    name: "addStaff",
    outputs: [],
    stateMutability: "nonpayable",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "address",
        name: "",
        type: "address",
      },
    ],
    name: "addr_to_buyer",
    outputs: [
      {
        internalType: "string",
        name: "name",
        type: "string",
      },
      {
        internalType: "string",
        name: "cert_hash",
        type: "string",
      },
      {
        internalType: "bool",
        name: "verified",
        type: "bool",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "address",
        name: "",
        type: "address",
      },
    ],
    name: "addr_to_staff",
    outputs: [
      {
        internalType: "string",
        name: "location",
        type: "string",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "address",
        name: "",
        type: "address",
      },
    ],
    name: "addr_to_verified_buyer",
    outputs: [
      {
        internalType: "address",
        name: "buyer_addr",
        type: "address",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [],
    name: "admin",
    outputs: [
      {
        internalType: "address",
        name: "",
        type: "address",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256[]",
        name: "ids",
        type: "uint256[]",
      },
    ],
    name: "buyProduct",
    outputs: [],
    stateMutability: "payable",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "string",
        name: "name",
        type: "string",
      },
      {
        internalType: "string",
        name: "cert_hash",
        type: "string",
      },
    ],
    name: "createBuyer",
    outputs: [],
    stateMutability: "nonpayable",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "string",
        name: "name",
        type: "string",
      },
      {
        internalType: "string",
        name: "img_hash",
        type: "string",
      },
      {
        internalType: "string",
        name: "desc",
        type: "string",
      },
      {
        internalType: "uint256",
        name: "price",
        type: "uint256",
      },
      {
        internalType: "uint256",
        name: "quantity",
        type: "uint256",
      },
    ],
    name: "createProduct",
    outputs: [],
    stateMutability: "nonpayable",
    type: "function",
  },
  {
    inputs: [],
    name: "distributor_addr",
    outputs: [
      {
        internalType: "address",
        name: "",
        type: "address",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "",
        type: "uint256",
      },
    ],
    name: "id_to_order",
    outputs: [
      {
        internalType: "address",
        name: "buyer",
        type: "address",
      },
      {
        internalType: "uint256",
        name: "product_id",
        type: "uint256",
      },
      {
        internalType: "address",
        name: "staff_addr",
        type: "address",
      },
      {
        internalType: "bool",
        name: "delivered",
        type: "bool",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "",
        type: "uint256",
      },
    ],
    name: "id_to_product",
    outputs: [
      {
        internalType: "address",
        name: "manufacturer",
        type: "address",
      },
      {
        internalType: "string",
        name: "img_hash",
        type: "string",
      },
      {
        internalType: "string",
        name: "name",
        type: "string",
      },
      {
        internalType: "string",
        name: "desc",
        type: "string",
      },
      {
        internalType: "uint256",
        name: "price",
        type: "uint256",
      },
      {
        internalType: "uint256",
        name: "quantity",
        type: "uint256",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "order_id",
        type: "uint256",
      },
    ],
    name: "markAsReceived",
    outputs: [],
    stateMutability: "nonpayable",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "order_id",
        type: "uint256",
      },
    ],
    name: "updateOrderLocation",
    outputs: [],
    stateMutability: "nonpayable",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "address",
        name: "buyer_addr",
        type: "address",
      },
    ],
    name: "verifyBuyer",
    outputs: [],
    stateMutability: "nonpayable",
    type: "function",
  },
] as const;

export class SupplyChain__factory {
  static readonly abi = _abi;
  static createInterface(): SupplyChainInterface {
    return new utils.Interface(_abi) as SupplyChainInterface;
  }
  static connect(
    address: string,
    signerOrProvider: Signer | Provider
  ): SupplyChain {
    return new Contract(address, _abi, signerOrProvider) as SupplyChain;
  }
}
Leave a Comment