From f18bc8d8917ad7a9b9c6ba5af377b3f56a51b5da Mon Sep 17 00:00:00 2001 From: CanvasL <746591811@qq.com> Date: Tue, 23 Jul 2024 19:30:00 +0800 Subject: [PATCH 1/4] feat: upgradeable contract --- contracts/ProductFactory.sol | 32 +++++++++++++++++--------- script/DeployProductFactory.s.sol | 12 ++++++++-- test/ProductFactory.t.sol | 37 +++++++++++++++++++++++++------ test/mock/ProductFactoryV2.sol | 14 ++++++++++++ 4 files changed, 75 insertions(+), 20 deletions(-) create mode 100644 test/mock/ProductFactoryV2.sol diff --git a/contracts/ProductFactory.sol b/contracts/ProductFactory.sol index 6a64758..2e2a705 100644 --- a/contracts/ProductFactory.sol +++ b/contracts/ProductFactory.sol @@ -1,21 +1,23 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.24; -import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; -import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; -import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol"; import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol"; +import {EIP712Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol"; +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; +import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {IProductFactory} from "./IProductFactory.sol"; import {IProduct} from "./IProduct.sol"; contract ProductFactory is IProductFactory, - Ownable, - EIP712, - ReentrancyGuard, - Pausable + OwnableUpgradeable, + EIP712Upgradeable, + ReentrancyGuardUpgradeable, + PausableUpgradeable, + UUPSUpgradeable { string public constant DEPHY_PREFIX = "DEPHY_ID_SIGNED_MESSAGE:"; bytes32 public constant ACTIVATE_DEVICE_TYPEHASH = @@ -29,9 +31,13 @@ contract ProductFactory is mapping(address => mapping(address => uint256)) internal _tokenIdByProductByDevice; - constructor( - address initialOwner - ) EIP712("ProductFactory", "1") Ownable(initialOwner) {} + function initialize(address initialOwner) public virtual initializer { + __Ownable_init(initialOwner); + __EIP712_init("ProductFactory", "1"); + __ReentrancyGuard_init(); + __Pausable_init(); + __UUPSUpgradeable_init(); + } modifier onlyVendor(address product) { if (msg.sender != _vendorByProduct[product]) { @@ -244,4 +250,8 @@ contract ProductFactory is ); return recoveredAddress; } + + function _authorizeUpgrade( + address newImplementation + ) internal virtual override onlyOwner {} } diff --git a/script/DeployProductFactory.s.sol b/script/DeployProductFactory.s.sol index f3bbe1e..f9d7dd7 100644 --- a/script/DeployProductFactory.s.sol +++ b/script/DeployProductFactory.s.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; +import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import {ProductFactory} from "../contracts/ProductFactory.sol"; import "forge-std/Script.sol"; @@ -8,8 +9,15 @@ contract DeployProductFactory is Script { function run() public returns (address) { uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); vm.startBroadcast(deployerPrivateKey); - ProductFactory factory = new ProductFactory(vm.addr(deployerPrivateKey)); + ProductFactory factoryImpl = new ProductFactory(); + ERC1967Proxy factoryProxy = new ERC1967Proxy( + address(factoryImpl), + abi.encodeWithSelector( + ProductFactory.initialize.selector, + vm.addr(deployerPrivateKey) + ) + ); vm.stopBroadcast(); - return address(factory); + return address(factoryProxy); } } diff --git a/test/ProductFactory.t.sol b/test/ProductFactory.t.sol index 853a0cf..0c16399 100644 --- a/test/ProductFactory.t.sol +++ b/test/ProductFactory.t.sol @@ -1,14 +1,16 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; +import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import {IProductFactory} from "../contracts/IProductFactory.sol"; import {ProductFactory} from "../contracts/ProductFactory.sol"; import {Product} from "../contracts/Product.sol"; +import {ProductFactoryV2} from "./mock/ProductFactoryV2.sol"; import "forge-std/Test.sol"; contract ProductFactoryTest is Test { ProductFactory public factory; - Product public productImplementation; + Product public productImpl; address public owner; address public vendor; address public user; @@ -22,8 +24,29 @@ contract ProductFactoryTest is Test { (user, userPK) = makeAddrAndKey("user"); (device, devicePK) = makeAddrAndKey("device"); - productImplementation = new Product(); - factory = new ProductFactory(owner); + productImpl = new Product(); + ProductFactory factoryImpl = new ProductFactory(); + ERC1967Proxy factoryProxy = new ERC1967Proxy( + address(factoryImpl), + abi.encodeWithSelector(ProductFactory.initialize.selector, owner) + ); + factory = ProductFactory(address(factoryProxy)); + } + + function testUpgrade() public { + address newOwner = makeAddr("newOwner"); + ProductFactoryV2 factoryImplV2 = new ProductFactoryV2(); + vm.prank(owner); + factory.upgradeToAndCall( + address(factoryImplV2), + abi.encodeWithSelector( + ProductFactoryV2.initialize.selector, + newOwner + ) + ); + assertEq(factory.owner(), newOwner); + (, , string memory version, , , , ) = factory.eip712Domain(); + assertEq(version, "2"); } function testCreateProduct() public { @@ -31,7 +54,7 @@ contract ProductFactoryTest is Test { IProductFactory.CreateProductArgs memory args = IProductFactory .CreateProductArgs({ - productImpl: address(productImplementation), + productImpl: address(productImpl), name: "Test Product", symbol: "TP", baseTokenURI: "https://example.com/token/" @@ -47,7 +70,7 @@ contract ProductFactoryTest is Test { IProductFactory.CreateProductArgs memory args = IProductFactory .CreateProductArgs({ - productImpl: address(productImplementation), + productImpl: address(productImpl), name: "Test Product", symbol: "TP", baseTokenURI: "https://example.com/token/" @@ -82,7 +105,7 @@ contract ProductFactoryTest is Test { IProductFactory.CreateProductArgs memory args = IProductFactory .CreateProductArgs({ - productImpl: address(productImplementation), + productImpl: address(productImpl), name: "Test Product", symbol: "TP", baseTokenURI: "https://example.com/token/" @@ -124,7 +147,7 @@ contract ProductFactoryTest is Test { IProductFactory.CreateProductArgs memory args = IProductFactory .CreateProductArgs({ - productImpl: address(productImplementation), + productImpl: address(productImpl), name: "Test Product", symbol: "TP", baseTokenURI: "https://example.com/token/" diff --git a/test/mock/ProductFactoryV2.sol b/test/mock/ProductFactoryV2.sol new file mode 100644 index 0000000..7a417f9 --- /dev/null +++ b/test/mock/ProductFactoryV2.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.24; + +import {ProductFactory} from "../../contracts/ProductFactory.sol"; + +contract ProductFactoryV2 is ProductFactory { + function initialize(address initialOwner) public override reinitializer(2) { + __Ownable_init(initialOwner); + __EIP712_init("ProductFactory", "2"); + __ReentrancyGuard_init(); + __Pausable_init(); + __UUPSUpgradeable_init(); + } +} \ No newline at end of file From 5567491f284ae1fb7dbc22a2f23907a49110760c Mon Sep 17 00:00:00 2001 From: CanvasL <746591811@qq.com> Date: Wed, 24 Jul 2024 12:14:52 +0800 Subject: [PATCH 2/4] feat: redeploy, update e2e test, tool --- addresses.json | 2 +- e2e/testAll.ts | 29 +- templates/README.md | 2 +- tool/dist/ProductFactory.js | 2 +- tool/dist/generated/IProductFactory.d.ts | 304 ++++++ .../IProductFactory.js} | 0 .../ProductFactory.d.ts | 218 +++- .../common.js => generated/ProductFactory.js} | 0 .../dist/{typechain => generated}/common.d.ts | 0 tool/dist/generated/common.js | 1 + .../factories/IProductFactory__factory.d.ts | 313 ++++++ .../factories/IProductFactory__factory.js | 411 ++++++++ .../factories/ProductFactory__factory.d.ts | 615 ++++++++++++ .../factories/ProductFactory__factory.js | 810 +++++++++++++++ tool/dist/generated/factories/index.d.ts | 2 + .../factories/index.js | 1 + tool/dist/{typechain => generated}/index.d.ts | 2 + tool/dist/{typechain => generated}/index.js | 1 + .../factories/ProductFactory__factory.d.ts | 424 -------- .../factories/ProductFactory__factory.js | 562 ----------- tool/dist/typechain/factories/index.d.ts | 1 - tool/package.json | 2 +- tool/src/ProductFactory.ts | 16 +- tool/src/abi/ProductFactory.json | 1 - .../IProductFactory.ts} | 354 +++---- tool/src/generated/ProductFactory.ts | 946 ++++++++++++++++++ tool/src/{typechain => generated}/common.ts | 0 .../factories/IProductFactory__factory.ts | 421 ++++++++ .../factories/ProductFactory__factory.ts | 833 +++++++++++++++ .../factories/index.ts | 1 + tool/src/{typechain => generated}/index.ts | 2 + .../factories/ProductFactory__factory.ts | 590 ----------- 32 files changed, 5012 insertions(+), 1854 deletions(-) create mode 100644 tool/dist/generated/IProductFactory.d.ts rename tool/dist/{typechain/ProductFactory.js => generated/IProductFactory.js} (100%) rename tool/dist/{typechain => generated}/ProductFactory.d.ts (55%) rename tool/dist/{typechain/common.js => generated/ProductFactory.js} (100%) rename tool/dist/{typechain => generated}/common.d.ts (100%) create mode 100644 tool/dist/generated/common.js create mode 100644 tool/dist/generated/factories/IProductFactory__factory.d.ts create mode 100644 tool/dist/generated/factories/IProductFactory__factory.js create mode 100644 tool/dist/generated/factories/ProductFactory__factory.d.ts create mode 100644 tool/dist/generated/factories/ProductFactory__factory.js create mode 100644 tool/dist/generated/factories/index.d.ts rename tool/dist/{typechain => generated}/factories/index.js (69%) rename tool/dist/{typechain => generated}/index.d.ts (56%) rename tool/dist/{typechain => generated}/index.js (59%) delete mode 100644 tool/dist/typechain/factories/ProductFactory__factory.d.ts delete mode 100644 tool/dist/typechain/factories/ProductFactory__factory.js delete mode 100644 tool/dist/typechain/factories/index.d.ts delete mode 100644 tool/src/abi/ProductFactory.json rename tool/src/{typechain/ProductFactory.ts => generated/IProductFactory.ts} (63%) create mode 100644 tool/src/generated/ProductFactory.ts rename tool/src/{typechain => generated}/common.ts (100%) create mode 100644 tool/src/generated/factories/IProductFactory__factory.ts create mode 100644 tool/src/generated/factories/ProductFactory__factory.ts rename tool/src/{typechain => generated}/factories/index.ts (69%) rename tool/src/{typechain => generated}/index.ts (65%) delete mode 100644 tool/src/typechain/factories/ProductFactory__factory.ts diff --git a/addresses.json b/addresses.json index ea383c0..e14c953 100644 --- a/addresses.json +++ b/addresses.json @@ -1,6 +1,6 @@ { "BaseSepolia": { - "ProductFactory": "0x51FF9b79616973da54b68771099C7942519bC0BC", + "ProductFactory": "0xC487C07f0e31d63a840157cBcC316FBcBbFc6088", "ProductImpl": "0x647d77324E241709BaF63D7f96F0C19ecA06E2e0" } } diff --git a/e2e/testAll.ts b/e2e/testAll.ts index 20b6387..572d1e8 100644 --- a/e2e/testAll.ts +++ b/e2e/testAll.ts @@ -3,12 +3,14 @@ import { createTestClient, getContract, Hash, http, publicActions, walletActions, toBytes, encodePacked, keccak256, serializeSignature, parseSignature, Address, + encodeFunctionData, } from 'viem'; import { foundry } from 'viem/chains'; import { generatePrivateKey, privateKeyToAccount, sign } from 'viem/accounts'; import Product from '../out/Product.sol/Product.json'; import ProductFactory from '../out/ProductFactory.sol/ProductFactory.json'; +import ERC1967Proxy from '../out/ERC1967Proxy.sol/ERC1967Proxy.json'; let anvil: ChildProcess | undefined; @@ -39,18 +41,33 @@ try { const productImplAddress = productTx.contractAddress; console.log('ProductImpl:', productImplAddress); - const productFactoryTx = await getReceipt(client.deployContract({ + const productFactoryImplTx = await getReceipt(client.deployContract({ account: admin.address, abi: ProductFactory.abi, chain: foundry, bytecode: ProductFactory.bytecode.object as `0x${string}`, - args: [admin.address], + args: [], })); - const productFactoryAddress = productFactoryTx.contractAddress; - console.log('ProductFactory:', productFactoryAddress); + const productFactoryImplAddress = productFactoryImplTx.contractAddress; + console.log('ProductFactoryImpl:', productFactoryImplAddress); + + const productFactoryProxyTx = await getReceipt(client.deployContract({ + account: admin.address, + abi: ERC1967Proxy.abi, + chain: foundry, + bytecode: ERC1967Proxy.bytecode.object as `0x${string}`, + args: [productFactoryImplAddress, encodeFunctionData({ + abi: ProductFactory.abi, + functionName: 'initialize', + args: [admin.address] + })], + })); + + const productFactoryProxyAddress = productFactoryProxyTx.contractAddress; + console.log('ProductFactoryProxy:', productFactoryProxyAddress); const productFactory = getContract({ - address: productFactoryAddress!, + address: productFactoryProxyAddress!, abi: ProductFactory.abi, client, }); @@ -138,7 +155,7 @@ try { name: 'ProductFactory', version: '1', chainId: client.chain.id, - verifyingContract: productFactoryAddress!, + verifyingContract: productFactoryProxyAddress!, }, message: { product: productAddress, diff --git a/templates/README.md b/templates/README.md index dc3a2c5..93fa2d1 100644 --- a/templates/README.md +++ b/templates/README.md @@ -24,7 +24,7 @@ pnpm run cli --help pnpm run cli deploy-vendor \ --rpc $BASE_SEPOLIA_RPC_URL \ --privatekey $PRIVATE_KEY \ ---productFactory 0x51FF9b79616973da54b68771099C7942519bC0BC +--productFactory 0xC487C07f0e31d63a840157cBcC316FBcBbFc6088 ``` Deployed Vendor address will store in `templates/tmp/address.json`. diff --git a/tool/dist/ProductFactory.js b/tool/dist/ProductFactory.js index f72bef8..210adb0 100644 --- a/tool/dist/ProductFactory.js +++ b/tool/dist/ProductFactory.js @@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -import { ProductFactory__factory, } from "./typechain"; +import { ProductFactory__factory, } from "./generated"; import { ethers } from "ethers"; import { oneDayLater, oneHourLater } from "./utils/timestamp"; export class ProductFactory { diff --git a/tool/dist/generated/IProductFactory.d.ts b/tool/dist/generated/IProductFactory.d.ts new file mode 100644 index 0000000..d466674 --- /dev/null +++ b/tool/dist/generated/IProductFactory.d.ts @@ -0,0 +1,304 @@ +import type { BaseContract, BigNumber, BigNumberish, BytesLike, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction, Signer, utils } from "ethers"; +import type { FunctionFragment, Result, EventFragment } from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common"; +export declare namespace IProductFactory { + type ActivateDeviceArgsStruct = { + product: string; + device: string; + deviceSignature: BytesLike; + deviceDeadline: BigNumberish; + }; + type ActivateDeviceArgsStructOutput = [ + string, + string, + string, + BigNumber + ] & { + product: string; + device: string; + deviceSignature: string; + deviceDeadline: BigNumber; + }; + type EIP712SignatureStruct = { + signer: string; + v: BigNumberish; + r: BytesLike; + s: BytesLike; + deadline: BigNumberish; + }; + type EIP712SignatureStructOutput = [ + string, + number, + string, + string, + BigNumber + ] & { + signer: string; + v: number; + r: string; + s: string; + deadline: BigNumber; + }; + type CreateActivatedDeviceArgsStruct = { + product: string; + device: string; + receiver: string; + }; + type CreateActivatedDeviceArgsStructOutput = [ + string, + string, + string + ] & { + product: string; + device: string; + receiver: string; + }; + type CreateActivatedDevicesArgsStruct = { + product: string; + devices: string[]; + receivers: string[]; + }; + type CreateActivatedDevicesArgsStructOutput = [ + string, + string[], + string[] + ] & { + product: string; + devices: string[]; + receivers: string[]; + }; + type CreateDeviceArgsStruct = { + product: string; + device: string; + }; + type CreateDeviceArgsStructOutput = [string, string] & { + product: string; + device: string; + }; + type CreateDevicesArgsStruct = { + product: string; + devices: string[]; + }; + type CreateDevicesArgsStructOutput = [string, string[]] & { + product: string; + devices: string[]; + }; + type CreateProductArgsStruct = { + productImpl: string; + name: string; + symbol: string; + baseTokenURI: string; + }; + type CreateProductArgsStructOutput = [ + string, + string, + string, + string + ] & { + productImpl: string; + name: string; + symbol: string; + baseTokenURI: string; + }; +} +export interface IProductFactoryInterface extends utils.Interface { + functions: { + "activateDevice((address,address,bytes,uint256),(address,uint8,bytes32,bytes32,uint256))": FunctionFragment; + "createActivatedDevice((address,address,address))": FunctionFragment; + "createActivatedDevices((address,address[],address[]))": FunctionFragment; + "createDevice((address,address))": FunctionFragment; + "createDevices((address,address[]))": FunctionFragment; + "createProduct((address,string,string,string))": FunctionFragment; + "getDeviceTokenId(address,address)": FunctionFragment; + "getDomainSeparator()": FunctionFragment; + "getVendorByProduct(address)": FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: "activateDevice" | "createActivatedDevice" | "createActivatedDevices" | "createDevice" | "createDevices" | "createProduct" | "getDeviceTokenId" | "getDomainSeparator" | "getVendorByProduct"): FunctionFragment; + encodeFunctionData(functionFragment: "activateDevice", values: [ + IProductFactory.ActivateDeviceArgsStruct, + IProductFactory.EIP712SignatureStruct + ]): string; + encodeFunctionData(functionFragment: "createActivatedDevice", values: [IProductFactory.CreateActivatedDeviceArgsStruct]): string; + encodeFunctionData(functionFragment: "createActivatedDevices", values: [IProductFactory.CreateActivatedDevicesArgsStruct]): string; + encodeFunctionData(functionFragment: "createDevice", values: [IProductFactory.CreateDeviceArgsStruct]): string; + encodeFunctionData(functionFragment: "createDevices", values: [IProductFactory.CreateDevicesArgsStruct]): string; + encodeFunctionData(functionFragment: "createProduct", values: [IProductFactory.CreateProductArgsStruct]): string; + encodeFunctionData(functionFragment: "getDeviceTokenId", values: [string, string]): string; + encodeFunctionData(functionFragment: "getDomainSeparator", values?: undefined): string; + encodeFunctionData(functionFragment: "getVendorByProduct", values: [string]): string; + decodeFunctionResult(functionFragment: "activateDevice", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "createActivatedDevice", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "createActivatedDevices", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "createDevice", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "createDevices", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "createProduct", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "getDeviceTokenId", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "getDomainSeparator", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "getVendorByProduct", data: BytesLike): Result; + events: { + "DeviceActivated(address,address,address)": EventFragment; + "DeviceCreated(address,address,uint256)": EventFragment; + "ProductCreated(address,address,address)": EventFragment; + }; + getEvent(nameOrSignatureOrTopic: "DeviceActivated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "DeviceCreated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ProductCreated"): EventFragment; +} +export interface DeviceActivatedEventObject { + product: string; + device: string; + receiver: string; +} +export type DeviceActivatedEvent = TypedEvent<[ + string, + string, + string +], DeviceActivatedEventObject>; +export type DeviceActivatedEventFilter = TypedEventFilter; +export interface DeviceCreatedEventObject { + product: string; + device: string; + tokenId: BigNumber; +} +export type DeviceCreatedEvent = TypedEvent<[ + string, + string, + BigNumber +], DeviceCreatedEventObject>; +export type DeviceCreatedEventFilter = TypedEventFilter; +export interface ProductCreatedEventObject { + vendor: string; + productImpl: string; + product: string; +} +export type ProductCreatedEvent = TypedEvent<[ + string, + string, + string +], ProductCreatedEventObject>; +export type ProductCreatedEventFilter = TypedEventFilter; +export interface IProductFactory extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: IProductFactoryInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + activateDevice(args: IProductFactory.ActivateDeviceArgsStruct, signature: IProductFactory.EIP712SignatureStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createActivatedDevice(args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createActivatedDevices(args: IProductFactory.CreateActivatedDevicesArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createDevice(args: IProductFactory.CreateDeviceArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createDevices(args: IProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createProduct(args: IProductFactory.CreateProductArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + getDeviceTokenId(product: string, device: string, overrides?: CallOverrides): Promise<[BigNumber]>; + getDomainSeparator(overrides?: CallOverrides): Promise<[string]>; + getVendorByProduct(product: string, overrides?: CallOverrides): Promise<[string]>; + }; + activateDevice(args: IProductFactory.ActivateDeviceArgsStruct, signature: IProductFactory.EIP712SignatureStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createActivatedDevice(args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createActivatedDevices(args: IProductFactory.CreateActivatedDevicesArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createDevice(args: IProductFactory.CreateDeviceArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createDevices(args: IProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createProduct(args: IProductFactory.CreateProductArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + getDeviceTokenId(product: string, device: string, overrides?: CallOverrides): Promise; + getDomainSeparator(overrides?: CallOverrides): Promise; + getVendorByProduct(product: string, overrides?: CallOverrides): Promise; + callStatic: { + activateDevice(args: IProductFactory.ActivateDeviceArgsStruct, signature: IProductFactory.EIP712SignatureStruct, overrides?: CallOverrides): Promise; + createActivatedDevice(args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: CallOverrides): Promise; + createActivatedDevices(args: IProductFactory.CreateActivatedDevicesArgsStruct, overrides?: CallOverrides): Promise; + createDevice(args: IProductFactory.CreateDeviceArgsStruct, overrides?: CallOverrides): Promise; + createDevices(args: IProductFactory.CreateDevicesArgsStruct, overrides?: CallOverrides): Promise; + createProduct(args: IProductFactory.CreateProductArgsStruct, overrides?: CallOverrides): Promise; + getDeviceTokenId(product: string, device: string, overrides?: CallOverrides): Promise; + getDomainSeparator(overrides?: CallOverrides): Promise; + getVendorByProduct(product: string, overrides?: CallOverrides): Promise; + }; + filters: { + "DeviceActivated(address,address,address)"(product?: string | null, device?: string | null, receiver?: null): DeviceActivatedEventFilter; + DeviceActivated(product?: string | null, device?: string | null, receiver?: null): DeviceActivatedEventFilter; + "DeviceCreated(address,address,uint256)"(product?: string | null, device?: string | null, tokenId?: BigNumberish | null): DeviceCreatedEventFilter; + DeviceCreated(product?: string | null, device?: string | null, tokenId?: BigNumberish | null): DeviceCreatedEventFilter; + "ProductCreated(address,address,address)"(vendor?: string | null, productImpl?: string | null, product?: string | null): ProductCreatedEventFilter; + ProductCreated(vendor?: string | null, productImpl?: string | null, product?: string | null): ProductCreatedEventFilter; + }; + estimateGas: { + activateDevice(args: IProductFactory.ActivateDeviceArgsStruct, signature: IProductFactory.EIP712SignatureStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createActivatedDevice(args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createActivatedDevices(args: IProductFactory.CreateActivatedDevicesArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createDevice(args: IProductFactory.CreateDeviceArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createDevices(args: IProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createProduct(args: IProductFactory.CreateProductArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + getDeviceTokenId(product: string, device: string, overrides?: CallOverrides): Promise; + getDomainSeparator(overrides?: CallOverrides): Promise; + getVendorByProduct(product: string, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + activateDevice(args: IProductFactory.ActivateDeviceArgsStruct, signature: IProductFactory.EIP712SignatureStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createActivatedDevice(args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createActivatedDevices(args: IProductFactory.CreateActivatedDevicesArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createDevice(args: IProductFactory.CreateDeviceArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createDevices(args: IProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createProduct(args: IProductFactory.CreateProductArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + getDeviceTokenId(product: string, device: string, overrides?: CallOverrides): Promise; + getDomainSeparator(overrides?: CallOverrides): Promise; + getVendorByProduct(product: string, overrides?: CallOverrides): Promise; + }; +} diff --git a/tool/dist/typechain/ProductFactory.js b/tool/dist/generated/IProductFactory.js similarity index 100% rename from tool/dist/typechain/ProductFactory.js rename to tool/dist/generated/IProductFactory.js diff --git a/tool/dist/typechain/ProductFactory.d.ts b/tool/dist/generated/ProductFactory.d.ts similarity index 55% rename from tool/dist/typechain/ProductFactory.d.ts rename to tool/dist/generated/ProductFactory.d.ts index d0e6e0d..497855c 100644 --- a/tool/dist/typechain/ProductFactory.d.ts +++ b/tool/dist/generated/ProductFactory.d.ts @@ -1,8 +1,8 @@ -import type { BaseContract, BigNumber, BigNumberish, BytesLike, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction, Signer, utils } from "ethers"; +import type { BaseContract, BigNumber, BigNumberish, BytesLike, CallOverrides, ContractTransaction, Overrides, PayableOverrides, PopulatedTransaction, Signer, utils } from "ethers"; import type { FunctionFragment, Result, EventFragment } from "@ethersproject/abi"; import type { Listener, Provider } from "@ethersproject/providers"; import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common"; -export declare namespace ProductFactory { +export declare namespace IProductFactory { type ActivateDeviceArgsStruct = { product: string; device: string; @@ -40,6 +40,20 @@ export declare namespace ProductFactory { s: string; deadline: BigNumber; }; + type CreateActivatedDeviceArgsStruct = { + product: string; + device: string; + receiver: string; + }; + type CreateActivatedDeviceArgsStructOutput = [ + string, + string, + string + ] & { + product: string; + device: string; + receiver: string; + }; type CreateActivatedDevicesArgsStruct = { product: string; devices: string[]; @@ -54,6 +68,14 @@ export declare namespace ProductFactory { devices: string[]; receivers: string[]; }; + type CreateDeviceArgsStruct = { + product: string; + device: string; + }; + type CreateDeviceArgsStructOutput = [string, string] & { + product: string; + device: string; + }; type CreateDevicesArgsStruct = { product: string; devices: string[]; @@ -83,64 +105,98 @@ export declare namespace ProductFactory { export interface ProductFactoryInterface extends utils.Interface { functions: { "ACTIVATE_DEVICE_TYPEHASH()": FunctionFragment; + "DEPHY_PREFIX()": FunctionFragment; + "UPGRADE_INTERFACE_VERSION()": FunctionFragment; "activateDevice((address,address,bytes,uint256),(address,uint8,bytes32,bytes32,uint256))": FunctionFragment; + "createActivatedDevice((address,address,address))": FunctionFragment; "createActivatedDevices((address,address[],address[]))": FunctionFragment; + "createDevice((address,address))": FunctionFragment; "createDevices((address,address[]))": FunctionFragment; "createProduct((address,string,string,string))": FunctionFragment; "eip712Domain()": FunctionFragment; "getDeviceTokenId(address,address)": FunctionFragment; "getDomainSeparator()": FunctionFragment; "getVendorByProduct(address)": FunctionFragment; + "initialize(address)": FunctionFragment; "owner()": FunctionFragment; + "paused()": FunctionFragment; + "proxiableUUID()": FunctionFragment; "renounceOwnership()": FunctionFragment; "transferOwnership(address)": FunctionFragment; + "upgradeToAndCall(address,bytes)": FunctionFragment; }; - getFunction(nameOrSignatureOrTopic: "ACTIVATE_DEVICE_TYPEHASH" | "activateDevice" | "createActivatedDevices" | "createDevices" | "createProduct" | "eip712Domain" | "getDeviceTokenId" | "getDomainSeparator" | "getVendorByProduct" | "owner" | "renounceOwnership" | "transferOwnership"): FunctionFragment; + getFunction(nameOrSignatureOrTopic: "ACTIVATE_DEVICE_TYPEHASH" | "DEPHY_PREFIX" | "UPGRADE_INTERFACE_VERSION" | "activateDevice" | "createActivatedDevice" | "createActivatedDevices" | "createDevice" | "createDevices" | "createProduct" | "eip712Domain" | "getDeviceTokenId" | "getDomainSeparator" | "getVendorByProduct" | "initialize" | "owner" | "paused" | "proxiableUUID" | "renounceOwnership" | "transferOwnership" | "upgradeToAndCall"): FunctionFragment; encodeFunctionData(functionFragment: "ACTIVATE_DEVICE_TYPEHASH", values?: undefined): string; + encodeFunctionData(functionFragment: "DEPHY_PREFIX", values?: undefined): string; + encodeFunctionData(functionFragment: "UPGRADE_INTERFACE_VERSION", values?: undefined): string; encodeFunctionData(functionFragment: "activateDevice", values: [ - ProductFactory.ActivateDeviceArgsStruct, - ProductFactory.EIP712SignatureStruct + IProductFactory.ActivateDeviceArgsStruct, + IProductFactory.EIP712SignatureStruct ]): string; - encodeFunctionData(functionFragment: "createActivatedDevices", values: [ProductFactory.CreateActivatedDevicesArgsStruct]): string; - encodeFunctionData(functionFragment: "createDevices", values: [ProductFactory.CreateDevicesArgsStruct]): string; - encodeFunctionData(functionFragment: "createProduct", values: [ProductFactory.CreateProductArgsStruct]): string; + encodeFunctionData(functionFragment: "createActivatedDevice", values: [IProductFactory.CreateActivatedDeviceArgsStruct]): string; + encodeFunctionData(functionFragment: "createActivatedDevices", values: [IProductFactory.CreateActivatedDevicesArgsStruct]): string; + encodeFunctionData(functionFragment: "createDevice", values: [IProductFactory.CreateDeviceArgsStruct]): string; + encodeFunctionData(functionFragment: "createDevices", values: [IProductFactory.CreateDevicesArgsStruct]): string; + encodeFunctionData(functionFragment: "createProduct", values: [IProductFactory.CreateProductArgsStruct]): string; encodeFunctionData(functionFragment: "eip712Domain", values?: undefined): string; encodeFunctionData(functionFragment: "getDeviceTokenId", values: [string, string]): string; encodeFunctionData(functionFragment: "getDomainSeparator", values?: undefined): string; encodeFunctionData(functionFragment: "getVendorByProduct", values: [string]): string; + encodeFunctionData(functionFragment: "initialize", values: [string]): string; encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData(functionFragment: "paused", values?: undefined): string; + encodeFunctionData(functionFragment: "proxiableUUID", values?: undefined): string; encodeFunctionData(functionFragment: "renounceOwnership", values?: undefined): string; encodeFunctionData(functionFragment: "transferOwnership", values: [string]): string; + encodeFunctionData(functionFragment: "upgradeToAndCall", values: [string, BytesLike]): string; decodeFunctionResult(functionFragment: "ACTIVATE_DEVICE_TYPEHASH", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "DEPHY_PREFIX", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "UPGRADE_INTERFACE_VERSION", data: BytesLike): Result; decodeFunctionResult(functionFragment: "activateDevice", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "createActivatedDevice", data: BytesLike): Result; decodeFunctionResult(functionFragment: "createActivatedDevices", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "createDevice", data: BytesLike): Result; decodeFunctionResult(functionFragment: "createDevices", data: BytesLike): Result; decodeFunctionResult(functionFragment: "createProduct", data: BytesLike): Result; decodeFunctionResult(functionFragment: "eip712Domain", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getDeviceTokenId", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getDomainSeparator", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getVendorByProduct", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "paused", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "proxiableUUID", data: BytesLike): Result; decodeFunctionResult(functionFragment: "renounceOwnership", data: BytesLike): Result; decodeFunctionResult(functionFragment: "transferOwnership", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "upgradeToAndCall", data: BytesLike): Result; events: { - "DeviceActivated(address,address)": EventFragment; + "DeviceActivated(address,address,address)": EventFragment; "DeviceCreated(address,address,uint256)": EventFragment; "EIP712DomainChanged()": EventFragment; + "Initialized(uint64)": EventFragment; "OwnershipTransferred(address,address)": EventFragment; + "Paused(address)": EventFragment; "ProductCreated(address,address,address)": EventFragment; + "Unpaused(address)": EventFragment; + "Upgraded(address)": EventFragment; }; getEvent(nameOrSignatureOrTopic: "DeviceActivated"): EventFragment; getEvent(nameOrSignatureOrTopic: "DeviceCreated"): EventFragment; getEvent(nameOrSignatureOrTopic: "EIP712DomainChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment; getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Paused"): EventFragment; getEvent(nameOrSignatureOrTopic: "ProductCreated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Unpaused"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; } export interface DeviceActivatedEventObject { product: string; device: string; + receiver: string; } export type DeviceActivatedEvent = TypedEvent<[ + string, string, string ], DeviceActivatedEventObject>; @@ -161,6 +217,11 @@ export interface EIP712DomainChangedEventObject { export type EIP712DomainChangedEvent = TypedEvent<[ ], EIP712DomainChangedEventObject>; export type EIP712DomainChangedEventFilter = TypedEventFilter; +export interface InitializedEventObject { + version: BigNumber; +} +export type InitializedEvent = TypedEvent<[BigNumber], InitializedEventObject>; +export type InitializedEventFilter = TypedEventFilter; export interface OwnershipTransferredEventObject { previousOwner: string; newOwner: string; @@ -170,6 +231,11 @@ export type OwnershipTransferredEvent = TypedEvent<[ string ], OwnershipTransferredEventObject>; export type OwnershipTransferredEventFilter = TypedEventFilter; +export interface PausedEventObject { + account: string; +} +export type PausedEvent = TypedEvent<[string], PausedEventObject>; +export type PausedEventFilter = TypedEventFilter; export interface ProductCreatedEventObject { vendor: string; productImpl: string; @@ -181,6 +247,16 @@ export type ProductCreatedEvent = TypedEvent<[ string ], ProductCreatedEventObject>; export type ProductCreatedEventFilter = TypedEventFilter; +export interface UnpausedEventObject { + account: string; +} +export type UnpausedEvent = TypedEvent<[string], UnpausedEventObject>; +export type UnpausedEventFilter = TypedEventFilter; +export interface UpgradedEventObject { + implementation: string; +} +export type UpgradedEvent = TypedEvent<[string], UpgradedEventObject>; +export type UpgradedEventFilter = TypedEventFilter; export interface ProductFactory extends BaseContract { connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; @@ -197,16 +273,24 @@ export interface ProductFactory extends BaseContract { removeListener: OnEvent; functions: { ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; - activateDevice(args: ProductFactory.ActivateDeviceArgsStruct, signature: ProductFactory.EIP712SignatureStruct, overrides?: Overrides & { + DEPHY_PREFIX(overrides?: CallOverrides): Promise<[string]>; + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise<[string]>; + activateDevice(args: IProductFactory.ActivateDeviceArgsStruct, signature: IProductFactory.EIP712SignatureStruct, overrides?: Overrides & { from?: string; }): Promise; - createActivatedDevices(args: ProductFactory.CreateActivatedDevicesArgsStruct, overrides?: Overrides & { + createActivatedDevice(args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: Overrides & { from?: string; }): Promise; - createDevices(args: ProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { + createActivatedDevices(args: IProductFactory.CreateActivatedDevicesArgsStruct, overrides?: Overrides & { from?: string; }): Promise; - createProduct(args: ProductFactory.CreateProductArgsStruct, overrides?: Overrides & { + createDevice(args: IProductFactory.CreateDeviceArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createDevices(args: IProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createProduct(args: IProductFactory.CreateProductArgsStruct, overrides?: Overrides & { from?: string; }): Promise; eip712Domain(overrides?: CallOverrides): Promise<[ @@ -229,25 +313,41 @@ export interface ProductFactory extends BaseContract { getDeviceTokenId(product: string, device: string, overrides?: CallOverrides): Promise<[BigNumber]>; getDomainSeparator(overrides?: CallOverrides): Promise<[string]>; getVendorByProduct(product: string, overrides?: CallOverrides): Promise<[string]>; + initialize(initialOwner: string, overrides?: Overrides & { + from?: string; + }): Promise; owner(overrides?: CallOverrides): Promise<[string]>; + paused(overrides?: CallOverrides): Promise<[boolean]>; + proxiableUUID(overrides?: CallOverrides): Promise<[string]>; renounceOwnership(overrides?: Overrides & { from?: string; }): Promise; transferOwnership(newOwner: string, overrides?: Overrides & { from?: string; }): Promise; + upgradeToAndCall(newImplementation: string, data: BytesLike, overrides?: PayableOverrides & { + from?: string; + }): Promise; }; ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise; - activateDevice(args: ProductFactory.ActivateDeviceArgsStruct, signature: ProductFactory.EIP712SignatureStruct, overrides?: Overrides & { + DEPHY_PREFIX(overrides?: CallOverrides): Promise; + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + activateDevice(args: IProductFactory.ActivateDeviceArgsStruct, signature: IProductFactory.EIP712SignatureStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createActivatedDevice(args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: Overrides & { from?: string; }): Promise; - createActivatedDevices(args: ProductFactory.CreateActivatedDevicesArgsStruct, overrides?: Overrides & { + createActivatedDevices(args: IProductFactory.CreateActivatedDevicesArgsStruct, overrides?: Overrides & { from?: string; }): Promise; - createDevices(args: ProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { + createDevice(args: IProductFactory.CreateDeviceArgsStruct, overrides?: Overrides & { from?: string; }): Promise; - createProduct(args: ProductFactory.CreateProductArgsStruct, overrides?: Overrides & { + createDevices(args: IProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createProduct(args: IProductFactory.CreateProductArgsStruct, overrides?: Overrides & { from?: string; }): Promise; eip712Domain(overrides?: CallOverrides): Promise<[ @@ -270,19 +370,31 @@ export interface ProductFactory extends BaseContract { getDeviceTokenId(product: string, device: string, overrides?: CallOverrides): Promise; getDomainSeparator(overrides?: CallOverrides): Promise; getVendorByProduct(product: string, overrides?: CallOverrides): Promise; + initialize(initialOwner: string, overrides?: Overrides & { + from?: string; + }): Promise; owner(overrides?: CallOverrides): Promise; + paused(overrides?: CallOverrides): Promise; + proxiableUUID(overrides?: CallOverrides): Promise; renounceOwnership(overrides?: Overrides & { from?: string; }): Promise; transferOwnership(newOwner: string, overrides?: Overrides & { from?: string; }): Promise; + upgradeToAndCall(newImplementation: string, data: BytesLike, overrides?: PayableOverrides & { + from?: string; + }): Promise; callStatic: { ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise; - activateDevice(args: ProductFactory.ActivateDeviceArgsStruct, signature: ProductFactory.EIP712SignatureStruct, overrides?: CallOverrides): Promise; - createActivatedDevices(args: ProductFactory.CreateActivatedDevicesArgsStruct, overrides?: CallOverrides): Promise; - createDevices(args: ProductFactory.CreateDevicesArgsStruct, overrides?: CallOverrides): Promise; - createProduct(args: ProductFactory.CreateProductArgsStruct, overrides?: CallOverrides): Promise; + DEPHY_PREFIX(overrides?: CallOverrides): Promise; + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + activateDevice(args: IProductFactory.ActivateDeviceArgsStruct, signature: IProductFactory.EIP712SignatureStruct, overrides?: CallOverrides): Promise; + createActivatedDevice(args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: CallOverrides): Promise; + createActivatedDevices(args: IProductFactory.CreateActivatedDevicesArgsStruct, overrides?: CallOverrides): Promise; + createDevice(args: IProductFactory.CreateDeviceArgsStruct, overrides?: CallOverrides): Promise; + createDevices(args: IProductFactory.CreateDevicesArgsStruct, overrides?: CallOverrides): Promise; + createProduct(args: IProductFactory.CreateProductArgsStruct, overrides?: CallOverrides): Promise; eip712Domain(overrides?: CallOverrides): Promise<[ string, string, @@ -303,72 +415,116 @@ export interface ProductFactory extends BaseContract { getDeviceTokenId(product: string, device: string, overrides?: CallOverrides): Promise; getDomainSeparator(overrides?: CallOverrides): Promise; getVendorByProduct(product: string, overrides?: CallOverrides): Promise; + initialize(initialOwner: string, overrides?: CallOverrides): Promise; owner(overrides?: CallOverrides): Promise; + paused(overrides?: CallOverrides): Promise; + proxiableUUID(overrides?: CallOverrides): Promise; renounceOwnership(overrides?: CallOverrides): Promise; transferOwnership(newOwner: string, overrides?: CallOverrides): Promise; + upgradeToAndCall(newImplementation: string, data: BytesLike, overrides?: CallOverrides): Promise; }; filters: { - "DeviceActivated(address,address)"(product?: string | null, device?: string | null): DeviceActivatedEventFilter; - DeviceActivated(product?: string | null, device?: string | null): DeviceActivatedEventFilter; + "DeviceActivated(address,address,address)"(product?: string | null, device?: string | null, receiver?: null): DeviceActivatedEventFilter; + DeviceActivated(product?: string | null, device?: string | null, receiver?: null): DeviceActivatedEventFilter; "DeviceCreated(address,address,uint256)"(product?: string | null, device?: string | null, tokenId?: BigNumberish | null): DeviceCreatedEventFilter; DeviceCreated(product?: string | null, device?: string | null, tokenId?: BigNumberish | null): DeviceCreatedEventFilter; "EIP712DomainChanged()"(): EIP712DomainChangedEventFilter; EIP712DomainChanged(): EIP712DomainChangedEventFilter; + "Initialized(uint64)"(version?: null): InitializedEventFilter; + Initialized(version?: null): InitializedEventFilter; "OwnershipTransferred(address,address)"(previousOwner?: string | null, newOwner?: string | null): OwnershipTransferredEventFilter; OwnershipTransferred(previousOwner?: string | null, newOwner?: string | null): OwnershipTransferredEventFilter; + "Paused(address)"(account?: null): PausedEventFilter; + Paused(account?: null): PausedEventFilter; "ProductCreated(address,address,address)"(vendor?: string | null, productImpl?: string | null, product?: string | null): ProductCreatedEventFilter; ProductCreated(vendor?: string | null, productImpl?: string | null, product?: string | null): ProductCreatedEventFilter; + "Unpaused(address)"(account?: null): UnpausedEventFilter; + Unpaused(account?: null): UnpausedEventFilter; + "Upgraded(address)"(implementation?: string | null): UpgradedEventFilter; + Upgraded(implementation?: string | null): UpgradedEventFilter; }; estimateGas: { ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise; - activateDevice(args: ProductFactory.ActivateDeviceArgsStruct, signature: ProductFactory.EIP712SignatureStruct, overrides?: Overrides & { + DEPHY_PREFIX(overrides?: CallOverrides): Promise; + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + activateDevice(args: IProductFactory.ActivateDeviceArgsStruct, signature: IProductFactory.EIP712SignatureStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createActivatedDevice(args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createActivatedDevices(args: IProductFactory.CreateActivatedDevicesArgsStruct, overrides?: Overrides & { from?: string; }): Promise; - createActivatedDevices(args: ProductFactory.CreateActivatedDevicesArgsStruct, overrides?: Overrides & { + createDevice(args: IProductFactory.CreateDeviceArgsStruct, overrides?: Overrides & { from?: string; }): Promise; - createDevices(args: ProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { + createDevices(args: IProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { from?: string; }): Promise; - createProduct(args: ProductFactory.CreateProductArgsStruct, overrides?: Overrides & { + createProduct(args: IProductFactory.CreateProductArgsStruct, overrides?: Overrides & { from?: string; }): Promise; eip712Domain(overrides?: CallOverrides): Promise; getDeviceTokenId(product: string, device: string, overrides?: CallOverrides): Promise; getDomainSeparator(overrides?: CallOverrides): Promise; getVendorByProduct(product: string, overrides?: CallOverrides): Promise; + initialize(initialOwner: string, overrides?: Overrides & { + from?: string; + }): Promise; owner(overrides?: CallOverrides): Promise; + paused(overrides?: CallOverrides): Promise; + proxiableUUID(overrides?: CallOverrides): Promise; renounceOwnership(overrides?: Overrides & { from?: string; }): Promise; transferOwnership(newOwner: string, overrides?: Overrides & { from?: string; }): Promise; + upgradeToAndCall(newImplementation: string, data: BytesLike, overrides?: PayableOverrides & { + from?: string; + }): Promise; }; populateTransaction: { ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise; - activateDevice(args: ProductFactory.ActivateDeviceArgsStruct, signature: ProductFactory.EIP712SignatureStruct, overrides?: Overrides & { + DEPHY_PREFIX(overrides?: CallOverrides): Promise; + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + activateDevice(args: IProductFactory.ActivateDeviceArgsStruct, signature: IProductFactory.EIP712SignatureStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createActivatedDevice(args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: Overrides & { from?: string; }): Promise; - createActivatedDevices(args: ProductFactory.CreateActivatedDevicesArgsStruct, overrides?: Overrides & { + createActivatedDevices(args: IProductFactory.CreateActivatedDevicesArgsStruct, overrides?: Overrides & { from?: string; }): Promise; - createDevices(args: ProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { + createDevice(args: IProductFactory.CreateDeviceArgsStruct, overrides?: Overrides & { from?: string; }): Promise; - createProduct(args: ProductFactory.CreateProductArgsStruct, overrides?: Overrides & { + createDevices(args: IProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { + from?: string; + }): Promise; + createProduct(args: IProductFactory.CreateProductArgsStruct, overrides?: Overrides & { from?: string; }): Promise; eip712Domain(overrides?: CallOverrides): Promise; getDeviceTokenId(product: string, device: string, overrides?: CallOverrides): Promise; getDomainSeparator(overrides?: CallOverrides): Promise; getVendorByProduct(product: string, overrides?: CallOverrides): Promise; + initialize(initialOwner: string, overrides?: Overrides & { + from?: string; + }): Promise; owner(overrides?: CallOverrides): Promise; + paused(overrides?: CallOverrides): Promise; + proxiableUUID(overrides?: CallOverrides): Promise; renounceOwnership(overrides?: Overrides & { from?: string; }): Promise; transferOwnership(newOwner: string, overrides?: Overrides & { from?: string; }): Promise; + upgradeToAndCall(newImplementation: string, data: BytesLike, overrides?: PayableOverrides & { + from?: string; + }): Promise; }; } diff --git a/tool/dist/typechain/common.js b/tool/dist/generated/ProductFactory.js similarity index 100% rename from tool/dist/typechain/common.js rename to tool/dist/generated/ProductFactory.js diff --git a/tool/dist/typechain/common.d.ts b/tool/dist/generated/common.d.ts similarity index 100% rename from tool/dist/typechain/common.d.ts rename to tool/dist/generated/common.d.ts diff --git a/tool/dist/generated/common.js b/tool/dist/generated/common.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/tool/dist/generated/common.js @@ -0,0 +1 @@ +export {}; diff --git a/tool/dist/generated/factories/IProductFactory__factory.d.ts b/tool/dist/generated/factories/IProductFactory__factory.d.ts new file mode 100644 index 0000000..d10cce4 --- /dev/null +++ b/tool/dist/generated/factories/IProductFactory__factory.d.ts @@ -0,0 +1,313 @@ +import { Signer } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { IProductFactory, IProductFactoryInterface } from "../IProductFactory"; +export declare class IProductFactory__factory { + static readonly abi: readonly [{ + readonly type: "function"; + readonly name: "activateDevice"; + readonly inputs: readonly [{ + readonly name: "args"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.ActivateDeviceArgs"; + readonly components: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "device"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "deviceSignature"; + readonly type: "bytes"; + readonly internalType: "bytes"; + }, { + readonly name: "deviceDeadline"; + readonly type: "uint256"; + readonly internalType: "uint256"; + }]; + }, { + readonly name: "signature"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.EIP712Signature"; + readonly components: readonly [{ + readonly name: "signer"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "v"; + readonly type: "uint8"; + readonly internalType: "uint8"; + }, { + readonly name: "r"; + readonly type: "bytes32"; + readonly internalType: "bytes32"; + }, { + readonly name: "s"; + readonly type: "bytes32"; + readonly internalType: "bytes32"; + }, { + readonly name: "deadline"; + readonly type: "uint256"; + readonly internalType: "uint256"; + }]; + }]; + readonly outputs: readonly []; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "createActivatedDevice"; + readonly inputs: readonly [{ + readonly name: "args"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.CreateActivatedDeviceArgs"; + readonly components: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "device"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "receiver"; + readonly type: "address"; + readonly internalType: "address"; + }]; + }]; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "uint256"; + readonly internalType: "uint256"; + }]; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "createActivatedDevices"; + readonly inputs: readonly [{ + readonly name: "args"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.CreateActivatedDevicesArgs"; + readonly components: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "devices"; + readonly type: "address[]"; + readonly internalType: "address[]"; + }, { + readonly name: "receivers"; + readonly type: "address[]"; + readonly internalType: "address[]"; + }]; + }]; + readonly outputs: readonly []; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "createDevice"; + readonly inputs: readonly [{ + readonly name: "args"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.CreateDeviceArgs"; + readonly components: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "device"; + readonly type: "address"; + readonly internalType: "address"; + }]; + }]; + readonly outputs: readonly []; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "createDevices"; + readonly inputs: readonly [{ + readonly name: "args"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.CreateDevicesArgs"; + readonly components: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "devices"; + readonly type: "address[]"; + readonly internalType: "address[]"; + }]; + }]; + readonly outputs: readonly []; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "createProduct"; + readonly inputs: readonly [{ + readonly name: "args"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.CreateProductArgs"; + readonly components: readonly [{ + readonly name: "productImpl"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "name"; + readonly type: "string"; + readonly internalType: "string"; + }, { + readonly name: "symbol"; + readonly type: "string"; + readonly internalType: "string"; + }, { + readonly name: "baseTokenURI"; + readonly type: "string"; + readonly internalType: "string"; + }]; + }]; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "address"; + readonly internalType: "address"; + }]; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "getDeviceTokenId"; + readonly inputs: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "device"; + readonly type: "address"; + readonly internalType: "address"; + }]; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "uint256"; + readonly internalType: "uint256"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "function"; + readonly name: "getDomainSeparator"; + readonly inputs: readonly []; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "bytes32"; + readonly internalType: "bytes32"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "function"; + readonly name: "getVendorByProduct"; + readonly inputs: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }]; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "address"; + readonly internalType: "address"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "event"; + readonly name: "DeviceActivated"; + readonly inputs: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "device"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "receiver"; + readonly type: "address"; + readonly indexed: false; + readonly internalType: "address"; + }]; + readonly anonymous: false; + }, { + readonly type: "event"; + readonly name: "DeviceCreated"; + readonly inputs: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "device"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "tokenId"; + readonly type: "uint256"; + readonly indexed: true; + readonly internalType: "uint256"; + }]; + readonly anonymous: false; + }, { + readonly type: "event"; + readonly name: "ProductCreated"; + readonly inputs: readonly [{ + readonly name: "vendor"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "productImpl"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "product"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }]; + readonly anonymous: false; + }, { + readonly type: "error"; + readonly name: "DeviceAlreadyCreated"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "DeviceSignatureExpired"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "DeviceSignatureMismatch"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "EIP712SignatureExpired"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "EIP712SignatureMismatch"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "NotProductTemplate"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "NotVendor"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "TokenIdMismatch"; + readonly inputs: readonly []; + }]; + static createInterface(): IProductFactoryInterface; + static connect(address: string, signerOrProvider: Signer | Provider): IProductFactory; +} diff --git a/tool/dist/generated/factories/IProductFactory__factory.js b/tool/dist/generated/factories/IProductFactory__factory.js new file mode 100644 index 0000000..835e355 --- /dev/null +++ b/tool/dist/generated/factories/IProductFactory__factory.js @@ -0,0 +1,411 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { Contract, utils } from "ethers"; +const _abi = [ + { + type: "function", + name: "activateDevice", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.ActivateDeviceArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + { + name: "deviceSignature", + type: "bytes", + internalType: "bytes", + }, + { + name: "deviceDeadline", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "signature", + type: "tuple", + internalType: "struct IProductFactory.EIP712Signature", + components: [ + { + name: "signer", + type: "address", + internalType: "address", + }, + { + name: "v", + type: "uint8", + internalType: "uint8", + }, + { + name: "r", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "s", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "deadline", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createActivatedDevice", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateActivatedDeviceArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + { + name: "receiver", + type: "address", + internalType: "address", + }, + ], + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createActivatedDevices", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateActivatedDevicesArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "devices", + type: "address[]", + internalType: "address[]", + }, + { + name: "receivers", + type: "address[]", + internalType: "address[]", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createDevice", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateDeviceArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createDevices", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateDevicesArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "devices", + type: "address[]", + internalType: "address[]", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createProduct", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateProductArgs", + components: [ + { + name: "productImpl", + type: "address", + internalType: "address", + }, + { + name: "name", + type: "string", + internalType: "string", + }, + { + name: "symbol", + type: "string", + internalType: "string", + }, + { + name: "baseTokenURI", + type: "string", + internalType: "string", + }, + ], + }, + ], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "getDeviceTokenId", + inputs: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getDomainSeparator", + inputs: [], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getVendorByProduct", + inputs: [ + { + name: "product", + type: "address", + internalType: "address", + }, + ], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "event", + name: "DeviceActivated", + inputs: [ + { + name: "product", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "device", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "receiver", + type: "address", + indexed: false, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "DeviceCreated", + inputs: [ + { + name: "product", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "device", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "tokenId", + type: "uint256", + indexed: true, + internalType: "uint256", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ProductCreated", + inputs: [ + { + name: "vendor", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "productImpl", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "product", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "DeviceAlreadyCreated", + inputs: [], + }, + { + type: "error", + name: "DeviceSignatureExpired", + inputs: [], + }, + { + type: "error", + name: "DeviceSignatureMismatch", + inputs: [], + }, + { + type: "error", + name: "EIP712SignatureExpired", + inputs: [], + }, + { + type: "error", + name: "EIP712SignatureMismatch", + inputs: [], + }, + { + type: "error", + name: "NotProductTemplate", + inputs: [], + }, + { + type: "error", + name: "NotVendor", + inputs: [], + }, + { + type: "error", + name: "TokenIdMismatch", + inputs: [], + }, +]; +class IProductFactory__factory { + static createInterface() { + return new utils.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +} +IProductFactory__factory.abi = _abi; +export { IProductFactory__factory }; diff --git a/tool/dist/generated/factories/ProductFactory__factory.d.ts b/tool/dist/generated/factories/ProductFactory__factory.d.ts new file mode 100644 index 0000000..72e50df --- /dev/null +++ b/tool/dist/generated/factories/ProductFactory__factory.d.ts @@ -0,0 +1,615 @@ +import { Signer, ContractFactory, Overrides } from "ethers"; +import type { Provider, TransactionRequest } from "@ethersproject/providers"; +import type { ProductFactory, ProductFactoryInterface } from "../ProductFactory"; +type ProductFactoryConstructorParams = [signer?: Signer] | ConstructorParameters; +export declare class ProductFactory__factory extends ContractFactory { + constructor(...args: ProductFactoryConstructorParams); + deploy(overrides?: Overrides & { + from?: string; + }): Promise; + getDeployTransaction(overrides?: Overrides & { + from?: string; + }): TransactionRequest; + attach(address: string): ProductFactory; + connect(signer: Signer): ProductFactory__factory; + static readonly bytecode = "0x60a060405230608052348015601357600080fd5b506080516127b261003d600039600081816111520152818161117b01526112c101526127b26000f3fe60806040526004361061011e5760003560e01c806384b0196e116100a0578063bb189de111610064578063bb189de1146103ca578063c4d66de8146103ea578063ed24911d1461040a578063f2fde38b1461041f578063f9d8ee941461043f57600080fd5b806384b0196e146102e65780638da5cb5b1461030e578063904b55a51461034b578063ad3cb1cc14610384578063b063cb54146103b557600080fd5b806352d1902d116100e757806352d1902d14610206578063565501b4146102295780635c975abb146102495780635d25e6321461028b578063715018a6146102d157600080fd5b80622ca198146101235780631aaa192d146101605780633a7eece8146101b15780634be60db3146101d35780634f1ef286146101f3575b600080fd5b34801561012f57600080fd5b5061014361013e366004611eb4565b61045f565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561016c57600080fd5b506101a4604051806040016040528060188152602001772222a8242cafa4a22fa9a4a3a722a22fa6a2a9a9a0a3a29d60411b81525081565b6040516101579190611fda565b3480156101bd57600080fd5b506101d16101cc366004612076565b6105f8565b005b3480156101df57600080fd5b506101d16101ee3660046120f6565b610835565b6101d16102013660046121a1565b6108e3565b34801561021257600080fd5b5061021b610902565b604051908152602001610157565b34801561023557600080fd5b5061021b6102443660046121ee565b61091f565b34801561025557600080fd5b507fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff166040519015158152602001610157565b34801561029757600080fd5b5061021b6102a636600461223e565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156102dd57600080fd5b506101d161099e565b3480156102f257600080fd5b506102fb6109b2565b6040516101579796959493929190612271565b34801561031a57600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b0316610143565b34801561035757600080fd5b50610143610366366004612309565b6001600160a01b039081166000908152602081905260409020541690565b34801561039057600080fd5b506101a4604051806040016040528060058152602001640352e302e360dc1b81525081565b3480156103c157600080fd5b5061021b610a63565b3480156103d657600080fd5b506101d16103e53660046123a7565b610a86565b3480156103f657600080fd5b506101d1610405366004612309565b610ce0565b34801561041657600080fd5b5061021b610e4f565b34801561042b57600080fd5b506101d161043a366004612309565b610e5e565b34801561044b57600080fd5b506101d161045a36600461244d565b610e99565b6000610469610ef7565b610471610f2f565b81516040516301ffc9a760e01b815263cc2a041160e01b60048201526001600160a01b03909116906301ffc9a790602401602060405180830381865afa1580156104bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e3919061248c565b61050057604051630fb9181b60e11b815260040160405180910390fd5b600061050f8360000151610f72565b9050806001600160a01b031663a6487c538460200151856040015186606001516040518463ffffffff1660e01b815260040161054d939291906124ae565b600060405180830381600087803b15801561056757600080fd5b505af115801561057b573d6000803e3d6000fd5b5050506001600160a01b0380831660008181526020819052604080822080546001600160a01b0319163390811790915588519151939550931692917f0d516d8b14b989f8763b7f1b93e8e08f0f5ff06e0b833b8d080f0f1f33f9f3029190a490506105f3600160008051602061275d83398151915255565b919050565b610600610ef7565b610608610f2f565b80516001600160a01b0380821660009081526020819052604090205416331461064457604051630143454560e01b815260040160405180910390fd5b60005b8260200151518110156108195782516001600160a01b03166000908152600160209081526040822090850151805183919085908110610688576106886124e7565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205411156106d0576040516353eadbf760e11b815260040160405180910390fd5b82516040516335313c2160e11b81523060048201526000916001600160a01b031690636a627842906024016020604051808303816000875af115801561071a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073e91906124fd565b9050806001600086600001516001600160a01b03166001600160a01b03168152602001908152602001600020600086602001518581518110610782576107826124e7565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080846020015183815181106107c5576107c56124e7565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a450600101610647565b5050610832600160008051602061275d83398151915255565b50565b61083d610ef7565b610845610f2f565b80516001600160a01b0380821660009081526020819052604090205416331461088157604051630143454560e01b815260040160405180910390fd5b60005b826020015151811015610819576108da8360000151846020015183815181106108af576108af6124e7565b6020026020010151856040015184815181106108cd576108cd6124e7565b6020026020010151610ff3565b50600101610884565b6108eb611147565b6108f4826111ec565b6108fe82826111f4565b5050565b600061090c6112b6565b5060008051602061273d83398151915290565b6000610929610ef7565b610931610f2f565b81516001600160a01b0380821660009081526020819052604090205416331461096d57604051630143454560e01b815260040160405180910390fd5b610984836000015184602001518560400151610ff3565b9150506105f3600160008051602061275d83398151915255565b6109a66112ff565b6109b0600061135a565b565b6000606080828080838160008051602061271d83398151915280549091501580156109df57506001810154155b610a285760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064015b60405180910390fd5b610a306113cb565b610a3861148e565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6040518060a00160405280606c81526020016126b1606c91398051906020012081565b610a8e610ef7565b610a96610f2f565b6000610b3b610b356040518060a00160405280606c81526020016126b1606c913980516020918201208651878301516040808a015180519086012060608b015160808b01519251610b1a9792939192019586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b604051602081830303815290604052805190602001206114cd565b83611500565b9050806001600160a01b031682600001516001600160a01b031614610b735760405163680a7f5760e11b815260040160405180910390fd5b6000610bbc610bad8560600151604051602001610b9291815260200190565b60405160208183030381529060405280519060200120611598565b856040015186606001516115fa565b9050806001600160a01b031684602001516001600160a01b031614610bf457604051639918f91160e01b815260040160405180910390fd5b83516001600160a01b039081166000818152600160209081526040808320828a015186168452909152908190205490516323b872dd60e01b815230600482015292851660248401526044830152906323b872dd90606401600060405180830381600087803b158015610c6557600080fd5b505af1158015610c79573d6000803e3d6000fd5b50505060208086015186516040516001600160a01b03878116825292831694509116917fa9aa76dc8d402b3621cd270e623dcae6acc94ab94199a5f20c4758aae86175db910160405180910390a350506108fe600160008051602061275d83398151915255565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b0316600081158015610d255750825b90506000826001600160401b03166001148015610d415750303b155b905081158015610d4f575080155b15610d6d5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610d9757845460ff60401b1916600160401b1785555b610da086611631565b610de96040518060400160405280600e81526020016d50726f64756374466163746f727960901b815250604051806040016040528060018152602001603160f81b815250611642565b610df1611654565b610df9611664565b610e01611674565b8315610e4757845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b6000610e5961167c565b905090565b610e666112ff565b6001600160a01b038116610e9057604051631e4fbdf760e01b815260006004820152602401610a1f565b6108328161135a565b610ea1610ef7565b610ea9610f2f565b80516001600160a01b03808216600090815260208190526040902054163314610ee557604051630143454560e01b815260040160405180910390fd5b61081982600001518360200151611686565b60008051602061275d833981519152805460011901610f2957604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16156109b05760405163d93c066560e01b815260040160405180910390fd5b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b0381166105f3576040516330be1a3d60e21b815260040160405180910390fd5b600160008051602061275d83398151915255565b6001600160a01b03808416600090815260016020908152604080832093861683529290529081205415611039576040516353eadbf760e11b815260040160405180910390fd5b6040516335313c2160e11b81526001600160a01b038381166004830152851690636a627842906024016020604051808303816000875af1158015611081573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a591906124fd565b6001600160a01b038086166000818152600160209081526040808320948916808452949091528082208590555193945084937f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c79190a46040516001600160a01b03838116825280851691908616907fa9aa76dc8d402b3621cd270e623dcae6acc94ab94199a5f20c4758aae86175db9060200160405180910390a39392505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806111ce57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166111c260008051602061273d833981519152546001600160a01b031690565b6001600160a01b031614155b156109b05760405163703e46dd60e11b815260040160405180910390fd5b6108326112ff565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561124e575060408051601f3d908101601f1916820190925261124b918101906124fd565b60015b61127657604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610a1f565b60008051602061273d83398151915281146112a757604051632a87526960e21b815260048101829052602401610a1f565b6112b18383611792565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109b05760405163703e46dd60e11b815260040160405180910390fd5b336113317f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146109b05760405163118cdaa760e01b8152336004820152602401610a1f565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d102805460609160008051602061271d8339815191529161140a90612516565b80601f016020809104026020016040519081016040528092919081815260200182805461143690612516565b80156114835780601f1061145857610100808354040283529160200191611483565b820191906000526020600020905b81548152906001019060200180831161146657829003601f168201915b505050505091505090565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d103805460609160008051602061271d8339815191529161140a90612516565b60006114fa6114da61167c565b8360405161190160f01b8152600281019290925260228201526042902090565b92915050565b600042826080015110156115275760405163f6d5e7cb60e01b815260040160405180910390fd5b602080830151604080850151606080870151835160008082529681018086528a905260ff90951693850193909352830152608082015260019060a0016020604051602081039080840390855afa158015611585573d6000803e3d6000fd5b5050604051601f19015195945050505050565b6000604051806040016040528060188152602001772222a8242cafa4a22fa9a4a3a722a22fa6a2a9a9a0a3a29d60411b815250826040516020016115dd929190612550565b604051602081830303815290604052805190602001209050919050565b60004282101561161d57604051636932286960e11b815260040160405180910390fd5b61162784846117e8565b90505b9392505050565b611639611812565b6108328161185b565b61164a611812565b6108fe8282611863565b61165c611812565b6109b06118c4565b61166c611812565b6109b06118cc565b6109b0611812565b6000610e596118ff565b6001600160a01b038083166000908152600160209081526040808320938516835292905290812054156116cc576040516353eadbf760e11b815260040160405180910390fd5b6040516335313c2160e11b81523060048201526001600160a01b03841690636a627842906024016020604051808303816000875af1158015611712573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173691906124fd565b6001600160a01b038085166000818152600160209081526040808320948816808452949091528082208590555193945084937f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c79190a492915050565b61179b82611973565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156117e0576112b182826119d8565b6108fe611a4e565b6000806000806117f88686611a6d565b9250925092506118088282611aba565b5090949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166109b057604051631afcd79f60e31b815260040160405180910390fd5b610e66611812565b61186b611812565b60008051602061271d8339815191527fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1026118a584826125c0565b50600381016118b483826125c0565b5060008082556001909101555050565b610fdf611812565b6118d4611812565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff19169055565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61192a611b73565b611932611bdd565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b806001600160a01b03163b6000036119a957604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610a1f565b60008051602061273d83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516119f5919061267e565b600060405180830381855af49150503d8060008114611a30576040519150601f19603f3d011682016040523d82523d6000602084013e611a35565b606091505b5091509150611a45858383611c21565b95945050505050565b34156109b05760405163b398979f60e01b815260040160405180910390fd5b60008060008351604103611aa75760208401516040850151606086015160001a611a9988828585611c7d565b955095509550505050611ab3565b50508151600091506002905b9250925092565b6000826003811115611ace57611ace61269a565b03611ad7575050565b6001826003811115611aeb57611aeb61269a565b03611b095760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115611b1d57611b1d61269a565b03611b3e5760405163fce698f760e01b815260048101829052602401610a1f565b6003826003811115611b5257611b5261269a565b036108fe576040516335e2f38360e21b815260048101829052602401610a1f565b600060008051602061271d83398151915281611b8d6113cb565b805190915015611ba557805160209091012092915050565b81548015611bb4579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600060008051602061271d83398151915281611bf761148e565b805190915015611c0f57805160209091012092915050565b60018201548015611bb4579392505050565b606082611c3657611c3182611d4c565b61162a565b8151158015611c4d57506001600160a01b0384163b155b15611c7657604051639996b31560e01b81526001600160a01b0385166004820152602401610a1f565b508061162a565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611cb85750600091506003905082611d42565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611d0c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d3857506000925060019150829050611d42565b9250600091508190505b9450945094915050565b805115611d5c5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715611dad57611dad611d75565b60405290565b604080519081016001600160401b0381118282101715611dad57611dad611d75565b604051606081016001600160401b0381118282101715611dad57611dad611d75565b604051601f8201601f191681016001600160401b0381118282101715611e1f57611e1f611d75565b604052919050565b80356001600160a01b03811681146105f357600080fd5b600082601f830112611e4f57600080fd5b8135602083016000806001600160401b03841115611e6f57611e6f611d75565b50601f8301601f1916602001611e8481611df7565b915050828152858383011115611e9957600080fd5b82826020830137600092810160200192909252509392505050565b600060208284031215611ec657600080fd5b81356001600160401b03811115611edc57600080fd5b820160808185031215611eee57600080fd5b611ef6611d8b565b611eff82611e27565b815260208201356001600160401b03811115611f1a57600080fd5b611f2686828501611e3e565b60208301525060408201356001600160401b03811115611f4557600080fd5b611f5186828501611e3e565b60408301525060608201356001600160401b03811115611f7057600080fd5b611f7c86828501611e3e565b606083015250949350505050565b60005b83811015611fa5578181015183820152602001611f8d565b50506000910152565b60008151808452611fc6816020860160208601611f8a565b601f01601f19169290920160200192915050565b60208152600061162a6020830184611fae565b600082601f830112611ffe57600080fd5b81356001600160401b0381111561201757612017611d75565b8060051b61202760208201611df7565b9182526020818501810192908101908684111561204357600080fd5b6020860192505b8383101561206c5761205b83611e27565b82526020928301929091019061204a565b9695505050505050565b60006020828403121561208857600080fd5b81356001600160401b0381111561209e57600080fd5b8201604081850312156120b057600080fd5b6120b8611db3565b6120c182611e27565b815260208201356001600160401b038111156120dc57600080fd5b6120e886828501611fed565b602083015250949350505050565b60006020828403121561210857600080fd5b81356001600160401b0381111561211e57600080fd5b82016060818503121561213057600080fd5b612138611dd5565b61214182611e27565b815260208201356001600160401b0381111561215c57600080fd5b61216886828501611fed565b60208301525060408201356001600160401b0381111561218757600080fd5b61219386828501611fed565b604083015250949350505050565b600080604083850312156121b457600080fd5b6121bd83611e27565b915060208301356001600160401b038111156121d857600080fd5b6121e485828601611e3e565b9150509250929050565b6000606082840312801561220157600080fd5b5061220a611dd5565b61221383611e27565b815261222160208401611e27565b602082015261223260408401611e27565b60408201529392505050565b6000806040838503121561225157600080fd5b61225a83611e27565b915061226860208401611e27565b90509250929050565b60ff60f81b8816815260e06020820152600061229060e0830189611fae565b82810360408401526122a28189611fae565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b818110156122f85783518352602093840193909201916001016122da565b50909b9a5050505050505050505050565b60006020828403121561231b57600080fd5b61162a82611e27565b600060a0828403121561233657600080fd5b60405160a081016001600160401b038111828210171561235857612358611d75565b60405290508061236783611e27565b8152602083013560ff8116811461237d57600080fd5b60208201526040838101359082015260608084013590820152608092830135920191909152919050565b60008060c083850312156123ba57600080fd5b82356001600160401b038111156123d057600080fd5b8301608081860312156123e257600080fd5b6123ea611d8b565b6123f382611e27565b815261240160208301611e27565b602082015260408201356001600160401b0381111561241f57600080fd5b61242b87828501611e3e565b6040830152506060918201359181019190915291506122688460208501612324565b6000604082840312801561246057600080fd5b50612469611db3565b61247283611e27565b815261248060208401611e27565b60208201529392505050565b60006020828403121561249e57600080fd5b8151801515811461162a57600080fd5b6060815260006124c16060830186611fae565b82810360208401526124d38186611fae565b9050828103604084015261206c8185611fae565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561250f57600080fd5b5051919050565b600181811c9082168061252a57607f821691505b60208210810361254a57634e487b7160e01b600052602260045260246000fd5b50919050565b60008351612562818460208801611f8a565b9190910191825250602001919050565b601f8211156112b157806000526020600020601f840160051c810160208510156125995750805b601f840160051c820191505b818110156125b957600081556001016125a5565b5050505050565b81516001600160401b038111156125d9576125d9611d75565b6125ed816125e78454612516565b84612572565b6020601f82116001811461262157600083156126095750848201515b600019600385901b1c1916600184901b1784556125b9565b600084815260208120601f198516915b828110156126515787850151825560209485019460019092019101612631565b508482101561266f5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60008251612690818460208701611f8a565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfe416374697661746544657669636528616464726573732070726f647563742c61646472657373206465766963652c6279746573206465766963655369676e61747572652c75696e7432353620646576696365446561646c696e652c75696e7432353620646561646c696e6529a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a264697066735822122088e3123e0fb6fa0954df9c6ab388e7ef9ffad0da9af00d6067643d9844033d1264736f6c634300081a0033"; + static readonly abi: readonly [{ + readonly type: "function"; + readonly name: "ACTIVATE_DEVICE_TYPEHASH"; + readonly inputs: readonly []; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "bytes32"; + readonly internalType: "bytes32"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "function"; + readonly name: "DEPHY_PREFIX"; + readonly inputs: readonly []; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "string"; + readonly internalType: "string"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "function"; + readonly name: "UPGRADE_INTERFACE_VERSION"; + readonly inputs: readonly []; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "string"; + readonly internalType: "string"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "function"; + readonly name: "activateDevice"; + readonly inputs: readonly [{ + readonly name: "args"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.ActivateDeviceArgs"; + readonly components: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "device"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "deviceSignature"; + readonly type: "bytes"; + readonly internalType: "bytes"; + }, { + readonly name: "deviceDeadline"; + readonly type: "uint256"; + readonly internalType: "uint256"; + }]; + }, { + readonly name: "signature"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.EIP712Signature"; + readonly components: readonly [{ + readonly name: "signer"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "v"; + readonly type: "uint8"; + readonly internalType: "uint8"; + }, { + readonly name: "r"; + readonly type: "bytes32"; + readonly internalType: "bytes32"; + }, { + readonly name: "s"; + readonly type: "bytes32"; + readonly internalType: "bytes32"; + }, { + readonly name: "deadline"; + readonly type: "uint256"; + readonly internalType: "uint256"; + }]; + }]; + readonly outputs: readonly []; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "createActivatedDevice"; + readonly inputs: readonly [{ + readonly name: "args"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.CreateActivatedDeviceArgs"; + readonly components: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "device"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "receiver"; + readonly type: "address"; + readonly internalType: "address"; + }]; + }]; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "uint256"; + readonly internalType: "uint256"; + }]; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "createActivatedDevices"; + readonly inputs: readonly [{ + readonly name: "args"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.CreateActivatedDevicesArgs"; + readonly components: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "devices"; + readonly type: "address[]"; + readonly internalType: "address[]"; + }, { + readonly name: "receivers"; + readonly type: "address[]"; + readonly internalType: "address[]"; + }]; + }]; + readonly outputs: readonly []; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "createDevice"; + readonly inputs: readonly [{ + readonly name: "args"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.CreateDeviceArgs"; + readonly components: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "device"; + readonly type: "address"; + readonly internalType: "address"; + }]; + }]; + readonly outputs: readonly []; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "createDevices"; + readonly inputs: readonly [{ + readonly name: "args"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.CreateDevicesArgs"; + readonly components: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "devices"; + readonly type: "address[]"; + readonly internalType: "address[]"; + }]; + }]; + readonly outputs: readonly []; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "createProduct"; + readonly inputs: readonly [{ + readonly name: "args"; + readonly type: "tuple"; + readonly internalType: "struct IProductFactory.CreateProductArgs"; + readonly components: readonly [{ + readonly name: "productImpl"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "name"; + readonly type: "string"; + readonly internalType: "string"; + }, { + readonly name: "symbol"; + readonly type: "string"; + readonly internalType: "string"; + }, { + readonly name: "baseTokenURI"; + readonly type: "string"; + readonly internalType: "string"; + }]; + }]; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "address"; + readonly internalType: "address"; + }]; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "eip712Domain"; + readonly inputs: readonly []; + readonly outputs: readonly [{ + readonly name: "fields"; + readonly type: "bytes1"; + readonly internalType: "bytes1"; + }, { + readonly name: "name"; + readonly type: "string"; + readonly internalType: "string"; + }, { + readonly name: "version"; + readonly type: "string"; + readonly internalType: "string"; + }, { + readonly name: "chainId"; + readonly type: "uint256"; + readonly internalType: "uint256"; + }, { + readonly name: "verifyingContract"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "salt"; + readonly type: "bytes32"; + readonly internalType: "bytes32"; + }, { + readonly name: "extensions"; + readonly type: "uint256[]"; + readonly internalType: "uint256[]"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "function"; + readonly name: "getDeviceTokenId"; + readonly inputs: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "device"; + readonly type: "address"; + readonly internalType: "address"; + }]; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "uint256"; + readonly internalType: "uint256"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "function"; + readonly name: "getDomainSeparator"; + readonly inputs: readonly []; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "bytes32"; + readonly internalType: "bytes32"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "function"; + readonly name: "getVendorByProduct"; + readonly inputs: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly internalType: "address"; + }]; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "address"; + readonly internalType: "address"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "function"; + readonly name: "initialize"; + readonly inputs: readonly [{ + readonly name: "initialOwner"; + readonly type: "address"; + readonly internalType: "address"; + }]; + readonly outputs: readonly []; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "owner"; + readonly inputs: readonly []; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "address"; + readonly internalType: "address"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "function"; + readonly name: "paused"; + readonly inputs: readonly []; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "bool"; + readonly internalType: "bool"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "function"; + readonly name: "proxiableUUID"; + readonly inputs: readonly []; + readonly outputs: readonly [{ + readonly name: ""; + readonly type: "bytes32"; + readonly internalType: "bytes32"; + }]; + readonly stateMutability: "view"; + }, { + readonly type: "function"; + readonly name: "renounceOwnership"; + readonly inputs: readonly []; + readonly outputs: readonly []; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "transferOwnership"; + readonly inputs: readonly [{ + readonly name: "newOwner"; + readonly type: "address"; + readonly internalType: "address"; + }]; + readonly outputs: readonly []; + readonly stateMutability: "nonpayable"; + }, { + readonly type: "function"; + readonly name: "upgradeToAndCall"; + readonly inputs: readonly [{ + readonly name: "newImplementation"; + readonly type: "address"; + readonly internalType: "address"; + }, { + readonly name: "data"; + readonly type: "bytes"; + readonly internalType: "bytes"; + }]; + readonly outputs: readonly []; + readonly stateMutability: "payable"; + }, { + readonly type: "event"; + readonly name: "DeviceActivated"; + readonly inputs: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "device"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "receiver"; + readonly type: "address"; + readonly indexed: false; + readonly internalType: "address"; + }]; + readonly anonymous: false; + }, { + readonly type: "event"; + readonly name: "DeviceCreated"; + readonly inputs: readonly [{ + readonly name: "product"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "device"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "tokenId"; + readonly type: "uint256"; + readonly indexed: true; + readonly internalType: "uint256"; + }]; + readonly anonymous: false; + }, { + readonly type: "event"; + readonly name: "EIP712DomainChanged"; + readonly inputs: readonly []; + readonly anonymous: false; + }, { + readonly type: "event"; + readonly name: "Initialized"; + readonly inputs: readonly [{ + readonly name: "version"; + readonly type: "uint64"; + readonly indexed: false; + readonly internalType: "uint64"; + }]; + readonly anonymous: false; + }, { + readonly type: "event"; + readonly name: "OwnershipTransferred"; + readonly inputs: readonly [{ + readonly name: "previousOwner"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "newOwner"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }]; + readonly anonymous: false; + }, { + readonly type: "event"; + readonly name: "Paused"; + readonly inputs: readonly [{ + readonly name: "account"; + readonly type: "address"; + readonly indexed: false; + readonly internalType: "address"; + }]; + readonly anonymous: false; + }, { + readonly type: "event"; + readonly name: "ProductCreated"; + readonly inputs: readonly [{ + readonly name: "vendor"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "productImpl"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }, { + readonly name: "product"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }]; + readonly anonymous: false; + }, { + readonly type: "event"; + readonly name: "Unpaused"; + readonly inputs: readonly [{ + readonly name: "account"; + readonly type: "address"; + readonly indexed: false; + readonly internalType: "address"; + }]; + readonly anonymous: false; + }, { + readonly type: "event"; + readonly name: "Upgraded"; + readonly inputs: readonly [{ + readonly name: "implementation"; + readonly type: "address"; + readonly indexed: true; + readonly internalType: "address"; + }]; + readonly anonymous: false; + }, { + readonly type: "error"; + readonly name: "AddressEmptyCode"; + readonly inputs: readonly [{ + readonly name: "target"; + readonly type: "address"; + readonly internalType: "address"; + }]; + }, { + readonly type: "error"; + readonly name: "DeviceAlreadyCreated"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "DeviceSignatureExpired"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "DeviceSignatureMismatch"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "ECDSAInvalidSignature"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "ECDSAInvalidSignatureLength"; + readonly inputs: readonly [{ + readonly name: "length"; + readonly type: "uint256"; + readonly internalType: "uint256"; + }]; + }, { + readonly type: "error"; + readonly name: "ECDSAInvalidSignatureS"; + readonly inputs: readonly [{ + readonly name: "s"; + readonly type: "bytes32"; + readonly internalType: "bytes32"; + }]; + }, { + readonly type: "error"; + readonly name: "EIP712SignatureExpired"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "EIP712SignatureMismatch"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "ERC1167FailedCreateClone"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "ERC1967InvalidImplementation"; + readonly inputs: readonly [{ + readonly name: "implementation"; + readonly type: "address"; + readonly internalType: "address"; + }]; + }, { + readonly type: "error"; + readonly name: "ERC1967NonPayable"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "EnforcedPause"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "ExpectedPause"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "FailedInnerCall"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "InvalidInitialization"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "NotInitializing"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "NotProductTemplate"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "NotVendor"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "OwnableInvalidOwner"; + readonly inputs: readonly [{ + readonly name: "owner"; + readonly type: "address"; + readonly internalType: "address"; + }]; + }, { + readonly type: "error"; + readonly name: "OwnableUnauthorizedAccount"; + readonly inputs: readonly [{ + readonly name: "account"; + readonly type: "address"; + readonly internalType: "address"; + }]; + }, { + readonly type: "error"; + readonly name: "ReentrancyGuardReentrantCall"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "TokenIdMismatch"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "UUPSUnauthorizedCallContext"; + readonly inputs: readonly []; + }, { + readonly type: "error"; + readonly name: "UUPSUnsupportedProxiableUUID"; + readonly inputs: readonly [{ + readonly name: "slot"; + readonly type: "bytes32"; + readonly internalType: "bytes32"; + }]; + }]; + static createInterface(): ProductFactoryInterface; + static connect(address: string, signerOrProvider: Signer | Provider): ProductFactory; +} +export {}; diff --git a/tool/dist/generated/factories/ProductFactory__factory.js b/tool/dist/generated/factories/ProductFactory__factory.js new file mode 100644 index 0000000..c2615f2 --- /dev/null +++ b/tool/dist/generated/factories/ProductFactory__factory.js @@ -0,0 +1,810 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { utils, Contract, ContractFactory } from "ethers"; +const _abi = [ + { + type: "function", + name: "ACTIVATE_DEVICE_TYPEHASH", + inputs: [], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "DEPHY_PREFIX", + inputs: [], + outputs: [ + { + name: "", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "UPGRADE_INTERFACE_VERSION", + inputs: [], + outputs: [ + { + name: "", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "activateDevice", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.ActivateDeviceArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + { + name: "deviceSignature", + type: "bytes", + internalType: "bytes", + }, + { + name: "deviceDeadline", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "signature", + type: "tuple", + internalType: "struct IProductFactory.EIP712Signature", + components: [ + { + name: "signer", + type: "address", + internalType: "address", + }, + { + name: "v", + type: "uint8", + internalType: "uint8", + }, + { + name: "r", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "s", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "deadline", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createActivatedDevice", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateActivatedDeviceArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + { + name: "receiver", + type: "address", + internalType: "address", + }, + ], + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createActivatedDevices", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateActivatedDevicesArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "devices", + type: "address[]", + internalType: "address[]", + }, + { + name: "receivers", + type: "address[]", + internalType: "address[]", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createDevice", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateDeviceArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createDevices", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateDevicesArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "devices", + type: "address[]", + internalType: "address[]", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createProduct", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateProductArgs", + components: [ + { + name: "productImpl", + type: "address", + internalType: "address", + }, + { + name: "name", + type: "string", + internalType: "string", + }, + { + name: "symbol", + type: "string", + internalType: "string", + }, + { + name: "baseTokenURI", + type: "string", + internalType: "string", + }, + ], + }, + ], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "eip712Domain", + inputs: [], + outputs: [ + { + name: "fields", + type: "bytes1", + internalType: "bytes1", + }, + { + name: "name", + type: "string", + internalType: "string", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "chainId", + type: "uint256", + internalType: "uint256", + }, + { + name: "verifyingContract", + type: "address", + internalType: "address", + }, + { + name: "salt", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "extensions", + type: "uint256[]", + internalType: "uint256[]", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getDeviceTokenId", + inputs: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getDomainSeparator", + inputs: [], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getVendorByProduct", + inputs: [ + { + name: "product", + type: "address", + internalType: "address", + }, + ], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "initialize", + inputs: [ + { + name: "initialOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "owner", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "paused", + inputs: [], + outputs: [ + { + name: "", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "proxiableUUID", + inputs: [], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "renounceOwnership", + inputs: [], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "transferOwnership", + inputs: [ + { + name: "newOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "upgradeToAndCall", + inputs: [ + { + name: "newImplementation", + type: "address", + internalType: "address", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "payable", + }, + { + type: "event", + name: "DeviceActivated", + inputs: [ + { + name: "product", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "device", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "receiver", + type: "address", + indexed: false, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "DeviceCreated", + inputs: [ + { + name: "product", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "device", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "tokenId", + type: "uint256", + indexed: true, + internalType: "uint256", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "EIP712DomainChanged", + inputs: [], + anonymous: false, + }, + { + type: "event", + name: "Initialized", + inputs: [ + { + name: "version", + type: "uint64", + indexed: false, + internalType: "uint64", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "OwnershipTransferred", + inputs: [ + { + name: "previousOwner", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "newOwner", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "Paused", + inputs: [ + { + name: "account", + type: "address", + indexed: false, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ProductCreated", + inputs: [ + { + name: "vendor", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "productImpl", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "product", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "Unpaused", + inputs: [ + { + name: "account", + type: "address", + indexed: false, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "Upgraded", + inputs: [ + { + name: "implementation", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "AddressEmptyCode", + inputs: [ + { + name: "target", + type: "address", + internalType: "address", + }, + ], + }, + { + type: "error", + name: "DeviceAlreadyCreated", + inputs: [], + }, + { + type: "error", + name: "DeviceSignatureExpired", + inputs: [], + }, + { + type: "error", + name: "DeviceSignatureMismatch", + inputs: [], + }, + { + type: "error", + name: "ECDSAInvalidSignature", + inputs: [], + }, + { + type: "error", + name: "ECDSAInvalidSignatureLength", + inputs: [ + { + name: "length", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + type: "error", + name: "ECDSAInvalidSignatureS", + inputs: [ + { + name: "s", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + type: "error", + name: "EIP712SignatureExpired", + inputs: [], + }, + { + type: "error", + name: "EIP712SignatureMismatch", + inputs: [], + }, + { + type: "error", + name: "ERC1167FailedCreateClone", + inputs: [], + }, + { + type: "error", + name: "ERC1967InvalidImplementation", + inputs: [ + { + name: "implementation", + type: "address", + internalType: "address", + }, + ], + }, + { + type: "error", + name: "ERC1967NonPayable", + inputs: [], + }, + { + type: "error", + name: "EnforcedPause", + inputs: [], + }, + { + type: "error", + name: "ExpectedPause", + inputs: [], + }, + { + type: "error", + name: "FailedInnerCall", + inputs: [], + }, + { + type: "error", + name: "InvalidInitialization", + inputs: [], + }, + { + type: "error", + name: "NotInitializing", + inputs: [], + }, + { + type: "error", + name: "NotProductTemplate", + inputs: [], + }, + { + type: "error", + name: "NotVendor", + inputs: [], + }, + { + type: "error", + name: "OwnableInvalidOwner", + inputs: [ + { + name: "owner", + type: "address", + internalType: "address", + }, + ], + }, + { + type: "error", + name: "OwnableUnauthorizedAccount", + inputs: [ + { + name: "account", + type: "address", + internalType: "address", + }, + ], + }, + { + type: "error", + name: "ReentrancyGuardReentrantCall", + inputs: [], + }, + { + type: "error", + name: "TokenIdMismatch", + inputs: [], + }, + { + type: "error", + name: "UUPSUnauthorizedCallContext", + inputs: [], + }, + { + type: "error", + name: "UUPSUnsupportedProxiableUUID", + inputs: [ + { + name: "slot", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, +]; +const _bytecode = "0x60a060405230608052348015601357600080fd5b506080516127b261003d600039600081816111520152818161117b01526112c101526127b26000f3fe60806040526004361061011e5760003560e01c806384b0196e116100a0578063bb189de111610064578063bb189de1146103ca578063c4d66de8146103ea578063ed24911d1461040a578063f2fde38b1461041f578063f9d8ee941461043f57600080fd5b806384b0196e146102e65780638da5cb5b1461030e578063904b55a51461034b578063ad3cb1cc14610384578063b063cb54146103b557600080fd5b806352d1902d116100e757806352d1902d14610206578063565501b4146102295780635c975abb146102495780635d25e6321461028b578063715018a6146102d157600080fd5b80622ca198146101235780631aaa192d146101605780633a7eece8146101b15780634be60db3146101d35780634f1ef286146101f3575b600080fd5b34801561012f57600080fd5b5061014361013e366004611eb4565b61045f565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561016c57600080fd5b506101a4604051806040016040528060188152602001772222a8242cafa4a22fa9a4a3a722a22fa6a2a9a9a0a3a29d60411b81525081565b6040516101579190611fda565b3480156101bd57600080fd5b506101d16101cc366004612076565b6105f8565b005b3480156101df57600080fd5b506101d16101ee3660046120f6565b610835565b6101d16102013660046121a1565b6108e3565b34801561021257600080fd5b5061021b610902565b604051908152602001610157565b34801561023557600080fd5b5061021b6102443660046121ee565b61091f565b34801561025557600080fd5b507fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff166040519015158152602001610157565b34801561029757600080fd5b5061021b6102a636600461223e565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156102dd57600080fd5b506101d161099e565b3480156102f257600080fd5b506102fb6109b2565b6040516101579796959493929190612271565b34801561031a57600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b0316610143565b34801561035757600080fd5b50610143610366366004612309565b6001600160a01b039081166000908152602081905260409020541690565b34801561039057600080fd5b506101a4604051806040016040528060058152602001640352e302e360dc1b81525081565b3480156103c157600080fd5b5061021b610a63565b3480156103d657600080fd5b506101d16103e53660046123a7565b610a86565b3480156103f657600080fd5b506101d1610405366004612309565b610ce0565b34801561041657600080fd5b5061021b610e4f565b34801561042b57600080fd5b506101d161043a366004612309565b610e5e565b34801561044b57600080fd5b506101d161045a36600461244d565b610e99565b6000610469610ef7565b610471610f2f565b81516040516301ffc9a760e01b815263cc2a041160e01b60048201526001600160a01b03909116906301ffc9a790602401602060405180830381865afa1580156104bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e3919061248c565b61050057604051630fb9181b60e11b815260040160405180910390fd5b600061050f8360000151610f72565b9050806001600160a01b031663a6487c538460200151856040015186606001516040518463ffffffff1660e01b815260040161054d939291906124ae565b600060405180830381600087803b15801561056757600080fd5b505af115801561057b573d6000803e3d6000fd5b5050506001600160a01b0380831660008181526020819052604080822080546001600160a01b0319163390811790915588519151939550931692917f0d516d8b14b989f8763b7f1b93e8e08f0f5ff06e0b833b8d080f0f1f33f9f3029190a490506105f3600160008051602061275d83398151915255565b919050565b610600610ef7565b610608610f2f565b80516001600160a01b0380821660009081526020819052604090205416331461064457604051630143454560e01b815260040160405180910390fd5b60005b8260200151518110156108195782516001600160a01b03166000908152600160209081526040822090850151805183919085908110610688576106886124e7565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205411156106d0576040516353eadbf760e11b815260040160405180910390fd5b82516040516335313c2160e11b81523060048201526000916001600160a01b031690636a627842906024016020604051808303816000875af115801561071a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073e91906124fd565b9050806001600086600001516001600160a01b03166001600160a01b03168152602001908152602001600020600086602001518581518110610782576107826124e7565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080846020015183815181106107c5576107c56124e7565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a450600101610647565b5050610832600160008051602061275d83398151915255565b50565b61083d610ef7565b610845610f2f565b80516001600160a01b0380821660009081526020819052604090205416331461088157604051630143454560e01b815260040160405180910390fd5b60005b826020015151811015610819576108da8360000151846020015183815181106108af576108af6124e7565b6020026020010151856040015184815181106108cd576108cd6124e7565b6020026020010151610ff3565b50600101610884565b6108eb611147565b6108f4826111ec565b6108fe82826111f4565b5050565b600061090c6112b6565b5060008051602061273d83398151915290565b6000610929610ef7565b610931610f2f565b81516001600160a01b0380821660009081526020819052604090205416331461096d57604051630143454560e01b815260040160405180910390fd5b610984836000015184602001518560400151610ff3565b9150506105f3600160008051602061275d83398151915255565b6109a66112ff565b6109b0600061135a565b565b6000606080828080838160008051602061271d83398151915280549091501580156109df57506001810154155b610a285760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064015b60405180910390fd5b610a306113cb565b610a3861148e565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6040518060a00160405280606c81526020016126b1606c91398051906020012081565b610a8e610ef7565b610a96610f2f565b6000610b3b610b356040518060a00160405280606c81526020016126b1606c913980516020918201208651878301516040808a015180519086012060608b015160808b01519251610b1a9792939192019586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b604051602081830303815290604052805190602001206114cd565b83611500565b9050806001600160a01b031682600001516001600160a01b031614610b735760405163680a7f5760e11b815260040160405180910390fd5b6000610bbc610bad8560600151604051602001610b9291815260200190565b60405160208183030381529060405280519060200120611598565b856040015186606001516115fa565b9050806001600160a01b031684602001516001600160a01b031614610bf457604051639918f91160e01b815260040160405180910390fd5b83516001600160a01b039081166000818152600160209081526040808320828a015186168452909152908190205490516323b872dd60e01b815230600482015292851660248401526044830152906323b872dd90606401600060405180830381600087803b158015610c6557600080fd5b505af1158015610c79573d6000803e3d6000fd5b50505060208086015186516040516001600160a01b03878116825292831694509116917fa9aa76dc8d402b3621cd270e623dcae6acc94ab94199a5f20c4758aae86175db910160405180910390a350506108fe600160008051602061275d83398151915255565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b0316600081158015610d255750825b90506000826001600160401b03166001148015610d415750303b155b905081158015610d4f575080155b15610d6d5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610d9757845460ff60401b1916600160401b1785555b610da086611631565b610de96040518060400160405280600e81526020016d50726f64756374466163746f727960901b815250604051806040016040528060018152602001603160f81b815250611642565b610df1611654565b610df9611664565b610e01611674565b8315610e4757845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b6000610e5961167c565b905090565b610e666112ff565b6001600160a01b038116610e9057604051631e4fbdf760e01b815260006004820152602401610a1f565b6108328161135a565b610ea1610ef7565b610ea9610f2f565b80516001600160a01b03808216600090815260208190526040902054163314610ee557604051630143454560e01b815260040160405180910390fd5b61081982600001518360200151611686565b60008051602061275d833981519152805460011901610f2957604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16156109b05760405163d93c066560e01b815260040160405180910390fd5b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b0381166105f3576040516330be1a3d60e21b815260040160405180910390fd5b600160008051602061275d83398151915255565b6001600160a01b03808416600090815260016020908152604080832093861683529290529081205415611039576040516353eadbf760e11b815260040160405180910390fd5b6040516335313c2160e11b81526001600160a01b038381166004830152851690636a627842906024016020604051808303816000875af1158015611081573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a591906124fd565b6001600160a01b038086166000818152600160209081526040808320948916808452949091528082208590555193945084937f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c79190a46040516001600160a01b03838116825280851691908616907fa9aa76dc8d402b3621cd270e623dcae6acc94ab94199a5f20c4758aae86175db9060200160405180910390a39392505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806111ce57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166111c260008051602061273d833981519152546001600160a01b031690565b6001600160a01b031614155b156109b05760405163703e46dd60e11b815260040160405180910390fd5b6108326112ff565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561124e575060408051601f3d908101601f1916820190925261124b918101906124fd565b60015b61127657604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610a1f565b60008051602061273d83398151915281146112a757604051632a87526960e21b815260048101829052602401610a1f565b6112b18383611792565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109b05760405163703e46dd60e11b815260040160405180910390fd5b336113317f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146109b05760405163118cdaa760e01b8152336004820152602401610a1f565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d102805460609160008051602061271d8339815191529161140a90612516565b80601f016020809104026020016040519081016040528092919081815260200182805461143690612516565b80156114835780601f1061145857610100808354040283529160200191611483565b820191906000526020600020905b81548152906001019060200180831161146657829003601f168201915b505050505091505090565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d103805460609160008051602061271d8339815191529161140a90612516565b60006114fa6114da61167c565b8360405161190160f01b8152600281019290925260228201526042902090565b92915050565b600042826080015110156115275760405163f6d5e7cb60e01b815260040160405180910390fd5b602080830151604080850151606080870151835160008082529681018086528a905260ff90951693850193909352830152608082015260019060a0016020604051602081039080840390855afa158015611585573d6000803e3d6000fd5b5050604051601f19015195945050505050565b6000604051806040016040528060188152602001772222a8242cafa4a22fa9a4a3a722a22fa6a2a9a9a0a3a29d60411b815250826040516020016115dd929190612550565b604051602081830303815290604052805190602001209050919050565b60004282101561161d57604051636932286960e11b815260040160405180910390fd5b61162784846117e8565b90505b9392505050565b611639611812565b6108328161185b565b61164a611812565b6108fe8282611863565b61165c611812565b6109b06118c4565b61166c611812565b6109b06118cc565b6109b0611812565b6000610e596118ff565b6001600160a01b038083166000908152600160209081526040808320938516835292905290812054156116cc576040516353eadbf760e11b815260040160405180910390fd5b6040516335313c2160e11b81523060048201526001600160a01b03841690636a627842906024016020604051808303816000875af1158015611712573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173691906124fd565b6001600160a01b038085166000818152600160209081526040808320948816808452949091528082208590555193945084937f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c79190a492915050565b61179b82611973565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156117e0576112b182826119d8565b6108fe611a4e565b6000806000806117f88686611a6d565b9250925092506118088282611aba565b5090949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166109b057604051631afcd79f60e31b815260040160405180910390fd5b610e66611812565b61186b611812565b60008051602061271d8339815191527fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1026118a584826125c0565b50600381016118b483826125c0565b5060008082556001909101555050565b610fdf611812565b6118d4611812565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff19169055565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61192a611b73565b611932611bdd565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b806001600160a01b03163b6000036119a957604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610a1f565b60008051602061273d83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516119f5919061267e565b600060405180830381855af49150503d8060008114611a30576040519150601f19603f3d011682016040523d82523d6000602084013e611a35565b606091505b5091509150611a45858383611c21565b95945050505050565b34156109b05760405163b398979f60e01b815260040160405180910390fd5b60008060008351604103611aa75760208401516040850151606086015160001a611a9988828585611c7d565b955095509550505050611ab3565b50508151600091506002905b9250925092565b6000826003811115611ace57611ace61269a565b03611ad7575050565b6001826003811115611aeb57611aeb61269a565b03611b095760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115611b1d57611b1d61269a565b03611b3e5760405163fce698f760e01b815260048101829052602401610a1f565b6003826003811115611b5257611b5261269a565b036108fe576040516335e2f38360e21b815260048101829052602401610a1f565b600060008051602061271d83398151915281611b8d6113cb565b805190915015611ba557805160209091012092915050565b81548015611bb4579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600060008051602061271d83398151915281611bf761148e565b805190915015611c0f57805160209091012092915050565b60018201548015611bb4579392505050565b606082611c3657611c3182611d4c565b61162a565b8151158015611c4d57506001600160a01b0384163b155b15611c7657604051639996b31560e01b81526001600160a01b0385166004820152602401610a1f565b508061162a565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611cb85750600091506003905082611d42565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611d0c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d3857506000925060019150829050611d42565b9250600091508190505b9450945094915050565b805115611d5c5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715611dad57611dad611d75565b60405290565b604080519081016001600160401b0381118282101715611dad57611dad611d75565b604051606081016001600160401b0381118282101715611dad57611dad611d75565b604051601f8201601f191681016001600160401b0381118282101715611e1f57611e1f611d75565b604052919050565b80356001600160a01b03811681146105f357600080fd5b600082601f830112611e4f57600080fd5b8135602083016000806001600160401b03841115611e6f57611e6f611d75565b50601f8301601f1916602001611e8481611df7565b915050828152858383011115611e9957600080fd5b82826020830137600092810160200192909252509392505050565b600060208284031215611ec657600080fd5b81356001600160401b03811115611edc57600080fd5b820160808185031215611eee57600080fd5b611ef6611d8b565b611eff82611e27565b815260208201356001600160401b03811115611f1a57600080fd5b611f2686828501611e3e565b60208301525060408201356001600160401b03811115611f4557600080fd5b611f5186828501611e3e565b60408301525060608201356001600160401b03811115611f7057600080fd5b611f7c86828501611e3e565b606083015250949350505050565b60005b83811015611fa5578181015183820152602001611f8d565b50506000910152565b60008151808452611fc6816020860160208601611f8a565b601f01601f19169290920160200192915050565b60208152600061162a6020830184611fae565b600082601f830112611ffe57600080fd5b81356001600160401b0381111561201757612017611d75565b8060051b61202760208201611df7565b9182526020818501810192908101908684111561204357600080fd5b6020860192505b8383101561206c5761205b83611e27565b82526020928301929091019061204a565b9695505050505050565b60006020828403121561208857600080fd5b81356001600160401b0381111561209e57600080fd5b8201604081850312156120b057600080fd5b6120b8611db3565b6120c182611e27565b815260208201356001600160401b038111156120dc57600080fd5b6120e886828501611fed565b602083015250949350505050565b60006020828403121561210857600080fd5b81356001600160401b0381111561211e57600080fd5b82016060818503121561213057600080fd5b612138611dd5565b61214182611e27565b815260208201356001600160401b0381111561215c57600080fd5b61216886828501611fed565b60208301525060408201356001600160401b0381111561218757600080fd5b61219386828501611fed565b604083015250949350505050565b600080604083850312156121b457600080fd5b6121bd83611e27565b915060208301356001600160401b038111156121d857600080fd5b6121e485828601611e3e565b9150509250929050565b6000606082840312801561220157600080fd5b5061220a611dd5565b61221383611e27565b815261222160208401611e27565b602082015261223260408401611e27565b60408201529392505050565b6000806040838503121561225157600080fd5b61225a83611e27565b915061226860208401611e27565b90509250929050565b60ff60f81b8816815260e06020820152600061229060e0830189611fae565b82810360408401526122a28189611fae565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b818110156122f85783518352602093840193909201916001016122da565b50909b9a5050505050505050505050565b60006020828403121561231b57600080fd5b61162a82611e27565b600060a0828403121561233657600080fd5b60405160a081016001600160401b038111828210171561235857612358611d75565b60405290508061236783611e27565b8152602083013560ff8116811461237d57600080fd5b60208201526040838101359082015260608084013590820152608092830135920191909152919050565b60008060c083850312156123ba57600080fd5b82356001600160401b038111156123d057600080fd5b8301608081860312156123e257600080fd5b6123ea611d8b565b6123f382611e27565b815261240160208301611e27565b602082015260408201356001600160401b0381111561241f57600080fd5b61242b87828501611e3e565b6040830152506060918201359181019190915291506122688460208501612324565b6000604082840312801561246057600080fd5b50612469611db3565b61247283611e27565b815261248060208401611e27565b60208201529392505050565b60006020828403121561249e57600080fd5b8151801515811461162a57600080fd5b6060815260006124c16060830186611fae565b82810360208401526124d38186611fae565b9050828103604084015261206c8185611fae565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561250f57600080fd5b5051919050565b600181811c9082168061252a57607f821691505b60208210810361254a57634e487b7160e01b600052602260045260246000fd5b50919050565b60008351612562818460208801611f8a565b9190910191825250602001919050565b601f8211156112b157806000526020600020601f840160051c810160208510156125995750805b601f840160051c820191505b818110156125b957600081556001016125a5565b5050505050565b81516001600160401b038111156125d9576125d9611d75565b6125ed816125e78454612516565b84612572565b6020601f82116001811461262157600083156126095750848201515b600019600385901b1c1916600184901b1784556125b9565b600084815260208120601f198516915b828110156126515787850151825560209485019460019092019101612631565b508482101561266f5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60008251612690818460208701611f8a565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfe416374697661746544657669636528616464726573732070726f647563742c61646472657373206465766963652c6279746573206465766963655369676e61747572652c75696e7432353620646576696365446561646c696e652c75696e7432353620646561646c696e6529a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a264697066735822122088e3123e0fb6fa0954df9c6ab388e7ef9ffad0da9af00d6067643d9844033d1264736f6c634300081a0033"; +const isSuperArgs = (xs) => xs.length > 1; +class ProductFactory__factory extends ContractFactory { + constructor(...args) { + if (isSuperArgs(args)) { + super(...args); + } + else { + super(_abi, _bytecode, args[0]); + } + } + deploy(overrides) { + return super.deploy(overrides || {}); + } + getDeployTransaction(overrides) { + return super.getDeployTransaction(overrides || {}); + } + attach(address) { + return super.attach(address); + } + connect(signer) { + return super.connect(signer); + } + static createInterface() { + return new utils.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +} +ProductFactory__factory.bytecode = _bytecode; +ProductFactory__factory.abi = _abi; +export { ProductFactory__factory }; diff --git a/tool/dist/generated/factories/index.d.ts b/tool/dist/generated/factories/index.d.ts new file mode 100644 index 0000000..9aeb9fa --- /dev/null +++ b/tool/dist/generated/factories/index.d.ts @@ -0,0 +1,2 @@ +export { IProductFactory__factory } from "./IProductFactory__factory"; +export { ProductFactory__factory } from "./ProductFactory__factory"; diff --git a/tool/dist/typechain/factories/index.js b/tool/dist/generated/factories/index.js similarity index 69% rename from tool/dist/typechain/factories/index.js rename to tool/dist/generated/factories/index.js index 0e7afb4..a7d3b07 100644 --- a/tool/dist/typechain/factories/index.js +++ b/tool/dist/generated/factories/index.js @@ -1,4 +1,5 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ +export { IProductFactory__factory } from "./IProductFactory__factory"; export { ProductFactory__factory } from "./ProductFactory__factory"; diff --git a/tool/dist/typechain/index.d.ts b/tool/dist/generated/index.d.ts similarity index 56% rename from tool/dist/typechain/index.d.ts rename to tool/dist/generated/index.d.ts index a2fff3b..c968986 100644 --- a/tool/dist/typechain/index.d.ts +++ b/tool/dist/generated/index.d.ts @@ -1,3 +1,5 @@ +export type { IProductFactory } from "./IProductFactory"; export type { ProductFactory } from "./ProductFactory"; export * as factories from "./factories"; export { ProductFactory__factory } from "./factories/ProductFactory__factory"; +export { IProductFactory__factory } from "./factories/IProductFactory__factory"; diff --git a/tool/dist/typechain/index.js b/tool/dist/generated/index.js similarity index 59% rename from tool/dist/typechain/index.js rename to tool/dist/generated/index.js index 2815af5..6af4234 100644 --- a/tool/dist/typechain/index.js +++ b/tool/dist/generated/index.js @@ -1,2 +1,3 @@ export * as factories from "./factories"; export { ProductFactory__factory } from "./factories/ProductFactory__factory"; +export { IProductFactory__factory } from "./factories/IProductFactory__factory"; diff --git a/tool/dist/typechain/factories/ProductFactory__factory.d.ts b/tool/dist/typechain/factories/ProductFactory__factory.d.ts deleted file mode 100644 index 1d87b59..0000000 --- a/tool/dist/typechain/factories/ProductFactory__factory.d.ts +++ /dev/null @@ -1,424 +0,0 @@ -import { Signer, ContractFactory, Overrides } from "ethers"; -import type { Provider, TransactionRequest } from "@ethersproject/providers"; -import type { ProductFactory, ProductFactoryInterface } from "../ProductFactory"; -type ProductFactoryConstructorParams = [signer?: Signer] | ConstructorParameters; -export declare class ProductFactory__factory extends ContractFactory { - constructor(...args: ProductFactoryConstructorParams); - deploy(initialOwner: string, overrides?: Overrides & { - from?: string; - }): Promise; - getDeployTransaction(initialOwner: string, overrides?: Overrides & { - from?: string; - }): TransactionRequest; - attach(address: string): ProductFactory; - connect(signer: Signer): ProductFactory__factory; - static readonly bytecode = "0x61016060405234801561001157600080fd5b50604051611e2d380380611e2d8339810160408190526100309161021f565b604080518082018252600e81526d50726f64756374466163746f727960901b602080830191909152825180840190935260018352603160f81b9083015290826001600160a01b03811661009e57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6100a78161015e565b506100b38260016101ae565b610120526100c28160026101ae565b61014052815160208084019190912060e052815190820120610100524660a05261014f60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0525061041e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020835110156101ca576101c3836101e1565b90506101db565b816101d584826102ee565b5060ff90505b92915050565b600080829050601f8151111561020c578260405163305a27a960e01b815260040161009591906103ac565b8051610217826103fa565b179392505050565b60006020828403121561023157600080fd5b81516001600160a01b038116811461024857600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061027957607f821691505b60208210810361029957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156102e957806000526020600020601f840160051c810160208510156102c65750805b601f840160051c820191505b818110156102e657600081556001016102d2565b50505b505050565b81516001600160401b038111156103075761030761024f565b61031b816103158454610265565b8461029f565b6020601f82116001811461034f57600083156103375750848201515b600019600385901b1c1916600184901b1784556102e6565b600084815260208120601f198516915b8281101561037f578785015182556020948501946001909201910161035f565b508482101561039d5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b602081526000825180602084015260005b818110156103da57602081860181015160408684010152016103bd565b506000604082850101526040601f19601f83011684010191505092915050565b805160208083015191908110156102995760001960209190910360031b1b16919050565b60805160a05160c05160e0516101005161012051610140516119b56104786000396000610c8601526000610c5901526000610e8001526000610e5801526000610db301526000610ddd01526000610e0701526119b56000f3fe608060405234801561001057600080fd5b50600436106100b35760003560e01c80638da5cb5b116100715780638da5cb5b14610154578063904b55a514610165578063b063cb5414610191578063bb189de114610199578063ed24911d146101ac578063f2fde38b146101b457600080fd5b80622ca198146100b85780633a7eece8146100e85780634be60db3146100fd5780635d25e63214610110578063715018a61461013157806384b0196e14610139575b600080fd5b6100cb6100c636600461130f565b6101c7565b6040516001600160a01b0390911681526020015b60405180910390f35b6100fb6100f636600461146e565b610339565b005b6100fb61010b36600461150b565b61054f565b61012361011e3660046115b6565b6107f4565b6040519081526020016100df565b6100fb610821565b610141610835565b6040516100df979695949392919061162f565b6000546001600160a01b03166100cb565b6100cb6101733660046116c7565b6001600160a01b039081166000908152600360205260409020541690565b61012361087b565b6100fb6101a7366004611765565b61089e565b610123610b11565b6100fb6101c23660046116c7565b610b20565b80516040516301ffc9a760e01b815263360ff5e360e01b60048201526000916001600160a01b0316906301ffc9a790602401602060405180830381865afa158015610216573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023a919061181f565b61025757604051630fb9181b60e11b815260040160405180910390fd5b60006102668360000151610b63565b9050806001600160a01b0316635c6d8da1846020015185604001518660600151306040518563ffffffff1660e01b81526004016102a69493929190611841565b600060405180830381600087803b1580156102c057600080fd5b505af11580156102d4573d6000803e3d6000fd5b5050506001600160a01b0380831660008181526003602052604080822080546001600160a01b0319163390811790915588519151939550931692917f0d516d8b14b989f8763b7f1b93e8e08f0f5ff06e0b833b8d080f0f1f33f9f3029190a492915050565b80516001600160a01b0380821660009081526003602052604090205416331461037557604051630143454560e01b815260040160405180910390fd5b60005b82602001515181101561054a5782516001600160a01b031660009081526004602090815260408220908501518051839190859081106103b9576103b9611894565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020541115610401576040516353eadbf760e11b815260040160405180910390fd5b82516040516335313c2160e11b81523060048201526000916001600160a01b031690636a627842906024016020604051808303816000875af115801561044b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046f91906118aa565b9050806004600086600001516001600160a01b03166001600160a01b031681526020019081526020016000206000866020015185815181106104b3576104b3611894565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080846020015183815181106104f6576104f6611894565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a450600101610378565b505050565b80516001600160a01b0380821660009081526003602052604090205416331461058b57604051630143454560e01b815260040160405180910390fd5b60005b82602001515181101561054a5782516001600160a01b031660009081526004602090815260408220908501518051839190859081106105cf576105cf611894565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020541115610617576040516353eadbf760e11b815260040160405180910390fd5b600083600001516001600160a01b0316636a6278428560400151848151811061064257610642611894565b60200260200101516040518263ffffffff1660e01b815260040161067591906001600160a01b0391909116815260200190565b6020604051808303816000875af1158015610694573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b891906118aa565b9050806004600086600001516001600160a01b03166001600160a01b031681526020019081526020016000206000866020015185815181106106fc576106fc611894565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808460200151838151811061073f5761073f611894565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a4836040015182815181106107a0576107a0611894565b60200260200101516001600160a01b031684600001516001600160a01b03167ff297737e991455288ddb7481b53c270d8821275ddfdf4e82af900234f8e2925960405160405180910390a35060010161058e565b6001600160a01b038083166000908152600460209081526040808320938516835292905220545b92915050565b610829610bd5565b6108336000610c02565b565b600060608060008060006060610849610c52565b610851610c7f565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6040518060a00160405280606c8152602001611914606c91398051906020012081565b600061094361093d6040518060a00160405280606c8152602001611914606c913980516020918201208651878301516040808a015180519086012060608b015160808b015192516109229792939192019586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b60405160208183030381529060405280519060200120610cac565b83610cd9565b9050806001600160a01b031682600001516001600160a01b03161461097b5760405163680a7f5760e11b815260040160405180910390fd5b6000610a096109fa856060015160405160200161099a91815260200190565b60408051601f1981840301815282825280516020918201207f44455048595f49445f5349474e45445f4d4553534147453a000000000000000084830152603880850191909152825180850390910181526058909301909152815191012090565b85604001518660600151610d71565b9050806001600160a01b031684602001516001600160a01b031614610a4157604051639918f91160e01b815260040160405180910390fd5b83516001600160a01b039081166000818152600460208181526040808420828b015187168552909152918290205491516323b872dd60e01b8152309181019190915292851660248401526044830152906323b872dd90606401600060405180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b505050602085015185516040516001600160a01b0392831693509116907ff297737e991455288ddb7481b53c270d8821275ddfdf4e82af900234f8e2925990600090a350505050565b6000610b1b610da6565b905090565b610b28610bd5565b6001600160a01b038116610b5757604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b610b6081610c02565b50565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116610bd0576040516330be1a3d60e21b815260040160405180910390fd5b919050565b6000546001600160a01b031633146108335760405163118cdaa760e01b8152336004820152602401610b4e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060610b1b7f00000000000000000000000000000000000000000000000000000000000000006001610ed1565b6060610b1b7f00000000000000000000000000000000000000000000000000000000000000006002610ed1565b600061081b610cb9610da6565b8360405161190160f01b8152600281019290925260228201526042902090565b60004282608001511015610d005760405163f6d5e7cb60e01b815260040160405180910390fd5b602080830151604080850151606080870151835160008082529681018086528a905260ff90951693850193909352830152608082015260019060a0016020604051602081039080840390855afa158015610d5e573d6000803e3d6000fd5b5050604051601f19015195945050505050565b600042821015610d9457604051636932286960e11b815260040160405180910390fd5b610d9e8484610f7c565b949350505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610dff57507f000000000000000000000000000000000000000000000000000000000000000046145b15610e2957507f000000000000000000000000000000000000000000000000000000000000000090565b610b1b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b606060ff8314610eeb57610ee483610fa6565b905061081b565b818054610ef7906118c3565b80601f0160208091040260200160405190810160405280929190818152602001828054610f23906118c3565b8015610f705780601f10610f4557610100808354040283529160200191610f70565b820191906000526020600020905b815481529060010190602001808311610f5357829003601f168201915b5050505050905061081b565b600080600080610f8c8686610fe5565b925092509250610f9c8282611032565b5090949350505050565b60606000610fb3836110ef565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000806000835160410361101f5760208401516040850151606086015160001a61101188828585611117565b95509550955050505061102b565b50508151600091506002905b9250925092565b6000826003811115611046576110466118fd565b0361104f575050565b6001826003811115611063576110636118fd565b036110815760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115611095576110956118fd565b036110b65760405163fce698f760e01b815260048101829052602401610b4e565b60038260038111156110ca576110ca6118fd565b036110eb576040516335e2f38360e21b815260048101829052602401610b4e565b5050565b600060ff8216601f81111561081b57604051632cd44ac360e21b815260040160405180910390fd5b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561115257506000915060039050826111dc565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156111a6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166111d2575060009250600191508290506111dc565b9250600091508190505b9450945094915050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b038111828210171561121e5761121e6111e6565b60405290565b604051606081016001600160401b038111828210171561121e5761121e6111e6565b604051601f8201601f191681016001600160401b038111828210171561126e5761126e6111e6565b604052919050565b80356001600160a01b0381168114610bd057600080fd5b6000806001600160401b038411156112a7576112a76111e6565b50601f8301601f19166020016112bc81611246565b9150508281528383830111156112d157600080fd5b828260208301376000602084830101529392505050565b600082601f8301126112f957600080fd5b6113088383356020850161128d565b9392505050565b60006020828403121561132157600080fd5b81356001600160401b0381111561133757600080fd5b82016080818503121561134957600080fd5b6113516111fc565b61135a82611276565b815260208201356001600160401b0381111561137557600080fd5b611381868285016112e8565b60208301525060408201356001600160401b038111156113a057600080fd5b6113ac868285016112e8565b60408301525060608201356001600160401b038111156113cb57600080fd5b6113d7868285016112e8565b606083015250949350505050565b600082601f8301126113f657600080fd5b81356001600160401b0381111561140f5761140f6111e6565b8060051b61141f60208201611246565b9182526020818501810192908101908684111561143b57600080fd5b6020860192505b838310156114645761145383611276565b825260209283019290910190611442565b9695505050505050565b60006020828403121561148057600080fd5b81356001600160401b0381111561149657600080fd5b8201604081850312156114a857600080fd5b604080519081016001600160401b03811182821017156114ca576114ca6111e6565b6040526114d682611276565b815260208201356001600160401b038111156114f157600080fd5b6114fd868285016113e5565b602083015250949350505050565b60006020828403121561151d57600080fd5b81356001600160401b0381111561153357600080fd5b82016060818503121561154557600080fd5b61154d611224565b61155682611276565b815260208201356001600160401b0381111561157157600080fd5b61157d868285016113e5565b60208301525060408201356001600160401b0381111561159c57600080fd5b6115a8868285016113e5565b604083015250949350505050565b600080604083850312156115c957600080fd5b6115d283611276565b91506115e060208401611276565b90509250929050565b6000815180845260005b8181101561160f576020818501810151868301820152016115f3565b506000602082860101526020601f19601f83011685010191505092915050565b60ff60f81b8816815260e06020820152600061164e60e08301896115e9565b828103604084015261166081896115e9565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b818110156116b6578351835260209384019390920191600101611698565b50909b9a5050505050505050505050565b6000602082840312156116d957600080fd5b61130882611276565b600060a082840312156116f457600080fd5b60405160a081016001600160401b0381118282101715611716576117166111e6565b60405290508061172583611276565b8152602083013560ff8116811461173b57600080fd5b60208201526040838101359082015260608084013590820152608092830135920191909152919050565b60008060c0838503121561177857600080fd5b82356001600160401b0381111561178e57600080fd5b8301608081860312156117a057600080fd5b6117a86111fc565b6117b182611276565b81526117bf60208301611276565b602082015260408201356001600160401b038111156117dd57600080fd5b8201601f810187136117ee57600080fd5b6117fd8782356020840161128d565b6040830152506060918201359181019190915291506115e084602085016116e2565b60006020828403121561183157600080fd5b8151801515811461130857600080fd5b60808152600061185460808301876115e9565b828103602084015261186681876115e9565b9050828103604084015261187a81866115e9565b91505060018060a01b038316606083015295945050505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156118bc57600080fd5b5051919050565b600181811c908216806118d757607f821691505b6020821081036118f757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052602160045260246000fdfe416374697661746544657669636528616464726573732070726f647563742c61646472657373206465766963652c6279746573206465766963655369676e61747572652c75696e7432353620646576696365446561646c696e652c75696e7432353620646561646c696e6529a26469706673582212205aae321411c9f4bb762f3838fd491f112fc34ff33add75c3b487b884160409fb64736f6c634300081a0033"; - static readonly abi: readonly [{ - readonly type: "constructor"; - readonly inputs: readonly [{ - readonly name: "initialOwner"; - readonly type: "address"; - readonly internalType: "address"; - }]; - readonly stateMutability: "nonpayable"; - }, { - readonly type: "function"; - readonly name: "ACTIVATE_DEVICE_TYPEHASH"; - readonly inputs: readonly []; - readonly outputs: readonly [{ - readonly name: ""; - readonly type: "bytes32"; - readonly internalType: "bytes32"; - }]; - readonly stateMutability: "view"; - }, { - readonly type: "function"; - readonly name: "activateDevice"; - readonly inputs: readonly [{ - readonly name: "args"; - readonly type: "tuple"; - readonly internalType: "struct ProductFactory.ActivateDeviceArgs"; - readonly components: readonly [{ - readonly name: "product"; - readonly type: "address"; - readonly internalType: "address"; - }, { - readonly name: "device"; - readonly type: "address"; - readonly internalType: "address"; - }, { - readonly name: "deviceSignature"; - readonly type: "bytes"; - readonly internalType: "bytes"; - }, { - readonly name: "deviceDeadline"; - readonly type: "uint256"; - readonly internalType: "uint256"; - }]; - }, { - readonly name: "signature"; - readonly type: "tuple"; - readonly internalType: "struct ProductFactory.EIP712Signature"; - readonly components: readonly [{ - readonly name: "signer"; - readonly type: "address"; - readonly internalType: "address"; - }, { - readonly name: "v"; - readonly type: "uint8"; - readonly internalType: "uint8"; - }, { - readonly name: "r"; - readonly type: "bytes32"; - readonly internalType: "bytes32"; - }, { - readonly name: "s"; - readonly type: "bytes32"; - readonly internalType: "bytes32"; - }, { - readonly name: "deadline"; - readonly type: "uint256"; - readonly internalType: "uint256"; - }]; - }]; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - }, { - readonly type: "function"; - readonly name: "createActivatedDevices"; - readonly inputs: readonly [{ - readonly name: "args"; - readonly type: "tuple"; - readonly internalType: "struct ProductFactory.CreateActivatedDevicesArgs"; - readonly components: readonly [{ - readonly name: "product"; - readonly type: "address"; - readonly internalType: "address"; - }, { - readonly name: "devices"; - readonly type: "address[]"; - readonly internalType: "address[]"; - }, { - readonly name: "receivers"; - readonly type: "address[]"; - readonly internalType: "address[]"; - }]; - }]; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - }, { - readonly type: "function"; - readonly name: "createDevices"; - readonly inputs: readonly [{ - readonly name: "args"; - readonly type: "tuple"; - readonly internalType: "struct ProductFactory.CreateDevicesArgs"; - readonly components: readonly [{ - readonly name: "product"; - readonly type: "address"; - readonly internalType: "address"; - }, { - readonly name: "devices"; - readonly type: "address[]"; - readonly internalType: "address[]"; - }]; - }]; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - }, { - readonly type: "function"; - readonly name: "createProduct"; - readonly inputs: readonly [{ - readonly name: "args"; - readonly type: "tuple"; - readonly internalType: "struct ProductFactory.CreateProductArgs"; - readonly components: readonly [{ - readonly name: "productImpl"; - readonly type: "address"; - readonly internalType: "address"; - }, { - readonly name: "name"; - readonly type: "string"; - readonly internalType: "string"; - }, { - readonly name: "symbol"; - readonly type: "string"; - readonly internalType: "string"; - }, { - readonly name: "baseTokenURI"; - readonly type: "string"; - readonly internalType: "string"; - }]; - }]; - readonly outputs: readonly [{ - readonly name: ""; - readonly type: "address"; - readonly internalType: "address"; - }]; - readonly stateMutability: "nonpayable"; - }, { - readonly type: "function"; - readonly name: "eip712Domain"; - readonly inputs: readonly []; - readonly outputs: readonly [{ - readonly name: "fields"; - readonly type: "bytes1"; - readonly internalType: "bytes1"; - }, { - readonly name: "name"; - readonly type: "string"; - readonly internalType: "string"; - }, { - readonly name: "version"; - readonly type: "string"; - readonly internalType: "string"; - }, { - readonly name: "chainId"; - readonly type: "uint256"; - readonly internalType: "uint256"; - }, { - readonly name: "verifyingContract"; - readonly type: "address"; - readonly internalType: "address"; - }, { - readonly name: "salt"; - readonly type: "bytes32"; - readonly internalType: "bytes32"; - }, { - readonly name: "extensions"; - readonly type: "uint256[]"; - readonly internalType: "uint256[]"; - }]; - readonly stateMutability: "view"; - }, { - readonly type: "function"; - readonly name: "getDeviceTokenId"; - readonly inputs: readonly [{ - readonly name: "product"; - readonly type: "address"; - readonly internalType: "address"; - }, { - readonly name: "device"; - readonly type: "address"; - readonly internalType: "address"; - }]; - readonly outputs: readonly [{ - readonly name: ""; - readonly type: "uint256"; - readonly internalType: "uint256"; - }]; - readonly stateMutability: "view"; - }, { - readonly type: "function"; - readonly name: "getDomainSeparator"; - readonly inputs: readonly []; - readonly outputs: readonly [{ - readonly name: ""; - readonly type: "bytes32"; - readonly internalType: "bytes32"; - }]; - readonly stateMutability: "view"; - }, { - readonly type: "function"; - readonly name: "getVendorByProduct"; - readonly inputs: readonly [{ - readonly name: "product"; - readonly type: "address"; - readonly internalType: "address"; - }]; - readonly outputs: readonly [{ - readonly name: ""; - readonly type: "address"; - readonly internalType: "address"; - }]; - readonly stateMutability: "view"; - }, { - readonly type: "function"; - readonly name: "owner"; - readonly inputs: readonly []; - readonly outputs: readonly [{ - readonly name: ""; - readonly type: "address"; - readonly internalType: "address"; - }]; - readonly stateMutability: "view"; - }, { - readonly type: "function"; - readonly name: "renounceOwnership"; - readonly inputs: readonly []; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - }, { - readonly type: "function"; - readonly name: "transferOwnership"; - readonly inputs: readonly [{ - readonly name: "newOwner"; - readonly type: "address"; - readonly internalType: "address"; - }]; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - }, { - readonly type: "event"; - readonly name: "DeviceActivated"; - readonly inputs: readonly [{ - readonly name: "product"; - readonly type: "address"; - readonly indexed: true; - readonly internalType: "address"; - }, { - readonly name: "device"; - readonly type: "address"; - readonly indexed: true; - readonly internalType: "address"; - }]; - readonly anonymous: false; - }, { - readonly type: "event"; - readonly name: "DeviceCreated"; - readonly inputs: readonly [{ - readonly name: "product"; - readonly type: "address"; - readonly indexed: true; - readonly internalType: "address"; - }, { - readonly name: "device"; - readonly type: "address"; - readonly indexed: true; - readonly internalType: "address"; - }, { - readonly name: "tokenId"; - readonly type: "uint256"; - readonly indexed: true; - readonly internalType: "uint256"; - }]; - readonly anonymous: false; - }, { - readonly type: "event"; - readonly name: "EIP712DomainChanged"; - readonly inputs: readonly []; - readonly anonymous: false; - }, { - readonly type: "event"; - readonly name: "OwnershipTransferred"; - readonly inputs: readonly [{ - readonly name: "previousOwner"; - readonly type: "address"; - readonly indexed: true; - readonly internalType: "address"; - }, { - readonly name: "newOwner"; - readonly type: "address"; - readonly indexed: true; - readonly internalType: "address"; - }]; - readonly anonymous: false; - }, { - readonly type: "event"; - readonly name: "ProductCreated"; - readonly inputs: readonly [{ - readonly name: "vendor"; - readonly type: "address"; - readonly indexed: true; - readonly internalType: "address"; - }, { - readonly name: "productImpl"; - readonly type: "address"; - readonly indexed: true; - readonly internalType: "address"; - }, { - readonly name: "product"; - readonly type: "address"; - readonly indexed: true; - readonly internalType: "address"; - }]; - readonly anonymous: false; - }, { - readonly type: "error"; - readonly name: "DeviceAlreadyCreated"; - readonly inputs: readonly []; - }, { - readonly type: "error"; - readonly name: "DeviceSignatureExpired"; - readonly inputs: readonly []; - }, { - readonly type: "error"; - readonly name: "DeviceSignatureMismatch"; - readonly inputs: readonly []; - }, { - readonly type: "error"; - readonly name: "ECDSAInvalidSignature"; - readonly inputs: readonly []; - }, { - readonly type: "error"; - readonly name: "ECDSAInvalidSignatureLength"; - readonly inputs: readonly [{ - readonly name: "length"; - readonly type: "uint256"; - readonly internalType: "uint256"; - }]; - }, { - readonly type: "error"; - readonly name: "ECDSAInvalidSignatureS"; - readonly inputs: readonly [{ - readonly name: "s"; - readonly type: "bytes32"; - readonly internalType: "bytes32"; - }]; - }, { - readonly type: "error"; - readonly name: "EIP712SignatureExpired"; - readonly inputs: readonly []; - }, { - readonly type: "error"; - readonly name: "EIP712SignatureMismatch"; - readonly inputs: readonly []; - }, { - readonly type: "error"; - readonly name: "ERC1167FailedCreateClone"; - readonly inputs: readonly []; - }, { - readonly type: "error"; - readonly name: "InvalidShortString"; - readonly inputs: readonly []; - }, { - readonly type: "error"; - readonly name: "NotProductTemplate"; - readonly inputs: readonly []; - }, { - readonly type: "error"; - readonly name: "NotVendor"; - readonly inputs: readonly []; - }, { - readonly type: "error"; - readonly name: "OwnableInvalidOwner"; - readonly inputs: readonly [{ - readonly name: "owner"; - readonly type: "address"; - readonly internalType: "address"; - }]; - }, { - readonly type: "error"; - readonly name: "OwnableUnauthorizedAccount"; - readonly inputs: readonly [{ - readonly name: "account"; - readonly type: "address"; - readonly internalType: "address"; - }]; - }, { - readonly type: "error"; - readonly name: "StringTooLong"; - readonly inputs: readonly [{ - readonly name: "str"; - readonly type: "string"; - readonly internalType: "string"; - }]; - }, { - readonly type: "error"; - readonly name: "TokenIdMismatch"; - readonly inputs: readonly []; - }]; - static createInterface(): ProductFactoryInterface; - static connect(address: string, signerOrProvider: Signer | Provider): ProductFactory; -} -export {}; diff --git a/tool/dist/typechain/factories/ProductFactory__factory.js b/tool/dist/typechain/factories/ProductFactory__factory.js deleted file mode 100644 index 428d54a..0000000 --- a/tool/dist/typechain/factories/ProductFactory__factory.js +++ /dev/null @@ -1,562 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { utils, Contract, ContractFactory } from "ethers"; -const _abi = [ - { - type: "constructor", - inputs: [ - { - name: "initialOwner", - type: "address", - internalType: "address", - }, - ], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "ACTIVATE_DEVICE_TYPEHASH", - inputs: [], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "activateDevice", - inputs: [ - { - name: "args", - type: "tuple", - internalType: "struct ProductFactory.ActivateDeviceArgs", - components: [ - { - name: "product", - type: "address", - internalType: "address", - }, - { - name: "device", - type: "address", - internalType: "address", - }, - { - name: "deviceSignature", - type: "bytes", - internalType: "bytes", - }, - { - name: "deviceDeadline", - type: "uint256", - internalType: "uint256", - }, - ], - }, - { - name: "signature", - type: "tuple", - internalType: "struct ProductFactory.EIP712Signature", - components: [ - { - name: "signer", - type: "address", - internalType: "address", - }, - { - name: "v", - type: "uint8", - internalType: "uint8", - }, - { - name: "r", - type: "bytes32", - internalType: "bytes32", - }, - { - name: "s", - type: "bytes32", - internalType: "bytes32", - }, - { - name: "deadline", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "createActivatedDevices", - inputs: [ - { - name: "args", - type: "tuple", - internalType: "struct ProductFactory.CreateActivatedDevicesArgs", - components: [ - { - name: "product", - type: "address", - internalType: "address", - }, - { - name: "devices", - type: "address[]", - internalType: "address[]", - }, - { - name: "receivers", - type: "address[]", - internalType: "address[]", - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "createDevices", - inputs: [ - { - name: "args", - type: "tuple", - internalType: "struct ProductFactory.CreateDevicesArgs", - components: [ - { - name: "product", - type: "address", - internalType: "address", - }, - { - name: "devices", - type: "address[]", - internalType: "address[]", - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "createProduct", - inputs: [ - { - name: "args", - type: "tuple", - internalType: "struct ProductFactory.CreateProductArgs", - components: [ - { - name: "productImpl", - type: "address", - internalType: "address", - }, - { - name: "name", - type: "string", - internalType: "string", - }, - { - name: "symbol", - type: "string", - internalType: "string", - }, - { - name: "baseTokenURI", - type: "string", - internalType: "string", - }, - ], - }, - ], - outputs: [ - { - name: "", - type: "address", - internalType: "address", - }, - ], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "eip712Domain", - inputs: [], - outputs: [ - { - name: "fields", - type: "bytes1", - internalType: "bytes1", - }, - { - name: "name", - type: "string", - internalType: "string", - }, - { - name: "version", - type: "string", - internalType: "string", - }, - { - name: "chainId", - type: "uint256", - internalType: "uint256", - }, - { - name: "verifyingContract", - type: "address", - internalType: "address", - }, - { - name: "salt", - type: "bytes32", - internalType: "bytes32", - }, - { - name: "extensions", - type: "uint256[]", - internalType: "uint256[]", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getDeviceTokenId", - inputs: [ - { - name: "product", - type: "address", - internalType: "address", - }, - { - name: "device", - type: "address", - internalType: "address", - }, - ], - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getDomainSeparator", - inputs: [], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getVendorByProduct", - inputs: [ - { - name: "product", - type: "address", - internalType: "address", - }, - ], - outputs: [ - { - name: "", - type: "address", - internalType: "address", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "owner", - inputs: [], - outputs: [ - { - name: "", - type: "address", - internalType: "address", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "renounceOwnership", - inputs: [], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "transferOwnership", - inputs: [ - { - name: "newOwner", - type: "address", - internalType: "address", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "event", - name: "DeviceActivated", - inputs: [ - { - name: "product", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "device", - type: "address", - indexed: true, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "DeviceCreated", - inputs: [ - { - name: "product", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "device", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "tokenId", - type: "uint256", - indexed: true, - internalType: "uint256", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "EIP712DomainChanged", - inputs: [], - anonymous: false, - }, - { - type: "event", - name: "OwnershipTransferred", - inputs: [ - { - name: "previousOwner", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "newOwner", - type: "address", - indexed: true, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "ProductCreated", - inputs: [ - { - name: "vendor", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "productImpl", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "product", - type: "address", - indexed: true, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "error", - name: "DeviceAlreadyCreated", - inputs: [], - }, - { - type: "error", - name: "DeviceSignatureExpired", - inputs: [], - }, - { - type: "error", - name: "DeviceSignatureMismatch", - inputs: [], - }, - { - type: "error", - name: "ECDSAInvalidSignature", - inputs: [], - }, - { - type: "error", - name: "ECDSAInvalidSignatureLength", - inputs: [ - { - name: "length", - type: "uint256", - internalType: "uint256", - }, - ], - }, - { - type: "error", - name: "ECDSAInvalidSignatureS", - inputs: [ - { - name: "s", - type: "bytes32", - internalType: "bytes32", - }, - ], - }, - { - type: "error", - name: "EIP712SignatureExpired", - inputs: [], - }, - { - type: "error", - name: "EIP712SignatureMismatch", - inputs: [], - }, - { - type: "error", - name: "ERC1167FailedCreateClone", - inputs: [], - }, - { - type: "error", - name: "InvalidShortString", - inputs: [], - }, - { - type: "error", - name: "NotProductTemplate", - inputs: [], - }, - { - type: "error", - name: "NotVendor", - inputs: [], - }, - { - type: "error", - name: "OwnableInvalidOwner", - inputs: [ - { - name: "owner", - type: "address", - internalType: "address", - }, - ], - }, - { - type: "error", - name: "OwnableUnauthorizedAccount", - inputs: [ - { - name: "account", - type: "address", - internalType: "address", - }, - ], - }, - { - type: "error", - name: "StringTooLong", - inputs: [ - { - name: "str", - type: "string", - internalType: "string", - }, - ], - }, - { - type: "error", - name: "TokenIdMismatch", - inputs: [], - }, -]; -const _bytecode = "0x61016060405234801561001157600080fd5b50604051611e2d380380611e2d8339810160408190526100309161021f565b604080518082018252600e81526d50726f64756374466163746f727960901b602080830191909152825180840190935260018352603160f81b9083015290826001600160a01b03811661009e57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6100a78161015e565b506100b38260016101ae565b610120526100c28160026101ae565b61014052815160208084019190912060e052815190820120610100524660a05261014f60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0525061041e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020835110156101ca576101c3836101e1565b90506101db565b816101d584826102ee565b5060ff90505b92915050565b600080829050601f8151111561020c578260405163305a27a960e01b815260040161009591906103ac565b8051610217826103fa565b179392505050565b60006020828403121561023157600080fd5b81516001600160a01b038116811461024857600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061027957607f821691505b60208210810361029957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156102e957806000526020600020601f840160051c810160208510156102c65750805b601f840160051c820191505b818110156102e657600081556001016102d2565b50505b505050565b81516001600160401b038111156103075761030761024f565b61031b816103158454610265565b8461029f565b6020601f82116001811461034f57600083156103375750848201515b600019600385901b1c1916600184901b1784556102e6565b600084815260208120601f198516915b8281101561037f578785015182556020948501946001909201910161035f565b508482101561039d5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b602081526000825180602084015260005b818110156103da57602081860181015160408684010152016103bd565b506000604082850101526040601f19601f83011684010191505092915050565b805160208083015191908110156102995760001960209190910360031b1b16919050565b60805160a05160c05160e0516101005161012051610140516119b56104786000396000610c8601526000610c5901526000610e8001526000610e5801526000610db301526000610ddd01526000610e0701526119b56000f3fe608060405234801561001057600080fd5b50600436106100b35760003560e01c80638da5cb5b116100715780638da5cb5b14610154578063904b55a514610165578063b063cb5414610191578063bb189de114610199578063ed24911d146101ac578063f2fde38b146101b457600080fd5b80622ca198146100b85780633a7eece8146100e85780634be60db3146100fd5780635d25e63214610110578063715018a61461013157806384b0196e14610139575b600080fd5b6100cb6100c636600461130f565b6101c7565b6040516001600160a01b0390911681526020015b60405180910390f35b6100fb6100f636600461146e565b610339565b005b6100fb61010b36600461150b565b61054f565b61012361011e3660046115b6565b6107f4565b6040519081526020016100df565b6100fb610821565b610141610835565b6040516100df979695949392919061162f565b6000546001600160a01b03166100cb565b6100cb6101733660046116c7565b6001600160a01b039081166000908152600360205260409020541690565b61012361087b565b6100fb6101a7366004611765565b61089e565b610123610b11565b6100fb6101c23660046116c7565b610b20565b80516040516301ffc9a760e01b815263360ff5e360e01b60048201526000916001600160a01b0316906301ffc9a790602401602060405180830381865afa158015610216573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023a919061181f565b61025757604051630fb9181b60e11b815260040160405180910390fd5b60006102668360000151610b63565b9050806001600160a01b0316635c6d8da1846020015185604001518660600151306040518563ffffffff1660e01b81526004016102a69493929190611841565b600060405180830381600087803b1580156102c057600080fd5b505af11580156102d4573d6000803e3d6000fd5b5050506001600160a01b0380831660008181526003602052604080822080546001600160a01b0319163390811790915588519151939550931692917f0d516d8b14b989f8763b7f1b93e8e08f0f5ff06e0b833b8d080f0f1f33f9f3029190a492915050565b80516001600160a01b0380821660009081526003602052604090205416331461037557604051630143454560e01b815260040160405180910390fd5b60005b82602001515181101561054a5782516001600160a01b031660009081526004602090815260408220908501518051839190859081106103b9576103b9611894565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020541115610401576040516353eadbf760e11b815260040160405180910390fd5b82516040516335313c2160e11b81523060048201526000916001600160a01b031690636a627842906024016020604051808303816000875af115801561044b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046f91906118aa565b9050806004600086600001516001600160a01b03166001600160a01b031681526020019081526020016000206000866020015185815181106104b3576104b3611894565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080846020015183815181106104f6576104f6611894565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a450600101610378565b505050565b80516001600160a01b0380821660009081526003602052604090205416331461058b57604051630143454560e01b815260040160405180910390fd5b60005b82602001515181101561054a5782516001600160a01b031660009081526004602090815260408220908501518051839190859081106105cf576105cf611894565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020541115610617576040516353eadbf760e11b815260040160405180910390fd5b600083600001516001600160a01b0316636a6278428560400151848151811061064257610642611894565b60200260200101516040518263ffffffff1660e01b815260040161067591906001600160a01b0391909116815260200190565b6020604051808303816000875af1158015610694573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b891906118aa565b9050806004600086600001516001600160a01b03166001600160a01b031681526020019081526020016000206000866020015185815181106106fc576106fc611894565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808460200151838151811061073f5761073f611894565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a4836040015182815181106107a0576107a0611894565b60200260200101516001600160a01b031684600001516001600160a01b03167ff297737e991455288ddb7481b53c270d8821275ddfdf4e82af900234f8e2925960405160405180910390a35060010161058e565b6001600160a01b038083166000908152600460209081526040808320938516835292905220545b92915050565b610829610bd5565b6108336000610c02565b565b600060608060008060006060610849610c52565b610851610c7f565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6040518060a00160405280606c8152602001611914606c91398051906020012081565b600061094361093d6040518060a00160405280606c8152602001611914606c913980516020918201208651878301516040808a015180519086012060608b015160808b015192516109229792939192019586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b60405160208183030381529060405280519060200120610cac565b83610cd9565b9050806001600160a01b031682600001516001600160a01b03161461097b5760405163680a7f5760e11b815260040160405180910390fd5b6000610a096109fa856060015160405160200161099a91815260200190565b60408051601f1981840301815282825280516020918201207f44455048595f49445f5349474e45445f4d4553534147453a000000000000000084830152603880850191909152825180850390910181526058909301909152815191012090565b85604001518660600151610d71565b9050806001600160a01b031684602001516001600160a01b031614610a4157604051639918f91160e01b815260040160405180910390fd5b83516001600160a01b039081166000818152600460208181526040808420828b015187168552909152918290205491516323b872dd60e01b8152309181019190915292851660248401526044830152906323b872dd90606401600060405180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b505050602085015185516040516001600160a01b0392831693509116907ff297737e991455288ddb7481b53c270d8821275ddfdf4e82af900234f8e2925990600090a350505050565b6000610b1b610da6565b905090565b610b28610bd5565b6001600160a01b038116610b5757604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b610b6081610c02565b50565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116610bd0576040516330be1a3d60e21b815260040160405180910390fd5b919050565b6000546001600160a01b031633146108335760405163118cdaa760e01b8152336004820152602401610b4e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060610b1b7f00000000000000000000000000000000000000000000000000000000000000006001610ed1565b6060610b1b7f00000000000000000000000000000000000000000000000000000000000000006002610ed1565b600061081b610cb9610da6565b8360405161190160f01b8152600281019290925260228201526042902090565b60004282608001511015610d005760405163f6d5e7cb60e01b815260040160405180910390fd5b602080830151604080850151606080870151835160008082529681018086528a905260ff90951693850193909352830152608082015260019060a0016020604051602081039080840390855afa158015610d5e573d6000803e3d6000fd5b5050604051601f19015195945050505050565b600042821015610d9457604051636932286960e11b815260040160405180910390fd5b610d9e8484610f7c565b949350505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610dff57507f000000000000000000000000000000000000000000000000000000000000000046145b15610e2957507f000000000000000000000000000000000000000000000000000000000000000090565b610b1b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b606060ff8314610eeb57610ee483610fa6565b905061081b565b818054610ef7906118c3565b80601f0160208091040260200160405190810160405280929190818152602001828054610f23906118c3565b8015610f705780601f10610f4557610100808354040283529160200191610f70565b820191906000526020600020905b815481529060010190602001808311610f5357829003601f168201915b5050505050905061081b565b600080600080610f8c8686610fe5565b925092509250610f9c8282611032565b5090949350505050565b60606000610fb3836110ef565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000806000835160410361101f5760208401516040850151606086015160001a61101188828585611117565b95509550955050505061102b565b50508151600091506002905b9250925092565b6000826003811115611046576110466118fd565b0361104f575050565b6001826003811115611063576110636118fd565b036110815760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115611095576110956118fd565b036110b65760405163fce698f760e01b815260048101829052602401610b4e565b60038260038111156110ca576110ca6118fd565b036110eb576040516335e2f38360e21b815260048101829052602401610b4e565b5050565b600060ff8216601f81111561081b57604051632cd44ac360e21b815260040160405180910390fd5b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561115257506000915060039050826111dc565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156111a6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166111d2575060009250600191508290506111dc565b9250600091508190505b9450945094915050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b038111828210171561121e5761121e6111e6565b60405290565b604051606081016001600160401b038111828210171561121e5761121e6111e6565b604051601f8201601f191681016001600160401b038111828210171561126e5761126e6111e6565b604052919050565b80356001600160a01b0381168114610bd057600080fd5b6000806001600160401b038411156112a7576112a76111e6565b50601f8301601f19166020016112bc81611246565b9150508281528383830111156112d157600080fd5b828260208301376000602084830101529392505050565b600082601f8301126112f957600080fd5b6113088383356020850161128d565b9392505050565b60006020828403121561132157600080fd5b81356001600160401b0381111561133757600080fd5b82016080818503121561134957600080fd5b6113516111fc565b61135a82611276565b815260208201356001600160401b0381111561137557600080fd5b611381868285016112e8565b60208301525060408201356001600160401b038111156113a057600080fd5b6113ac868285016112e8565b60408301525060608201356001600160401b038111156113cb57600080fd5b6113d7868285016112e8565b606083015250949350505050565b600082601f8301126113f657600080fd5b81356001600160401b0381111561140f5761140f6111e6565b8060051b61141f60208201611246565b9182526020818501810192908101908684111561143b57600080fd5b6020860192505b838310156114645761145383611276565b825260209283019290910190611442565b9695505050505050565b60006020828403121561148057600080fd5b81356001600160401b0381111561149657600080fd5b8201604081850312156114a857600080fd5b604080519081016001600160401b03811182821017156114ca576114ca6111e6565b6040526114d682611276565b815260208201356001600160401b038111156114f157600080fd5b6114fd868285016113e5565b602083015250949350505050565b60006020828403121561151d57600080fd5b81356001600160401b0381111561153357600080fd5b82016060818503121561154557600080fd5b61154d611224565b61155682611276565b815260208201356001600160401b0381111561157157600080fd5b61157d868285016113e5565b60208301525060408201356001600160401b0381111561159c57600080fd5b6115a8868285016113e5565b604083015250949350505050565b600080604083850312156115c957600080fd5b6115d283611276565b91506115e060208401611276565b90509250929050565b6000815180845260005b8181101561160f576020818501810151868301820152016115f3565b506000602082860101526020601f19601f83011685010191505092915050565b60ff60f81b8816815260e06020820152600061164e60e08301896115e9565b828103604084015261166081896115e9565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b818110156116b6578351835260209384019390920191600101611698565b50909b9a5050505050505050505050565b6000602082840312156116d957600080fd5b61130882611276565b600060a082840312156116f457600080fd5b60405160a081016001600160401b0381118282101715611716576117166111e6565b60405290508061172583611276565b8152602083013560ff8116811461173b57600080fd5b60208201526040838101359082015260608084013590820152608092830135920191909152919050565b60008060c0838503121561177857600080fd5b82356001600160401b0381111561178e57600080fd5b8301608081860312156117a057600080fd5b6117a86111fc565b6117b182611276565b81526117bf60208301611276565b602082015260408201356001600160401b038111156117dd57600080fd5b8201601f810187136117ee57600080fd5b6117fd8782356020840161128d565b6040830152506060918201359181019190915291506115e084602085016116e2565b60006020828403121561183157600080fd5b8151801515811461130857600080fd5b60808152600061185460808301876115e9565b828103602084015261186681876115e9565b9050828103604084015261187a81866115e9565b91505060018060a01b038316606083015295945050505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156118bc57600080fd5b5051919050565b600181811c908216806118d757607f821691505b6020821081036118f757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052602160045260246000fdfe416374697661746544657669636528616464726573732070726f647563742c61646472657373206465766963652c6279746573206465766963655369676e61747572652c75696e7432353620646576696365446561646c696e652c75696e7432353620646561646c696e6529a26469706673582212205aae321411c9f4bb762f3838fd491f112fc34ff33add75c3b487b884160409fb64736f6c634300081a0033"; -const isSuperArgs = (xs) => xs.length > 1; -class ProductFactory__factory extends ContractFactory { - constructor(...args) { - if (isSuperArgs(args)) { - super(...args); - } - else { - super(_abi, _bytecode, args[0]); - } - } - deploy(initialOwner, overrides) { - return super.deploy(initialOwner, overrides || {}); - } - getDeployTransaction(initialOwner, overrides) { - return super.getDeployTransaction(initialOwner, overrides || {}); - } - attach(address) { - return super.attach(address); - } - connect(signer) { - return super.connect(signer); - } - static createInterface() { - return new utils.Interface(_abi); - } - static connect(address, signerOrProvider) { - return new Contract(address, _abi, signerOrProvider); - } -} -ProductFactory__factory.bytecode = _bytecode; -ProductFactory__factory.abi = _abi; -export { ProductFactory__factory }; diff --git a/tool/dist/typechain/factories/index.d.ts b/tool/dist/typechain/factories/index.d.ts deleted file mode 100644 index 9f4a598..0000000 --- a/tool/dist/typechain/factories/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { ProductFactory__factory } from "./ProductFactory__factory"; diff --git a/tool/package.json b/tool/package.json index c151bce..7b12268 100644 --- a/tool/package.json +++ b/tool/package.json @@ -3,7 +3,7 @@ "module": "src/index.ts", "type": "module", "scripts": { - "typechain": "rimraf src/typechain/* && typechain --target ethers-v5 --out-dir src/typechain/ './src/abi/**/*.json'", + "typechain": "rimraf src/generated/* && typechain --target ethers-v5 --out-dir src/generated/ '../out/ProductFactory.sol/ProductFactory.json' '../out/IProductFactory.sol/IProductFactory.json'", "build": "rimraf dist/* && tsc -p tsconfig.json", "demo": "cd demo && npx vite" }, diff --git a/tool/src/ProductFactory.ts b/tool/src/ProductFactory.ts index ff98de9..98836ca 100644 --- a/tool/src/ProductFactory.ts +++ b/tool/src/ProductFactory.ts @@ -1,7 +1,7 @@ import { - ProductFactory as ProductFactoryRaw, + IProductFactory, ProductFactory__factory, -} from "./typechain"; +} from "./generated"; import { ContractTransaction, Signer, Wallet, ethers } from "ethers"; import { ChainId } from "./types"; import { oneDayLater, oneHourLater } from "./utils/timestamp"; @@ -39,7 +39,7 @@ export class ProductFactory { }, onPending?: (tx: ContractTransaction) => void ) { - const args: ProductFactoryRaw.CreateProductArgsStruct = { + const args: IProductFactory.CreateProductArgsStruct = { productImpl, name, symbol, @@ -74,7 +74,7 @@ export class ProductFactory { if (vendor !== (await this.signer.getAddress())) { throw new Error("Signer not product vendor"); } - const args: ProductFactoryRaw.CreateDevicesArgsStruct = { + const args: IProductFactory.CreateDevicesArgsStruct = { product, devices, }; @@ -101,7 +101,7 @@ export class ProductFactory { if (vendor !== (await this.signer.getAddress())) { throw new Error("Signer not product vendor"); } - const args: ProductFactoryRaw.CreateActivatedDevicesArgsStruct = { + const args: IProductFactory.CreateActivatedDevicesArgsStruct = { product, devices, receivers, @@ -127,7 +127,7 @@ export class ProductFactory { const deviceSignedParams = await this._generateDeviceSignature( deviceWallet ); - const activateDeviceArgs: ProductFactoryRaw.ActivateDeviceArgsStruct = { + const activateDeviceArgs: IProductFactory.ActivateDeviceArgsStruct = { product, device: deviceWallet.address, ...deviceSignedParams, @@ -190,7 +190,7 @@ export class ProductFactory { activateDeviceArgs, }: { wallet: Wallet; - activateDeviceArgs: ProductFactoryRaw.ActivateDeviceArgsStruct; + activateDeviceArgs: IProductFactory.ActivateDeviceArgsStruct; }) { const { name, version } = await this.instance.eip712Domain(); const deadline = oneDayLater(); @@ -228,7 +228,7 @@ export class ProductFactory { ) ); - const sig: ProductFactoryRaw.EIP712SignatureStruct = { + const sig: IProductFactory.EIP712SignatureStruct = { signer: await wallet.getAddress(), v, r, diff --git a/tool/src/abi/ProductFactory.json b/tool/src/abi/ProductFactory.json deleted file mode 100644 index a628e89..0000000 --- a/tool/src/abi/ProductFactory.json +++ /dev/null @@ -1 +0,0 @@ -{"abi":[{"type":"constructor","inputs":[{"name":"initialOwner","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"function","name":"ACTIVATE_DEVICE_TYPEHASH","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"activateDevice","inputs":[{"name":"args","type":"tuple","internalType":"struct ProductFactory.ActivateDeviceArgs","components":[{"name":"product","type":"address","internalType":"address"},{"name":"device","type":"address","internalType":"address"},{"name":"deviceSignature","type":"bytes","internalType":"bytes"},{"name":"deviceDeadline","type":"uint256","internalType":"uint256"}]},{"name":"signature","type":"tuple","internalType":"struct ProductFactory.EIP712Signature","components":[{"name":"signer","type":"address","internalType":"address"},{"name":"v","type":"uint8","internalType":"uint8"},{"name":"r","type":"bytes32","internalType":"bytes32"},{"name":"s","type":"bytes32","internalType":"bytes32"},{"name":"deadline","type":"uint256","internalType":"uint256"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"createActivatedDevices","inputs":[{"name":"args","type":"tuple","internalType":"struct ProductFactory.CreateActivatedDevicesArgs","components":[{"name":"product","type":"address","internalType":"address"},{"name":"devices","type":"address[]","internalType":"address[]"},{"name":"receivers","type":"address[]","internalType":"address[]"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"createDevices","inputs":[{"name":"args","type":"tuple","internalType":"struct ProductFactory.CreateDevicesArgs","components":[{"name":"product","type":"address","internalType":"address"},{"name":"devices","type":"address[]","internalType":"address[]"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"createProduct","inputs":[{"name":"args","type":"tuple","internalType":"struct ProductFactory.CreateProductArgs","components":[{"name":"productImpl","type":"address","internalType":"address"},{"name":"name","type":"string","internalType":"string"},{"name":"symbol","type":"string","internalType":"string"},{"name":"baseTokenURI","type":"string","internalType":"string"}]}],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"function","name":"eip712Domain","inputs":[],"outputs":[{"name":"fields","type":"bytes1","internalType":"bytes1"},{"name":"name","type":"string","internalType":"string"},{"name":"version","type":"string","internalType":"string"},{"name":"chainId","type":"uint256","internalType":"uint256"},{"name":"verifyingContract","type":"address","internalType":"address"},{"name":"salt","type":"bytes32","internalType":"bytes32"},{"name":"extensions","type":"uint256[]","internalType":"uint256[]"}],"stateMutability":"view"},{"type":"function","name":"getDeviceTokenId","inputs":[{"name":"product","type":"address","internalType":"address"},{"name":"device","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"getDomainSeparator","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"getVendorByProduct","inputs":[{"name":"product","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"renounceOwnership","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"transferOwnership","inputs":[{"name":"newOwner","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"DeviceActivated","inputs":[{"name":"product","type":"address","indexed":true,"internalType":"address"},{"name":"device","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"DeviceCreated","inputs":[{"name":"product","type":"address","indexed":true,"internalType":"address"},{"name":"device","type":"address","indexed":true,"internalType":"address"},{"name":"tokenId","type":"uint256","indexed":true,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"EIP712DomainChanged","inputs":[],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"name":"previousOwner","type":"address","indexed":true,"internalType":"address"},{"name":"newOwner","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"ProductCreated","inputs":[{"name":"vendor","type":"address","indexed":true,"internalType":"address"},{"name":"productImpl","type":"address","indexed":true,"internalType":"address"},{"name":"product","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"error","name":"DeviceAlreadyCreated","inputs":[]},{"type":"error","name":"DeviceSignatureExpired","inputs":[]},{"type":"error","name":"DeviceSignatureMismatch","inputs":[]},{"type":"error","name":"ECDSAInvalidSignature","inputs":[]},{"type":"error","name":"ECDSAInvalidSignatureLength","inputs":[{"name":"length","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"ECDSAInvalidSignatureS","inputs":[{"name":"s","type":"bytes32","internalType":"bytes32"}]},{"type":"error","name":"EIP712SignatureExpired","inputs":[]},{"type":"error","name":"EIP712SignatureMismatch","inputs":[]},{"type":"error","name":"ERC1167FailedCreateClone","inputs":[]},{"type":"error","name":"InvalidShortString","inputs":[]},{"type":"error","name":"NotProductTemplate","inputs":[]},{"type":"error","name":"NotVendor","inputs":[]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"name":"owner","type":"address","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"name":"account","type":"address","internalType":"address"}]},{"type":"error","name":"StringTooLong","inputs":[{"name":"str","type":"string","internalType":"string"}]},{"type":"error","name":"TokenIdMismatch","inputs":[]}],"bytecode":{"object":"0x61016060405234801561001157600080fd5b50604051611e2d380380611e2d8339810160408190526100309161021f565b604080518082018252600e81526d50726f64756374466163746f727960901b602080830191909152825180840190935260018352603160f81b9083015290826001600160a01b03811661009e57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6100a78161015e565b506100b38260016101ae565b610120526100c28160026101ae565b61014052815160208084019190912060e052815190820120610100524660a05261014f60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0525061041e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020835110156101ca576101c3836101e1565b90506101db565b816101d584826102ee565b5060ff90505b92915050565b600080829050601f8151111561020c578260405163305a27a960e01b815260040161009591906103ac565b8051610217826103fa565b179392505050565b60006020828403121561023157600080fd5b81516001600160a01b038116811461024857600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061027957607f821691505b60208210810361029957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156102e957806000526020600020601f840160051c810160208510156102c65750805b601f840160051c820191505b818110156102e657600081556001016102d2565b50505b505050565b81516001600160401b038111156103075761030761024f565b61031b816103158454610265565b8461029f565b6020601f82116001811461034f57600083156103375750848201515b600019600385901b1c1916600184901b1784556102e6565b600084815260208120601f198516915b8281101561037f578785015182556020948501946001909201910161035f565b508482101561039d5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b602081526000825180602084015260005b818110156103da57602081860181015160408684010152016103bd565b506000604082850101526040601f19601f83011684010191505092915050565b805160208083015191908110156102995760001960209190910360031b1b16919050565b60805160a05160c05160e0516101005161012051610140516119b56104786000396000610c8601526000610c5901526000610e8001526000610e5801526000610db301526000610ddd01526000610e0701526119b56000f3fe608060405234801561001057600080fd5b50600436106100b35760003560e01c80638da5cb5b116100715780638da5cb5b14610154578063904b55a514610165578063b063cb5414610191578063bb189de114610199578063ed24911d146101ac578063f2fde38b146101b457600080fd5b80622ca198146100b85780633a7eece8146100e85780634be60db3146100fd5780635d25e63214610110578063715018a61461013157806384b0196e14610139575b600080fd5b6100cb6100c636600461130f565b6101c7565b6040516001600160a01b0390911681526020015b60405180910390f35b6100fb6100f636600461146e565b610339565b005b6100fb61010b36600461150b565b61054f565b61012361011e3660046115b6565b6107f4565b6040519081526020016100df565b6100fb610821565b610141610835565b6040516100df979695949392919061162f565b6000546001600160a01b03166100cb565b6100cb6101733660046116c7565b6001600160a01b039081166000908152600360205260409020541690565b61012361087b565b6100fb6101a7366004611765565b61089e565b610123610b11565b6100fb6101c23660046116c7565b610b20565b80516040516301ffc9a760e01b815263360ff5e360e01b60048201526000916001600160a01b0316906301ffc9a790602401602060405180830381865afa158015610216573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023a919061181f565b61025757604051630fb9181b60e11b815260040160405180910390fd5b60006102668360000151610b63565b9050806001600160a01b0316635c6d8da1846020015185604001518660600151306040518563ffffffff1660e01b81526004016102a69493929190611841565b600060405180830381600087803b1580156102c057600080fd5b505af11580156102d4573d6000803e3d6000fd5b5050506001600160a01b0380831660008181526003602052604080822080546001600160a01b0319163390811790915588519151939550931692917f0d516d8b14b989f8763b7f1b93e8e08f0f5ff06e0b833b8d080f0f1f33f9f3029190a492915050565b80516001600160a01b0380821660009081526003602052604090205416331461037557604051630143454560e01b815260040160405180910390fd5b60005b82602001515181101561054a5782516001600160a01b031660009081526004602090815260408220908501518051839190859081106103b9576103b9611894565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020541115610401576040516353eadbf760e11b815260040160405180910390fd5b82516040516335313c2160e11b81523060048201526000916001600160a01b031690636a627842906024016020604051808303816000875af115801561044b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046f91906118aa565b9050806004600086600001516001600160a01b03166001600160a01b031681526020019081526020016000206000866020015185815181106104b3576104b3611894565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080846020015183815181106104f6576104f6611894565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a450600101610378565b505050565b80516001600160a01b0380821660009081526003602052604090205416331461058b57604051630143454560e01b815260040160405180910390fd5b60005b82602001515181101561054a5782516001600160a01b031660009081526004602090815260408220908501518051839190859081106105cf576105cf611894565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020541115610617576040516353eadbf760e11b815260040160405180910390fd5b600083600001516001600160a01b0316636a6278428560400151848151811061064257610642611894565b60200260200101516040518263ffffffff1660e01b815260040161067591906001600160a01b0391909116815260200190565b6020604051808303816000875af1158015610694573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b891906118aa565b9050806004600086600001516001600160a01b03166001600160a01b031681526020019081526020016000206000866020015185815181106106fc576106fc611894565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808460200151838151811061073f5761073f611894565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a4836040015182815181106107a0576107a0611894565b60200260200101516001600160a01b031684600001516001600160a01b03167ff297737e991455288ddb7481b53c270d8821275ddfdf4e82af900234f8e2925960405160405180910390a35060010161058e565b6001600160a01b038083166000908152600460209081526040808320938516835292905220545b92915050565b610829610bd5565b6108336000610c02565b565b600060608060008060006060610849610c52565b610851610c7f565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6040518060a00160405280606c8152602001611914606c91398051906020012081565b600061094361093d6040518060a00160405280606c8152602001611914606c913980516020918201208651878301516040808a015180519086012060608b015160808b015192516109229792939192019586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b60405160208183030381529060405280519060200120610cac565b83610cd9565b9050806001600160a01b031682600001516001600160a01b03161461097b5760405163680a7f5760e11b815260040160405180910390fd5b6000610a096109fa856060015160405160200161099a91815260200190565b60408051601f1981840301815282825280516020918201207f44455048595f49445f5349474e45445f4d4553534147453a000000000000000084830152603880850191909152825180850390910181526058909301909152815191012090565b85604001518660600151610d71565b9050806001600160a01b031684602001516001600160a01b031614610a4157604051639918f91160e01b815260040160405180910390fd5b83516001600160a01b039081166000818152600460208181526040808420828b015187168552909152918290205491516323b872dd60e01b8152309181019190915292851660248401526044830152906323b872dd90606401600060405180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b505050602085015185516040516001600160a01b0392831693509116907ff297737e991455288ddb7481b53c270d8821275ddfdf4e82af900234f8e2925990600090a350505050565b6000610b1b610da6565b905090565b610b28610bd5565b6001600160a01b038116610b5757604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b610b6081610c02565b50565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116610bd0576040516330be1a3d60e21b815260040160405180910390fd5b919050565b6000546001600160a01b031633146108335760405163118cdaa760e01b8152336004820152602401610b4e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060610b1b7f00000000000000000000000000000000000000000000000000000000000000006001610ed1565b6060610b1b7f00000000000000000000000000000000000000000000000000000000000000006002610ed1565b600061081b610cb9610da6565b8360405161190160f01b8152600281019290925260228201526042902090565b60004282608001511015610d005760405163f6d5e7cb60e01b815260040160405180910390fd5b602080830151604080850151606080870151835160008082529681018086528a905260ff90951693850193909352830152608082015260019060a0016020604051602081039080840390855afa158015610d5e573d6000803e3d6000fd5b5050604051601f19015195945050505050565b600042821015610d9457604051636932286960e11b815260040160405180910390fd5b610d9e8484610f7c565b949350505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610dff57507f000000000000000000000000000000000000000000000000000000000000000046145b15610e2957507f000000000000000000000000000000000000000000000000000000000000000090565b610b1b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b606060ff8314610eeb57610ee483610fa6565b905061081b565b818054610ef7906118c3565b80601f0160208091040260200160405190810160405280929190818152602001828054610f23906118c3565b8015610f705780601f10610f4557610100808354040283529160200191610f70565b820191906000526020600020905b815481529060010190602001808311610f5357829003601f168201915b5050505050905061081b565b600080600080610f8c8686610fe5565b925092509250610f9c8282611032565b5090949350505050565b60606000610fb3836110ef565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000806000835160410361101f5760208401516040850151606086015160001a61101188828585611117565b95509550955050505061102b565b50508151600091506002905b9250925092565b6000826003811115611046576110466118fd565b0361104f575050565b6001826003811115611063576110636118fd565b036110815760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115611095576110956118fd565b036110b65760405163fce698f760e01b815260048101829052602401610b4e565b60038260038111156110ca576110ca6118fd565b036110eb576040516335e2f38360e21b815260048101829052602401610b4e565b5050565b600060ff8216601f81111561081b57604051632cd44ac360e21b815260040160405180910390fd5b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561115257506000915060039050826111dc565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156111a6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166111d2575060009250600191508290506111dc565b9250600091508190505b9450945094915050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b038111828210171561121e5761121e6111e6565b60405290565b604051606081016001600160401b038111828210171561121e5761121e6111e6565b604051601f8201601f191681016001600160401b038111828210171561126e5761126e6111e6565b604052919050565b80356001600160a01b0381168114610bd057600080fd5b6000806001600160401b038411156112a7576112a76111e6565b50601f8301601f19166020016112bc81611246565b9150508281528383830111156112d157600080fd5b828260208301376000602084830101529392505050565b600082601f8301126112f957600080fd5b6113088383356020850161128d565b9392505050565b60006020828403121561132157600080fd5b81356001600160401b0381111561133757600080fd5b82016080818503121561134957600080fd5b6113516111fc565b61135a82611276565b815260208201356001600160401b0381111561137557600080fd5b611381868285016112e8565b60208301525060408201356001600160401b038111156113a057600080fd5b6113ac868285016112e8565b60408301525060608201356001600160401b038111156113cb57600080fd5b6113d7868285016112e8565b606083015250949350505050565b600082601f8301126113f657600080fd5b81356001600160401b0381111561140f5761140f6111e6565b8060051b61141f60208201611246565b9182526020818501810192908101908684111561143b57600080fd5b6020860192505b838310156114645761145383611276565b825260209283019290910190611442565b9695505050505050565b60006020828403121561148057600080fd5b81356001600160401b0381111561149657600080fd5b8201604081850312156114a857600080fd5b604080519081016001600160401b03811182821017156114ca576114ca6111e6565b6040526114d682611276565b815260208201356001600160401b038111156114f157600080fd5b6114fd868285016113e5565b602083015250949350505050565b60006020828403121561151d57600080fd5b81356001600160401b0381111561153357600080fd5b82016060818503121561154557600080fd5b61154d611224565b61155682611276565b815260208201356001600160401b0381111561157157600080fd5b61157d868285016113e5565b60208301525060408201356001600160401b0381111561159c57600080fd5b6115a8868285016113e5565b604083015250949350505050565b600080604083850312156115c957600080fd5b6115d283611276565b91506115e060208401611276565b90509250929050565b6000815180845260005b8181101561160f576020818501810151868301820152016115f3565b506000602082860101526020601f19601f83011685010191505092915050565b60ff60f81b8816815260e06020820152600061164e60e08301896115e9565b828103604084015261166081896115e9565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b818110156116b6578351835260209384019390920191600101611698565b50909b9a5050505050505050505050565b6000602082840312156116d957600080fd5b61130882611276565b600060a082840312156116f457600080fd5b60405160a081016001600160401b0381118282101715611716576117166111e6565b60405290508061172583611276565b8152602083013560ff8116811461173b57600080fd5b60208201526040838101359082015260608084013590820152608092830135920191909152919050565b60008060c0838503121561177857600080fd5b82356001600160401b0381111561178e57600080fd5b8301608081860312156117a057600080fd5b6117a86111fc565b6117b182611276565b81526117bf60208301611276565b602082015260408201356001600160401b038111156117dd57600080fd5b8201601f810187136117ee57600080fd5b6117fd8782356020840161128d565b6040830152506060918201359181019190915291506115e084602085016116e2565b60006020828403121561183157600080fd5b8151801515811461130857600080fd5b60808152600061185460808301876115e9565b828103602084015261186681876115e9565b9050828103604084015261187a81866115e9565b91505060018060a01b038316606083015295945050505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156118bc57600080fd5b5051919050565b600181811c908216806118d757607f821691505b6020821081036118f757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052602160045260246000fdfe416374697661746544657669636528616464726573732070726f647563742c61646472657373206465766963652c6279746573206465766963655369676e61747572652c75696e7432353620646576696365446561646c696e652c75696e7432353620646561646c696e6529a26469706673582212205aae321411c9f4bb762f3838fd491f112fc34ff33add75c3b487b884160409fb64736f6c634300081a0033","sourceMap":"387:6486:2:-:0;;;2089:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3328:431:15;;;;;;;;;;;-1:-1:-1;;;3328:431:15;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;3328:431:15;;;;;2175:12:2;-1:-1:-1;;;;;1273:26:3;;1269:95;;1322:31;;-1:-1:-1;;;1322:31:3;;1350:1;1322:31;;;455:51:48;428:18;;1322:31:3;;;;;;;;1269:95;1373:32;1392:12;1373:18;:32::i;:::-;-1:-1:-1;3401:45:15;:4;3432:13;3401:30;:45::i;:::-;3393:53;;3467:51;:7;3501:16;3467:33;:51::i;:::-;3456:62;;3542:22;;;;;;;;;;3528:36;;3591:25;;;;;;3574:42;;3644:13;3627:30;;3692:23;4226:11;;4239:14;;4204:80;;;2079:95;4204:80;;;3417:25:48;3458:18;;;3451:34;;;;3501:18;;;3494:34;4255:13:15;3544:18:48;;;3537:34;4278:4:15;3587:19:48;;;3580:61;4168:7:15;;3389:19:48;;4204:80:15;;;;;;;;;;;;4194:91;;;;;;4187:98;;4113:179;;3692:23;3667:48;;-1:-1:-1;;3747:4:15;3725:27;;-1:-1:-1;387:6486:2;;2912:187:3;2985:16;3004:6;;-1:-1:-1;;;;;3020:17:3;;;-1:-1:-1;;;;;;3020:17:3;;;;;;3052:40;;3004:6;;;;;;;3052:40;;2985:16;3052:40;2975:124;2912:187;:::o;2914:340:11:-;3010:11;3059:2;3043:5;3037:19;:24;3033:215;;;3084:20;3098:5;3084:13;:20::i;:::-;3077:27;;;;3033:215;3161:5;3135:46;3176:5;3161;3135:46;:::i;:::-;-1:-1:-1;1390:66:11;;-1:-1:-1;3033:215:11;2914:340;;;;:::o;1708:286::-;1773:11;1796:17;1822:3;1796:30;;1854:2;1840:4;:11;:16;1836:72;;;1893:3;1879:18;;-1:-1:-1;;;1879:18:11;;;;;;;;:::i;1836:72::-;1974:11;;1957:13;1974:4;1957:13;:::i;:::-;1949:36;;1708:286;-1:-1:-1;;;1708:286:11:o;14:290:48:-;84:6;137:2;125:9;116:7;112:23;108:32;105:52;;;153:1;150;143:12;105:52;179:16;;-1:-1:-1;;;;;224:31:48;;214:42;;204:70;;270:1;267;260:12;204:70;293:5;14:290;-1:-1:-1;;;14:290:48:o;517:127::-;578:10;573:3;569:20;566:1;559:31;609:4;606:1;599:15;633:4;630:1;623:15;649:380;728:1;724:12;;;;771;;;792:61;;846:4;838:6;834:17;824:27;;792:61;899:2;891:6;888:14;868:18;865:38;862:161;;945:10;940:3;936:20;933:1;926:31;980:4;977:1;970:15;1008:4;1005:1;998:15;862:161;;649:380;;;:::o;1160:518::-;1262:2;1257:3;1254:11;1251:421;;;1298:5;1295:1;1288:16;1342:4;1339:1;1329:18;1412:2;1400:10;1396:19;1393:1;1389:27;1383:4;1379:38;1448:4;1436:10;1433:20;1430:47;;;-1:-1:-1;1471:4:48;1430:47;1526:2;1521:3;1517:12;1514:1;1510:20;1504:4;1500:31;1490:41;;1581:81;1599:2;1592:5;1589:13;1581:81;;;1658:1;1644:16;;1625:1;1614:13;1581:81;;;1585:3;;1251:421;1160:518;;;:::o;1854:1299::-;1974:10;;-1:-1:-1;;;;;1996:30:48;;1993:56;;;2029:18;;:::i;:::-;2058:97;2148:6;2108:38;2140:4;2134:11;2108:38;:::i;:::-;2102:4;2058:97;:::i;:::-;2204:4;2235:2;2224:14;;2252:1;2247:649;;;;2940:1;2957:6;2954:89;;;-1:-1:-1;3009:19:48;;;3003:26;2954:89;-1:-1:-1;;1811:1:48;1807:11;;;1803:24;1799:29;1789:40;1835:1;1831:11;;;1786:57;3056:81;;2217:930;;2247:649;1107:1;1100:14;;;1144:4;1131:18;;-1:-1:-1;;2283:20:48;;;2401:222;2415:7;2412:1;2409:14;2401:222;;;2497:19;;;2491:26;2476:42;;2604:4;2589:20;;;;2557:1;2545:14;;;;2431:12;2401:222;;;2405:3;2651:6;2642:7;2639:19;2636:201;;;2712:19;;;2706:26;-1:-1:-1;;2795:1:48;2791:14;;;2807:3;2787:24;2783:37;2779:42;2764:58;2749:74;;2636:201;-1:-1:-1;;;;2883:1:48;2867:14;;;2863:22;2850:36;;-1:-1:-1;1854:1299:48:o;3652:527::-;3801:2;3790:9;3783:21;3764:4;3833:6;3827:13;3876:6;3871:2;3860:9;3856:18;3849:34;3901:1;3911:140;3925:6;3922:1;3919:13;3911:140;;;4036:2;4020:14;;;4016:23;;4010:30;4005:2;3986:17;;;3982:26;3975:66;3940:10;3911:140;;;3915:3;4100:1;4095:2;4086:6;4075:9;4071:22;4067:31;4060:42;4170:2;4163;4159:7;4154:2;4146:6;4142:15;4138:29;4127:9;4123:45;4119:54;4111:62;;;3652:527;;;;:::o;4184:297::-;4302:12;;4349:4;4338:16;;;4332:23;;4302:12;4367:16;;4364:111;;;-1:-1:-1;;4441:4:48;4437:17;;;;4434:1;4430:25;4426:38;4415:50;;4184:297;-1:-1:-1;4184:297:48:o;:::-;387:6486:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","linkReferences":{}},"deployedBytecode":{"object":"0x608060405234801561001057600080fd5b50600436106100b35760003560e01c80638da5cb5b116100715780638da5cb5b14610154578063904b55a514610165578063b063cb5414610191578063bb189de114610199578063ed24911d146101ac578063f2fde38b146101b457600080fd5b80622ca198146100b85780633a7eece8146100e85780634be60db3146100fd5780635d25e63214610110578063715018a61461013157806384b0196e14610139575b600080fd5b6100cb6100c636600461130f565b6101c7565b6040516001600160a01b0390911681526020015b60405180910390f35b6100fb6100f636600461146e565b610339565b005b6100fb61010b36600461150b565b61054f565b61012361011e3660046115b6565b6107f4565b6040519081526020016100df565b6100fb610821565b610141610835565b6040516100df979695949392919061162f565b6000546001600160a01b03166100cb565b6100cb6101733660046116c7565b6001600160a01b039081166000908152600360205260409020541690565b61012361087b565b6100fb6101a7366004611765565b61089e565b610123610b11565b6100fb6101c23660046116c7565b610b20565b80516040516301ffc9a760e01b815263360ff5e360e01b60048201526000916001600160a01b0316906301ffc9a790602401602060405180830381865afa158015610216573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023a919061181f565b61025757604051630fb9181b60e11b815260040160405180910390fd5b60006102668360000151610b63565b9050806001600160a01b0316635c6d8da1846020015185604001518660600151306040518563ffffffff1660e01b81526004016102a69493929190611841565b600060405180830381600087803b1580156102c057600080fd5b505af11580156102d4573d6000803e3d6000fd5b5050506001600160a01b0380831660008181526003602052604080822080546001600160a01b0319163390811790915588519151939550931692917f0d516d8b14b989f8763b7f1b93e8e08f0f5ff06e0b833b8d080f0f1f33f9f3029190a492915050565b80516001600160a01b0380821660009081526003602052604090205416331461037557604051630143454560e01b815260040160405180910390fd5b60005b82602001515181101561054a5782516001600160a01b031660009081526004602090815260408220908501518051839190859081106103b9576103b9611894565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020541115610401576040516353eadbf760e11b815260040160405180910390fd5b82516040516335313c2160e11b81523060048201526000916001600160a01b031690636a627842906024016020604051808303816000875af115801561044b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046f91906118aa565b9050806004600086600001516001600160a01b03166001600160a01b031681526020019081526020016000206000866020015185815181106104b3576104b3611894565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080846020015183815181106104f6576104f6611894565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a450600101610378565b505050565b80516001600160a01b0380821660009081526003602052604090205416331461058b57604051630143454560e01b815260040160405180910390fd5b60005b82602001515181101561054a5782516001600160a01b031660009081526004602090815260408220908501518051839190859081106105cf576105cf611894565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020541115610617576040516353eadbf760e11b815260040160405180910390fd5b600083600001516001600160a01b0316636a6278428560400151848151811061064257610642611894565b60200260200101516040518263ffffffff1660e01b815260040161067591906001600160a01b0391909116815260200190565b6020604051808303816000875af1158015610694573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b891906118aa565b9050806004600086600001516001600160a01b03166001600160a01b031681526020019081526020016000206000866020015185815181106106fc576106fc611894565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808460200151838151811061073f5761073f611894565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a4836040015182815181106107a0576107a0611894565b60200260200101516001600160a01b031684600001516001600160a01b03167ff297737e991455288ddb7481b53c270d8821275ddfdf4e82af900234f8e2925960405160405180910390a35060010161058e565b6001600160a01b038083166000908152600460209081526040808320938516835292905220545b92915050565b610829610bd5565b6108336000610c02565b565b600060608060008060006060610849610c52565b610851610c7f565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6040518060a00160405280606c8152602001611914606c91398051906020012081565b600061094361093d6040518060a00160405280606c8152602001611914606c913980516020918201208651878301516040808a015180519086012060608b015160808b015192516109229792939192019586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b60405160208183030381529060405280519060200120610cac565b83610cd9565b9050806001600160a01b031682600001516001600160a01b03161461097b5760405163680a7f5760e11b815260040160405180910390fd5b6000610a096109fa856060015160405160200161099a91815260200190565b60408051601f1981840301815282825280516020918201207f44455048595f49445f5349474e45445f4d4553534147453a000000000000000084830152603880850191909152825180850390910181526058909301909152815191012090565b85604001518660600151610d71565b9050806001600160a01b031684602001516001600160a01b031614610a4157604051639918f91160e01b815260040160405180910390fd5b83516001600160a01b039081166000818152600460208181526040808420828b015187168552909152918290205491516323b872dd60e01b8152309181019190915292851660248401526044830152906323b872dd90606401600060405180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b505050602085015185516040516001600160a01b0392831693509116907ff297737e991455288ddb7481b53c270d8821275ddfdf4e82af900234f8e2925990600090a350505050565b6000610b1b610da6565b905090565b610b28610bd5565b6001600160a01b038116610b5757604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b610b6081610c02565b50565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116610bd0576040516330be1a3d60e21b815260040160405180910390fd5b919050565b6000546001600160a01b031633146108335760405163118cdaa760e01b8152336004820152602401610b4e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060610b1b7f00000000000000000000000000000000000000000000000000000000000000006001610ed1565b6060610b1b7f00000000000000000000000000000000000000000000000000000000000000006002610ed1565b600061081b610cb9610da6565b8360405161190160f01b8152600281019290925260228201526042902090565b60004282608001511015610d005760405163f6d5e7cb60e01b815260040160405180910390fd5b602080830151604080850151606080870151835160008082529681018086528a905260ff90951693850193909352830152608082015260019060a0016020604051602081039080840390855afa158015610d5e573d6000803e3d6000fd5b5050604051601f19015195945050505050565b600042821015610d9457604051636932286960e11b815260040160405180910390fd5b610d9e8484610f7c565b949350505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610dff57507f000000000000000000000000000000000000000000000000000000000000000046145b15610e2957507f000000000000000000000000000000000000000000000000000000000000000090565b610b1b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b606060ff8314610eeb57610ee483610fa6565b905061081b565b818054610ef7906118c3565b80601f0160208091040260200160405190810160405280929190818152602001828054610f23906118c3565b8015610f705780601f10610f4557610100808354040283529160200191610f70565b820191906000526020600020905b815481529060010190602001808311610f5357829003601f168201915b5050505050905061081b565b600080600080610f8c8686610fe5565b925092509250610f9c8282611032565b5090949350505050565b60606000610fb3836110ef565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000806000835160410361101f5760208401516040850151606086015160001a61101188828585611117565b95509550955050505061102b565b50508151600091506002905b9250925092565b6000826003811115611046576110466118fd565b0361104f575050565b6001826003811115611063576110636118fd565b036110815760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115611095576110956118fd565b036110b65760405163fce698f760e01b815260048101829052602401610b4e565b60038260038111156110ca576110ca6118fd565b036110eb576040516335e2f38360e21b815260048101829052602401610b4e565b5050565b600060ff8216601f81111561081b57604051632cd44ac360e21b815260040160405180910390fd5b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561115257506000915060039050826111dc565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156111a6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166111d2575060009250600191508290506111dc565b9250600091508190505b9450945094915050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b038111828210171561121e5761121e6111e6565b60405290565b604051606081016001600160401b038111828210171561121e5761121e6111e6565b604051601f8201601f191681016001600160401b038111828210171561126e5761126e6111e6565b604052919050565b80356001600160a01b0381168114610bd057600080fd5b6000806001600160401b038411156112a7576112a76111e6565b50601f8301601f19166020016112bc81611246565b9150508281528383830111156112d157600080fd5b828260208301376000602084830101529392505050565b600082601f8301126112f957600080fd5b6113088383356020850161128d565b9392505050565b60006020828403121561132157600080fd5b81356001600160401b0381111561133757600080fd5b82016080818503121561134957600080fd5b6113516111fc565b61135a82611276565b815260208201356001600160401b0381111561137557600080fd5b611381868285016112e8565b60208301525060408201356001600160401b038111156113a057600080fd5b6113ac868285016112e8565b60408301525060608201356001600160401b038111156113cb57600080fd5b6113d7868285016112e8565b606083015250949350505050565b600082601f8301126113f657600080fd5b81356001600160401b0381111561140f5761140f6111e6565b8060051b61141f60208201611246565b9182526020818501810192908101908684111561143b57600080fd5b6020860192505b838310156114645761145383611276565b825260209283019290910190611442565b9695505050505050565b60006020828403121561148057600080fd5b81356001600160401b0381111561149657600080fd5b8201604081850312156114a857600080fd5b604080519081016001600160401b03811182821017156114ca576114ca6111e6565b6040526114d682611276565b815260208201356001600160401b038111156114f157600080fd5b6114fd868285016113e5565b602083015250949350505050565b60006020828403121561151d57600080fd5b81356001600160401b0381111561153357600080fd5b82016060818503121561154557600080fd5b61154d611224565b61155682611276565b815260208201356001600160401b0381111561157157600080fd5b61157d868285016113e5565b60208301525060408201356001600160401b0381111561159c57600080fd5b6115a8868285016113e5565b604083015250949350505050565b600080604083850312156115c957600080fd5b6115d283611276565b91506115e060208401611276565b90509250929050565b6000815180845260005b8181101561160f576020818501810151868301820152016115f3565b506000602082860101526020601f19601f83011685010191505092915050565b60ff60f81b8816815260e06020820152600061164e60e08301896115e9565b828103604084015261166081896115e9565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b818110156116b6578351835260209384019390920191600101611698565b50909b9a5050505050505050505050565b6000602082840312156116d957600080fd5b61130882611276565b600060a082840312156116f457600080fd5b60405160a081016001600160401b0381118282101715611716576117166111e6565b60405290508061172583611276565b8152602083013560ff8116811461173b57600080fd5b60208201526040838101359082015260608084013590820152608092830135920191909152919050565b60008060c0838503121561177857600080fd5b82356001600160401b0381111561178e57600080fd5b8301608081860312156117a057600080fd5b6117a86111fc565b6117b182611276565b81526117bf60208301611276565b602082015260408201356001600160401b038111156117dd57600080fd5b8201601f810187136117ee57600080fd5b6117fd8782356020840161128d565b6040830152506060918201359181019190915291506115e084602085016116e2565b60006020828403121561183157600080fd5b8151801515811461130857600080fd5b60808152600061185460808301876115e9565b828103602084015261186681876115e9565b9050828103604084015261187a81866115e9565b91505060018060a01b038316606083015295945050505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156118bc57600080fd5b5051919050565b600181811c908216806118d757607f821691505b6020821081036118f757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052602160045260246000fdfe416374697661746544657669636528616464726573732070726f647563742c61646472657373206465766963652c6279746573206465766963655369676e61747572652c75696e7432353620646576696365446561646c696e652c75696e7432353620646561646c696e6529a26469706673582212205aae321411c9f4bb762f3838fd491f112fc34ff33add75c3b487b884160409fb64736f6c634300081a0033","sourceMap":"387:6486:2:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2467:648;;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;3026:32:48;;;3008:51;;2996:2;2981:18;2467:648:2;;;;;;;;3121:544;;;;;;:::i;:::-;;:::i;:::-;;3671:633;;;;;;:::i;:::-;;:::i;5739:177::-;;;;;;:::i;:::-;;:::i;:::-;;;5995:25:48;;;5983:2;5968:18;5739:177:2;5849::48;2293:101:3;;;:::i;5144:557:15:-;;;:::i;:::-;;;;;;;;;;;;;:::i;1638:85:3:-;1684:7;1710:6;-1:-1:-1;;;;;1710:6:3;1638:85;;5609:124:2;;;;;;:::i;:::-;-1:-1:-1;;;;;5701:25:2;;;5675:7;5701:25;;;:16;:25;;;;;;;;5609:124;1687:239;;;:::i;4310:1293::-;;;;;;:::i;:::-;;:::i;2355:106::-;;;:::i;2543:215:3:-;;;;;;:::i;:::-;;:::i;2467:648:2:-;2597:16;;2588:102;;-1:-1:-1;;;2588:102:2;;-1:-1:-1;;;2588:102:2;;;10279:52:48;2551:7:2;;-1:-1:-1;;;;;2588:44:2;;;;10252:18:48;;2588:102:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2570:183;;2722:20;;-1:-1:-1;;;2722:20:2;;;;;;;;;;;2570:183;2763:15;2781:30;2794:4;:16;;;2781:12;:30::i;:::-;2763:48;;2830:7;-1:-1:-1;;;;;2821:28:2;;2863:4;:9;;;2886:4;:11;;;2911:4;:17;;;2950:4;2821:144;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;2976:25:2;;;;;;;:16;:25;;;;;;:38;;-1:-1:-1;;;;;;2976:38:2;3004:10;2976:38;;;;;;3057:16;;3030:53;;2976:25;;-1:-1:-1;3030:53:2;;;3004:10;3030:53;;2976:25;3030:53;3101:7;2467:648;-1:-1:-1;;2467:648:2:o;3121:544::-;3207:12;;-1:-1:-1;;;;;2262:25:2;;;3207:12;2262:25;;;:16;:25;;;;;;;2248:10;:39;2244:88;;2310:11;;-1:-1:-1;;;2310:11:2;;;;;;;;;;;2244:88;3236:9:::1;3231:428;3255:4;:12;;;:19;3251:1;:23;3231:428;;;3325:12:::0;;-1:-1:-1;;;;;3299:39:2::1;3358:1;3299:39:::0;;;:25:::1;:39;::::0;;;;;;3339:12;;::::1;::::0;:15;;3358:1;;3339:12;3352:1;;3339:15;::::1;;;;;:::i;:::-;;;;;;;-1:-1:-1::0;;;;;3299:56:2::1;-1:-1:-1::0;;;;;3299:56:2::1;;;;;;;;;;;;;:60;3295:128;;;3386:22;;-1:-1:-1::0;;;3386:22:2::1;;;;;;;;;;;3295:128;3463:12:::0;;3454:42:::1;::::0;-1:-1:-1;;;3454:42:2;;3490:4:::1;3454:42;::::0;::::1;3008:51:48::0;3436:15:2::1;::::0;-1:-1:-1;;;;;3454:27:2::1;::::0;::::1;::::0;2981:18:48;;3454:42:2::1;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3436:60;;3569:7;3510:25;:39;3536:4;:12;;;-1:-1:-1::0;;;;;3510:39:2::1;-1:-1:-1::0;;;;;3510:39:2::1;;;;;;;;;;;;:56;3550:4;:12;;;3563:1;3550:15;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1::0;;;;;3510:56:2::1;-1:-1:-1::0;;;;;3510:56:2::1;;;;;;;;;;;;:66;;;;3640:7;3623:4;:12;;;3636:1;3623:15;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1::0;;;;;3595:53:2::1;3609:4;:12;;;-1:-1:-1::0;;;;;3595:53:2::1;;;;;;;;;;;-1:-1:-1::0;3276:3:2::1;;3231:428;;;;3121:544:::0;;:::o;3671:633::-;3775:12;;-1:-1:-1;;;;;2262:25:2;;;3775:12;2262:25;;;:16;:25;;;;;;;2248:10;:39;2244:88;;2310:11;;-1:-1:-1;;;2310:11:2;;;;;;;;;;;2244:88;3804:9:::1;3799:499;3823:4;:12;;;:19;3819:1;:23;3799:499;;;3893:12:::0;;-1:-1:-1;;;;;3867:39:2::1;3926:1;3867:39:::0;;;:25:::1;:39;::::0;;;;;;3907:12;;::::1;::::0;:15;;3926:1;;3907:12;3920:1;;3907:15;::::1;;;;;:::i;:::-;;;;;;;-1:-1:-1::0;;;;;3867:56:2::1;-1:-1:-1::0;;;;;3867:56:2::1;;;;;;;;;;;;;:60;3863:128;;;3954:22;;-1:-1:-1::0;;;3954:22:2::1;;;;;;;;;;;3863:128;4004:15;4031:4;:12;;;-1:-1:-1::0;;;;;4022:27:2::1;;4050:4;:14;;;4065:1;4050:17;;;;;;;;:::i;:::-;;;;;;;4022:46;;;;;;;;;;;;;;-1:-1:-1::0;;;;;3026:32:48;;;;3008:51;;2996:2;2981:18;;2862:203;4022:46:2::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4004:64;;4141:7;4082:25;:39;4108:4;:12;;;-1:-1:-1::0;;;;;4082:39:2::1;-1:-1:-1::0;;;;;4082:39:2::1;;;;;;;;;;;;:56;4122:4;:12;;;4135:1;4122:15;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1::0;;;;;4082:56:2::1;-1:-1:-1::0;;;;;4082:56:2::1;;;;;;;;;;;;:66;;;;4212:7;4195:4;:12;;;4208:1;4195:15;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1::0;;;;;4167:53:2::1;4181:4;:12;;;-1:-1:-1::0;;;;;4167:53:2::1;;;;;;;;;;;4269:4;:14;;;4284:1;4269:17;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1::0;;;;;4239:48:2::1;4255:4;:12;;;-1:-1:-1::0;;;;;4239:48:2::1;;;;;;;;;;;-1:-1:-1::0;3844:3:2::1;;3799:499;;5739:177:::0;-1:-1:-1;;;;;5867:34:2;;;5841:7;5867:34;;;:25;:34;;;;;;;;:42;;;;;;;;;;5739:177;;;;;:::o;2293:101:3:-;1531:13;:11;:13::i;:::-;2357:30:::1;2384:1;2357:18;:30::i;:::-;2293:101::o:0;5144:557:15:-;5242:13;5269:18;5301:21;5336:15;5365:25;5404:12;5430:27;5533:13;:11;:13::i;:::-;5560:16;:14;:16::i;:::-;5668;;;5652:1;5668:16;;;;;;;;;-1:-1:-1;;;5482:212:15;;;-1:-1:-1;5482:212:15;;-1:-1:-1;5590:13:15;;-1:-1:-1;5625:4:15;;-1:-1:-1;5652:1:15;-1:-1:-1;5668:16:15;-1:-1:-1;5482:212:15;-1:-1:-1;5144:557:15:o;1687:239:2:-;1769:147;;;;;;;;;;;;;;;;;1746:180;;;;;;1687:239;:::o;4310:1293::-;4439:21;4463:467;4497:400;1769:147;;;;;;;;;;;;;;;;;1746:180;;;;;;;4648:12;;4686:11;;;;4733:20;;;;;4723:31;;;;;;4780:19;;;;4825:18;;;;4562:303;;;;4723:31;;4780:19;;4562:303;11882:25:48;;;-1:-1:-1;;;;;11943:32:48;;;11938:2;11923:18;;11916:60;12012:32;;;;12007:2;11992:18;;11985:60;12076:2;12061:18;;12054:34;12119:3;12104:19;;12097:35;;;;11963:3;12148:19;;12141:35;11869:3;11854:19;;11595:587;4562:303:2;;;;;;;;;;;;;4531:352;;;;;;4497:16;:400::i;:::-;4911:9;4463:20;:467::i;:::-;4439:491;;4965:13;-1:-1:-1;;;;;4945:33:2;:9;:16;;;-1:-1:-1;;;;;4945:33:2;;4941:96;;5001:25;;-1:-1:-1;;;5001:25:2;;;;;;;;;;;4941:96;5047:27;5077:178;5111:67;5156:4;:19;;;5145:31;;;;;;5995:25:48;;5983:2;5968:18;;5849:177;5145:31:2;;;;-1:-1:-1;;5145:31:2;;;;;;;;;5135:42;;5145:31;5135:42;;;;13208:26:48;6080:59:2;;;13196:39:48;13251:12;;;;13244:28;;;;6080:59:2;;;;;;;;;;13288:12:48;;;;6080:59:2;;;6053:100;;;;;;5922:238;5111:67;5192:4;:20;;;5226:4;:19;;;5077:20;:178::i;:::-;5047:208;;5285:19;-1:-1:-1;;;;;5270:34:2;:4;:11;;;-1:-1:-1;;;;;5270:34:2;;5266:97;;5327:25;;-1:-1:-1;;;5327:25:2;;;;;;;;;;;5266:97;5382:12;;-1:-1:-1;;;;;5373:35:2;;;5382:12;5476:39;;;:25;:39;;;;;;;;5516:11;;;;5476:52;;;;;;;;;;;;5373:165;;-1:-1:-1;;;5373:165:2;;5430:4;5373:165;;;12389:51:48;;;;12476:32;;;12456:18;;;12449:60;12525:18;;;12518:34;5373:35:2;;;12362:18:48;;5373:165:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;5584:11:2;;;;5570:12;;5554:42;;-1:-1:-1;;;;;5554:42:2;;;;-1:-1:-1;5554:42:2;;;;;5570:12;;5554:42;4429:1174;;4310:1293;;:::o;2355:106::-;2408:7;2434:20;:18;:20::i;:::-;2427:27;;2355:106;:::o;2543:215:3:-;1531:13;:11;:13::i;:::-;-1:-1:-1;;;;;2627:22:3;::::1;2623:91;;2672:31;::::0;-1:-1:-1;;;2672:31:3;;2700:1:::1;2672:31;::::0;::::1;3008:51:48::0;2981:18;;2672:31:3::1;;;;;;;;2623:91;2723:28;2742:8;2723:18;:28::i;:::-;2543:215:::0;:::o;1047:787:6:-;1104:16;1436:48;1418:14;1412:4;1408:25;1402:4;1398:36;1395:90;1389:4;1382:104;1643:32;1626:14;1620:4;1616:25;1613:63;1607:4;1600:77;1718:4;1712;1709:1;1702:21;1690:33;-1:-1:-1;;;;;;1746:22:6;;1742:86;;1791:26;;-1:-1:-1;;;1791:26:6;;;;;;;;;;;1742:86;1047:787;;;:::o;1796:162:3:-;1684:7;1710:6;-1:-1:-1;;;;;1710:6:3;735:10:10;1855:23:3;1851:101;;1901:40;;-1:-1:-1;;;1901:40:3;;735:10:10;1901:40:3;;;3008:51:48;2981:18;;1901:40:3;2862:203:48;2912:187:3;2985:16;3004:6;;-1:-1:-1;;;;;3020:17:3;;;-1:-1:-1;;;;;;3020:17:3;;;;;;3052:40;;3004:6;;;;;;;3052:40;;2985:16;3052:40;2975:124;2912:187;:::o;6021:126:15:-;6067:13;6099:41;:5;6126:13;6099:26;:41::i;6473:135::-;6522:13;6554:47;:8;6584:16;6554:29;:47::i;4917:176::-;4994:7;5020:66;5053:20;:18;:20::i;:::-;5075:10;3555:4:16;3549:11;-1:-1:-1;;;3573:23:16;;3625:4;3616:14;;3609:39;;;;3677:4;3668:14;;3661:34;3733:4;3718:20;;;3353:401;6451:420:2;6576:7;6620:15;6599:9;:18;;;:36;6595:85;;;6656:24;;-1:-1:-1;;;6656:24:2;;;;;;;;;;;6595:85;6760:11;;;;;6785;;;;;6810;;;;;6717:114;;6690:24;6717:114;;;;;;;;;12790:25:48;;;12863:4;12851:17;;;12831:18;;;12824:45;;;;12885:18;;12878:34;12928:18;;;12921:34;6717:114:2;;12762:19:48;;6717:114:2;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6717:114:2;;-1:-1:-1;;6717:114:2;;;6451:420;-1:-1:-1;;;;;6451:420:2:o;6166:279::-;6307:7;6341:15;6330:8;:26;6326:63;;;6365:24;;-1:-1:-1;;;6365:24:2;;;;;;;;;;;6326:63;6406:32;6420:6;6428:9;6406:13;:32::i;:::-;6399:39;6166:279;-1:-1:-1;;;;6166:279:2:o;3845:262:15:-;3898:7;3929:4;-1:-1:-1;;;;;3938:11:15;3921:28;;:63;;;;;3970:14;3953:13;:31;3921:63;3917:184;;;-1:-1:-1;4007:22:15;;3845:262::o;3917:184::-;4067:23;4204:80;;;2079:95;4204:80;;;13955:25:48;4226:11:15;13996:18:48;;;13989:34;;;;4239:14:15;14039:18:48;;;14032:34;4255:13:15;14082:18:48;;;14075:34;4278:4:15;14125:19:48;;;14118:61;4168:7:15;;13927:19:48;;4204:80:15;;;;;;;;;;;;4194:91;;;;;;4187:98;;4113:179;;3385:267:11;3479:13;1390:66;3508:46;;3504:142;;3577:15;3586:5;3577:8;:15::i;:::-;3570:22;;;;3504:142;3630:5;3623:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3702:255:14;3780:7;3800:17;3819:18;3839:16;3859:27;3870:4;3876:9;3859:10;:27::i;:::-;3799:87;;;;;;3896:28;3908:5;3915:8;3896:11;:28::i;:::-;-1:-1:-1;3941:9:14;;3702:255;-1:-1:-1;;;;3702:255:14:o;2078:405:11:-;2137:13;2162:11;2176:16;2187:4;2176:10;:16::i;:::-;2300:14;;;2311:2;2300:14;;;;;;;;;2162:30;;-1:-1:-1;2280:17:11;;2300:14;;;;;;;;;-1:-1:-1;;;2390:16:11;;;-1:-1:-1;2435:4:11;2426:14;;2419:28;;;;-1:-1:-1;2390:16:11;2078:405::o;2129:766:14:-;2210:7;2219:12;2233:7;2256:9;:16;2276:2;2256:22;2252:637;;2592:4;2577:20;;2571:27;2641:4;2626:20;;2620:27;2698:4;2683:20;;2677:27;2294:9;2669:36;2739:25;2750:4;2669:36;2571:27;2620;2739:10;:25::i;:::-;2732:32;;;;;;;;;;;2252:637;-1:-1:-1;;2860:16:14;;2811:1;;-1:-1:-1;2815:35:14;;2252:637;2129:766;;;;;:::o;7196:532::-;7291:20;7282:5;:29;;;;;;;;:::i;:::-;;7278:444;;7196:532;;:::o;7278:444::-;7387:29;7378:5;:38;;;;;;;;:::i;:::-;;7374:348;;7439:23;;-1:-1:-1;;;7439:23:14;;;;;;;;;;;7374:348;7492:35;7483:5;:44;;;;;;;;:::i;:::-;;7479:243;;7550:46;;-1:-1:-1;;;7550:46:14;;;;;5995:25:48;;;5968:18;;7550:46:14;5849:177:48;7479:243:14;7626:30;7617:5;:39;;;;;;;;:::i;:::-;;7613:109;;7679:32;;-1:-1:-1;;;7679:32:14;;;;;5995:25:48;;;5968:18;;7679:32:14;5849:177:48;7613:109:14;7196:532;;:::o;2555:245:11:-;2616:7;2688:4;2652:40;;2715:2;2706:11;;2702:69;;;2740:20;;-1:-1:-1;;;2740:20:11;;;;;;;;;;;5140:1530:14;5266:7;;;6199:66;6186:79;;6182:164;;;-1:-1:-1;6297:1:14;;-1:-1:-1;6301:30:14;;-1:-1:-1;6333:1:14;6281:54;;6182:164;6457:24;;;6440:14;6457:24;;;;;;;;;12790:25:48;;;12863:4;12851:17;;12831:18;;;12824:45;;;;12885:18;;;12878:34;;;12928:18;;;12921:34;;;6457:24:14;;12762:19:48;;6457:24:14;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6457:24:14;;-1:-1:-1;;6457:24:14;;;-1:-1:-1;;;;;;;6495:20:14;;6491:113;;-1:-1:-1;6547:1:14;;-1:-1:-1;6551:29:14;;-1:-1:-1;6547:1:14;;-1:-1:-1;6531:62:14;;6491:113;6622:6;-1:-1:-1;6630:20:14;;-1:-1:-1;6630:20:14;;-1:-1:-1;5140:1530:14;;;;;;;;;:::o;14:127:48:-;75:10;70:3;66:20;63:1;56:31;106:4;103:1;96:15;130:4;127:1;120:15;146:253;218:2;212:9;260:4;248:17;;-1:-1:-1;;;;;280:34:48;;316:22;;;277:62;274:88;;;342:18;;:::i;:::-;378:2;371:22;146:253;:::o;404:::-;476:2;470:9;518:4;506:17;;-1:-1:-1;;;;;538:34:48;;574:22;;;535:62;532:88;;;600:18;;:::i;662:275::-;733:2;727:9;798:2;779:13;;-1:-1:-1;;775:27:48;763:40;;-1:-1:-1;;;;;818:34:48;;854:22;;;815:62;812:88;;;880:18;;:::i;:::-;916:2;909:22;662:275;;-1:-1:-1;662:275:48:o;942:173::-;1010:20;;-1:-1:-1;;;;;1059:31:48;;1049:42;;1039:70;;1105:1;1102;1095:12;1120:450;1185:5;1217:1;-1:-1:-1;;;;;1233:6:48;1230:30;1227:56;;;1263:18;;:::i;:::-;-1:-1:-1;1329:2:48;1308:15;;-1:-1:-1;;1304:29:48;1335:4;1300:40;1358:21;1300:40;1358:21;:::i;:::-;1349:30;;;1402:6;1395:5;1388:21;1442:3;1433:6;1428:3;1424:16;1421:25;1418:45;;;1459:1;1456;1449:12;1418:45;1508:6;1503:3;1496:4;1489:5;1485:16;1472:43;1562:1;1555:4;1546:6;1539:5;1535:18;1531:29;1524:40;1120:450;;;;;:::o;1575:222::-;1618:5;1671:3;1664:4;1656:6;1652:17;1648:27;1638:55;;1689:1;1686;1679:12;1638:55;1711:80;1787:3;1778:6;1765:20;1758:4;1750:6;1746:17;1711:80;:::i;:::-;1702:89;1575:222;-1:-1:-1;;;1575:222:48:o;1802:1055::-;1895:6;1948:2;1936:9;1927:7;1923:23;1919:32;1916:52;;;1964:1;1961;1954:12;1916:52;2004:9;1991:23;-1:-1:-1;;;;;2029:6:48;2026:30;2023:50;;;2069:1;2066;2059:12;2023:50;2092:22;;2148:4;2130:16;;;2126:27;2123:47;;;2166:1;2163;2156:12;2123:47;2192:22;;:::i;:::-;2237;2256:2;2237:22;:::i;:::-;2230:5;2223:37;2306:2;2302;2298:11;2285:25;-1:-1:-1;;;;;2325:8:48;2322:32;2319:52;;;2367:1;2364;2357:12;2319:52;2403:45;2440:7;2429:8;2425:2;2421:17;2403:45;:::i;:::-;2398:2;2391:5;2387:14;2380:69;;2495:2;2491;2487:11;2474:25;-1:-1:-1;;;;;2514:8:48;2511:32;2508:52;;;2556:1;2553;2546:12;2508:52;2592:45;2629:7;2618:8;2614:2;2610:17;2592:45;:::i;:::-;2587:2;2580:5;2576:14;2569:69;;2684:2;2680;2676:11;2663:25;-1:-1:-1;;;;;2703:8:48;2700:32;2697:52;;;2745:1;2742;2735:12;2697:52;2781:45;2818:7;2807:8;2803:2;2799:17;2781:45;:::i;:::-;2776:2;2765:14;;2758:69;-1:-1:-1;2769:5:48;1802:1055;-1:-1:-1;;;;1802:1055:48:o;3070:727::-;3124:5;3177:3;3170:4;3162:6;3158:17;3154:27;3144:55;;3195:1;3192;3185:12;3144:55;3235:6;3222:20;-1:-1:-1;;;;;3257:6:48;3254:30;3251:56;;;3287:18;;:::i;:::-;3333:6;3330:1;3326:14;3360:30;3384:4;3380:2;3376:13;3360:30;:::i;:::-;3426:19;;;3470:4;3502:15;;;3498:26;;;3461:14;;;;3536:15;;;3533:35;;;3564:1;3561;3554:12;3533:35;3600:4;3592:6;3588:17;3577:28;;3614:152;3630:6;3625:3;3622:15;3614:152;;;3698:23;3717:3;3698:23;:::i;:::-;3686:36;;3751:4;3647:14;;;;3742;;;;3614:152;;;3784:7;3070:727;-1:-1:-1;;;;;;3070:727:48:o;3802:875::-;3895:6;3948:2;3936:9;3927:7;3923:23;3919:32;3916:52;;;3964:1;3961;3954:12;3916:52;4004:9;3991:23;-1:-1:-1;;;;;4029:6:48;4026:30;4023:50;;;4069:1;4066;4059:12;4023:50;4092:22;;4148:4;4130:16;;;4126:27;4123:47;;;4166:1;4163;4156:12;4123:47;4219:4;4213:11;;;4251:17;;-1:-1:-1;;;;;4283:34:48;;4319:22;;;4280:62;4277:88;;;4345:18;;:::i;:::-;4381:4;4374:24;4422:22;4441:2;4422:22;:::i;:::-;4414:6;4407:38;4491:2;4487;4483:11;4470:25;-1:-1:-1;;;;;4510:8:48;4507:32;4504:52;;;4552:1;4549;4542:12;4504:52;4589:56;4637:7;4626:8;4622:2;4618:17;4589:56;:::i;:::-;4584:2;4572:15;;4565:81;-1:-1:-1;4576:6:48;3802:875;-1:-1:-1;;;;3802:875:48:o;4682:897::-;4784:6;4837:2;4825:9;4816:7;4812:23;4808:32;4805:52;;;4853:1;4850;4843:12;4805:52;4893:9;4880:23;-1:-1:-1;;;;;4918:6:48;4915:30;4912:50;;;4958:1;4955;4948:12;4912:50;4981:22;;5037:4;5019:16;;;5015:27;5012:47;;;5055:1;5052;5045:12;5012:47;5081:22;;:::i;:::-;5126;5145:2;5126:22;:::i;:::-;5119:5;5112:37;5195:2;5191;5187:11;5174:25;-1:-1:-1;;;;;5214:8:48;5211:32;5208:52;;;5256:1;5253;5246:12;5208:52;5292:56;5340:7;5329:8;5325:2;5321:17;5292:56;:::i;:::-;5287:2;5280:5;5276:14;5269:80;;5395:2;5391;5387:11;5374:25;-1:-1:-1;;;;;5414:8:48;5411:32;5408:52;;;5456:1;5453;5446:12;5408:52;5492:56;5540:7;5529:8;5525:2;5521:17;5492:56;:::i;:::-;5487:2;5476:14;;5469:80;-1:-1:-1;5480:5:48;4682:897;-1:-1:-1;;;;4682:897:48:o;5584:260::-;5652:6;5660;5713:2;5701:9;5692:7;5688:23;5684:32;5681:52;;;5729:1;5726;5719:12;5681:52;5752:29;5771:9;5752:29;:::i;:::-;5742:39;;5800:38;5834:2;5823:9;5819:18;5800:38;:::i;:::-;5790:48;;5584:260;;;;;:::o;6031:400::-;6073:3;6111:5;6105:12;6138:6;6133:3;6126:19;6163:1;6173:139;6187:6;6184:1;6181:13;6173:139;;;6295:4;6280:13;;;6276:24;;6270:31;6250:11;;;6246:22;;6239:63;6202:12;6173:139;;;6177:3;6357:1;6350:4;6341:6;6336:3;6332:16;6328:27;6321:38;6420:4;6413:2;6409:7;6404:2;6396:6;6392:15;6388:29;6383:3;6379:39;6375:50;6368:57;;;6031:400;;;;:::o;6436:1238::-;6842:3;6837;6833:13;6825:6;6821:26;6810:9;6803:45;6884:3;6879:2;6868:9;6864:18;6857:31;6784:4;6911:46;6952:3;6941:9;6937:19;6929:6;6911:46;:::i;:::-;7005:9;6997:6;6993:22;6988:2;6977:9;6973:18;6966:50;7039:33;7065:6;7057;7039:33;:::i;:::-;7103:2;7088:18;;7081:34;;;-1:-1:-1;;;;;7152:32:48;;7146:3;7131:19;;7124:61;7172:3;7201:19;;7194:35;;;7266:22;;;7260:3;7245:19;;7238:51;7338:13;;7360:22;;;7410:2;7436:15;;;;-1:-1:-1;7398:15:48;;;;-1:-1:-1;7479:169:48;7493:6;7490:1;7487:13;7479:169;;;7554:13;;7542:26;;7597:2;7623:15;;;;7588:12;;;;7515:1;7508:9;7479:169;;;-1:-1:-1;7665:3:48;;6436:1238;-1:-1:-1;;;;;;;;;;;6436:1238:48:o;7679:186::-;7738:6;7791:2;7779:9;7770:7;7766:23;7762:32;7759:52;;;7807:1;7804;7797:12;7759:52;7830:29;7849:9;7830:29;:::i;8052:961::-;8114:5;8162:4;8150:9;8145:3;8141:19;8137:30;8134:50;;;8180:1;8177;8170:12;8134:50;8233:2;8227:9;8275:4;8263:17;;-1:-1:-1;;;;;8295:34:48;;8331:22;;;8292:62;8289:88;;;8357:18;;:::i;:::-;8393:2;8386:22;8426:6;-1:-1:-1;8426:6:48;8456:29;8475:9;8456:29;:::i;:::-;8448:6;8441:45;8538:2;8527:9;8523:18;8510:32;8586:4;8577:7;8573:18;8564:7;8561:31;8551:59;;8606:1;8603;8596:12;8551:59;8638:2;8626:15;;8619:32;8724:2;8709:18;;;8696:32;8744:15;;;8737:32;8842:2;8827:18;;;8814:32;8862:15;;;8855:32;8960:3;8945:19;;;8932:33;8981:16;;8974:33;;;;8052:961;;-1:-1:-1;8052:961:48:o;9018:1112::-;9153:6;9161;9214:3;9202:9;9193:7;9189:23;9185:33;9182:53;;;9231:1;9228;9221:12;9182:53;9271:9;9258:23;-1:-1:-1;;;;;9296:6:48;9293:30;9290:50;;;9336:1;9333;9326:12;9290:50;9359:22;;9415:4;9397:16;;;9393:27;9390:47;;;9433:1;9430;9423:12;9390:47;9459:22;;:::i;:::-;9504;9523:2;9504:22;:::i;:::-;9497:5;9490:37;9559:31;9586:2;9582;9578:11;9559:31;:::i;:::-;9554:2;9547:5;9543:14;9536:55;9637:2;9633;9629:11;9616:25;-1:-1:-1;;;;;9656:8:48;9653:32;9650:52;;;9698:1;9695;9688:12;9650:52;9721:17;;9769:4;9761:13;;9757:27;-1:-1:-1;9747:55:48;;9798:1;9795;9788:12;9747:55;9834:74;9900:7;9895:2;9882:16;9877:2;9873;9869:11;9834:74;:::i;:::-;9829:2;9818:14;;9811:98;-1:-1:-1;9975:2:48;9967:11;;;9954:25;9995:14;;;9988:31;;;;9822:5;-1:-1:-1;10062:62:48;10116:7;10111:2;10096:18;;10062:62;:::i;10342:277::-;10409:6;10462:2;10450:9;10441:7;10437:23;10433:32;10430:52;;;10478:1;10475;10468:12;10430:52;10510:9;10504:16;10563:5;10556:13;10549:21;10542:5;10539:32;10529:60;;10585:1;10582;10575:12;10624:645;10897:3;10886:9;10879:22;10860:4;10924:46;10965:3;10954:9;10950:19;10942:6;10924:46;:::i;:::-;11018:9;11010:6;11006:22;11001:2;10990:9;10986:18;10979:50;11052:33;11078:6;11070;11052:33;:::i;:::-;11038:47;;11133:9;11125:6;11121:22;11116:2;11105:9;11101:18;11094:50;11161:33;11187:6;11179;11161:33;:::i;:::-;11153:41;;;11259:1;11255;11250:3;11246:11;11242:19;11234:6;11230:32;11225:2;11214:9;11210:18;11203:60;10624:645;;;;;;;:::o;11274:127::-;11335:10;11330:3;11326:20;11323:1;11316:31;11366:4;11363:1;11356:15;11390:4;11387:1;11380:15;11406:184;11476:6;11529:2;11517:9;11508:7;11504:23;11500:32;11497:52;;;11545:1;11542;11535:12;11497:52;-1:-1:-1;11568:16:48;;11406:184;-1:-1:-1;11406:184:48:o;13311:380::-;13390:1;13386:12;;;;13433;;;13454:61;;13508:4;13500:6;13496:17;13486:27;;13454:61;13561:2;13553:6;13550:14;13530:18;13527:38;13524:161;;13607:10;13602:3;13598:20;13595:1;13588:31;13642:4;13639:1;13632:15;13670:4;13667:1;13660:15;13524:161;;13311:380;;;:::o;14190:127::-;14251:10;14246:3;14242:20;14239:1;14232:31;14282:4;14279:1;14272:15;14306:4;14303:1;14296:15","linkReferences":{},"immutableReferences":{"2278":[{"start":3591,"length":32}],"2280":[{"start":3549,"length":32}],"2282":[{"start":3507,"length":32}],"2284":[{"start":3672,"length":32}],"2286":[{"start":3712,"length":32}],"2289":[{"start":3161,"length":32}],"2292":[{"start":3206,"length":32}]}},"methodIdentifiers":{"ACTIVATE_DEVICE_TYPEHASH()":"b063cb54","activateDevice((address,address,bytes,uint256),(address,uint8,bytes32,bytes32,uint256))":"bb189de1","createActivatedDevices((address,address[],address[]))":"4be60db3","createDevices((address,address[]))":"3a7eece8","createProduct((address,string,string,string))":"002ca198","eip712Domain()":"84b0196e","getDeviceTokenId(address,address)":"5d25e632","getDomainSeparator()":"ed24911d","getVendorByProduct(address)":"904b55a5","owner()":"8da5cb5b","renounceOwnership()":"715018a6","transferOwnership(address)":"f2fde38b"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.26+commit.8a97fa7a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DeviceAlreadyCreated\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeviceSignatureExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeviceSignatureMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EIP712SignatureExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EIP712SignatureMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC1167FailedCreateClone\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotProductTemplate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotVendor\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenIdMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"product\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"device\",\"type\":\"address\"}],\"name\":\"DeviceActivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"product\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"device\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"DeviceCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"vendor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"productImpl\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"product\",\"type\":\"address\"}],\"name\":\"ProductCreated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ACTIVATE_DEVICE_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"product\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"device\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"deviceSignature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"deviceDeadline\",\"type\":\"uint256\"}],\"internalType\":\"struct ProductFactory.ActivateDeviceArgs\",\"name\":\"args\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct ProductFactory.EIP712Signature\",\"name\":\"signature\",\"type\":\"tuple\"}],\"name\":\"activateDevice\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"product\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"devices\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"receivers\",\"type\":\"address[]\"}],\"internalType\":\"struct ProductFactory.CreateActivatedDevicesArgs\",\"name\":\"args\",\"type\":\"tuple\"}],\"name\":\"createActivatedDevices\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"product\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"devices\",\"type\":\"address[]\"}],\"internalType\":\"struct ProductFactory.CreateDevicesArgs\",\"name\":\"args\",\"type\":\"tuple\"}],\"name\":\"createDevices\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"productImpl\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"baseTokenURI\",\"type\":\"string\"}],\"internalType\":\"struct ProductFactory.CreateProductArgs\",\"name\":\"args\",\"type\":\"tuple\"}],\"name\":\"createProduct\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"product\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"device\",\"type\":\"address\"}],\"name\":\"getDeviceTokenId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDomainSeparator\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"product\",\"type\":\"address\"}],\"name\":\"getVendorByProduct\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"ECDSAInvalidSignature()\":[{\"details\":\"The signature derives the `address(0)`.\"}],\"ECDSAInvalidSignatureLength(uint256)\":[{\"details\":\"The signature has an invalid length.\"}],\"ECDSAInvalidSignatureS(bytes32)\":[{\"details\":\"The signature has an S value that is in the upper half order.\"}],\"ERC1167FailedCreateClone()\":[{\"details\":\"A clone instance deployment failed.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}]},\"events\":{\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"}},\"kind\":\"dev\",\"methods\":{\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ProductFactory.sol\":\"ProductFactory\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@forge-std-1.9.1/=dependencies/forge-std-1.9.1/\",\":@openzeppelin-contracts-5.0.2/=dependencies/@openzeppelin-contracts-5.0.2/\",\":@openzeppelin-contracts-upgradeable-5.0.2/=dependencies/@openzeppelin-contracts-upgradeable-5.0.2/\",\":@openzeppelin/contracts-upgradeable/=dependencies/@openzeppelin-contracts-upgradeable-5.0.2/\",\":@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.0.2/\",\":forge-std-1.9.1/=dependencies/forge-std-1.9.1/src/\",\":forge-std/=dependencies/forge-std-1.9.1/src/\"]},\"sources\":{\"contracts/IProduct.sol\":{\"keccak256\":\"0x6cdaf79f90839e8af876816a9b371de13324adb455a6cdee759de2b108c12712\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://040a3225f5c5ffce4a30396f518cdb7b6f40527f2fc4519eff659c8e441cccb0\",\"dweb:/ipfs/QmYgH4w2UoF2SnZQRMD234TjJQQ6Wp6RtgMNMdEtKzjryQ\"]},\"contracts/ProductFactory.sol\":{\"keccak256\":\"0xe438d70a0477073c924343fdc951d5ecdc65319bc16374de2c3cd37d55133f8f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f11b859bcec0230dcd1fa8bd8dc481c671665445b9f41a238220d4855be29037\",\"dweb:/ipfs/QmNkCrEe97wkDkHMhD58YbyiovJpN7fBQokUTyq32yZn6J\"]},\"dependencies/@openzeppelin-contracts-5.0.2/access/Ownable.sol\":{\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8ed324d3920bb545059d66ab97d43e43ee85fd3bd52e03e401f020afb0b120f6\",\"dweb:/ipfs/QmfEckWLmZkDDcoWrkEvMWhms66xwTLff9DDhegYpvHo1a\"]},\"dependencies/@openzeppelin-contracts-5.0.2/interfaces/IERC5267.sol\":{\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c5c0f29195ad64cbe556da8e257dac8f05f78c53f90323c0d2accf8e6922d33a\",\"dweb:/ipfs/QmQ61TED8uaCZwcbh8KkgRSsCav7x7HbcGHwHts3U4DmUP\"]},\"dependencies/@openzeppelin-contracts-5.0.2/proxy/Clones.sol\":{\"keccak256\":\"0xd18408af8a91bedb3d56343eeb9b30eb852e6dea93a5e2d5c6db9ca4cb905155\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://061475b7302a732dc598907790f407417551c2b13e89daa57b3698489ef5484b\",\"dweb:/ipfs/QmdX5qmk3VSniSErFuD4aVawQxUi2MuUbP7spPcHddPfcX\"]},\"dependencies/@openzeppelin-contracts-5.0.2/token/ERC721/IERC721.sol\":{\"keccak256\":\"0x5ef46daa3b58ef2702279d514780316efaa952915ee1aa3396f041ee2982b0b4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2f8f2a76e23b02fc69e8cd24c3cb47da6c7af3a2d6c3a382f8ac25c6e094ade7\",\"dweb:/ipfs/QmPV4ZS4tPVv4mTCf9ejyZ1ai57EEibDRj7mN2ARDCLV5n\"]},\"dependencies/@openzeppelin-contracts-5.0.2/utils/Context.sol\":{\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6a708e8a5bdb1011c2c381c9a5cfd8a9a956d7d0a9dc1bd8bcdaf52f76ef2f12\",\"dweb:/ipfs/Qmax9WHBnVsZP46ZxEMNRQpLQnrdE4dK8LehML1Py8FowF\"]},\"dependencies/@openzeppelin-contracts-5.0.2/utils/ShortStrings.sol\":{\"keccak256\":\"0x18a7171df639a934592915a520ecb97c5bbc9675a1105607aac8a94e72bf62c6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7478e1f13da69a2867ccd883001d836b75620362e743f196376d63ed0c422a1c\",\"dweb:/ipfs/QmWywcQ9TNfwtoqAxbn25d8C5VrV12PrPS9UjtGe6pL2BA\"]},\"dependencies/@openzeppelin-contracts-5.0.2/utils/StorageSlot.sol\":{\"keccak256\":\"0x32ba59b4b7299237c8ba56319110989d7978a039faf754793064e967e5894418\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1ae50c8b562427df610cc4540c9bf104acca7ef8e2dcae567ae7e52272281e9c\",\"dweb:/ipfs/QmTHiadFCSJUPpRjNegc5SahmeU8bAoY8i9Aq6tVscbcKR\"]},\"dependencies/@openzeppelin-contracts-5.0.2/utils/Strings.sol\":{\"keccak256\":\"0x55f102ea785d8399c0e58d1108e2d289506dde18abc6db1b7f68c1f9f9bc5792\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6e52e0a7765c943ef14e5bcf11e46e6139fa044be564881378349236bf2e3453\",\"dweb:/ipfs/QmZEeeXoFPW47amyP35gfzomF9DixqqTEPwzBakv6cZw6i\"]},\"dependencies/@openzeppelin-contracts-5.0.2/utils/cryptography/ECDSA.sol\":{\"keccak256\":\"0xeed0a08b0b091f528356cbc7245891a4c748682d4f6a18055e8e6ca77d12a6cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ba80ba06c8e6be852847e4c5f4492cef801feb6558ae09ed705ff2e04ea8b13c\",\"dweb:/ipfs/QmXRJDv3xHLVQCVXg1ZvR35QS9sij5y9NDWYzMfUfAdTHF\"]},\"dependencies/@openzeppelin-contracts-5.0.2/utils/cryptography/EIP712.sol\":{\"keccak256\":\"0x999f705a027ed6dc2d4e0df2cc4a509852c6bfd11de1c8161bf88832d0503fd0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0798def67258d9a3cc20b2b4da7ebf351a5cefe0abfdd665d2d81f8e32f89b21\",\"dweb:/ipfs/QmPEvJosnPfzHNjKvCv2D3891mA2Ww8eUwkqrxBjuYdHCt\"]},\"dependencies/@openzeppelin-contracts-5.0.2/utils/cryptography/MessageHashUtils.sol\":{\"keccak256\":\"0xba333517a3add42cd35fe877656fc3dfcc9de53baa4f3aabbd6d12a92e4ea435\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2ceacff44c0fdc81e48e0e0b1db87a2076d3c1fb497341de077bf1da9f6b406c\",\"dweb:/ipfs/QmRUo1muMRAewxrKQ7TkXUtknyRoR57AyEkoPpiuZQ8FzX\"]},\"dependencies/@openzeppelin-contracts-5.0.2/utils/introspection/IERC165.sol\":{\"keccak256\":\"0x4296879f55019b23e135000eb36896057e7101fb7fb859c5ef690cf14643757b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://87b3541437c8c443ccd36795e56a338ed12855eec17f8da624511b8d1a7e14df\",\"dweb:/ipfs/QmeJQCtZrQjtJLr6u7ZHWeH3pBnjtLWzvRrKViAi7UZqxL\"]},\"dependencies/@openzeppelin-contracts-5.0.2/utils/math/Math.sol\":{\"keccak256\":\"0x005ec64c6313f0555d59e278f9a7a5ab2db5bdc72a027f255a37c327af1ec02d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4ece9f0b9c8daca08c76b6b5405a6446b6f73b3a15fab7ff56e296cbd4a2c875\",\"dweb:/ipfs/QmQyRpyPRL5SQuAgj6SHmbir3foX65FJjbVTTQrA2EFg6L\"]},\"dependencies/@openzeppelin-contracts-5.0.2/utils/math/SignedMath.sol\":{\"keccak256\":\"0x5f7e4076e175393767754387c962926577f1660dd9b810187b9002407656be72\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7d533a1c97cd43a57cd9c465f7ee8dd0e39ae93a8fb8ff8e5303a356b081cdcc\",\"dweb:/ipfs/QmVBEei6aTnvYNZp2CHYVNKyZS4q1KkjANfY39WVXZXVoT\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.26+commit.8a97fa7a"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"address","name":"initialOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"type":"error","name":"DeviceAlreadyCreated"},{"inputs":[],"type":"error","name":"DeviceSignatureExpired"},{"inputs":[],"type":"error","name":"DeviceSignatureMismatch"},{"inputs":[],"type":"error","name":"ECDSAInvalidSignature"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"type":"error","name":"ECDSAInvalidSignatureLength"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"type":"error","name":"ECDSAInvalidSignatureS"},{"inputs":[],"type":"error","name":"EIP712SignatureExpired"},{"inputs":[],"type":"error","name":"EIP712SignatureMismatch"},{"inputs":[],"type":"error","name":"ERC1167FailedCreateClone"},{"inputs":[],"type":"error","name":"InvalidShortString"},{"inputs":[],"type":"error","name":"NotProductTemplate"},{"inputs":[],"type":"error","name":"NotVendor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"type":"error","name":"OwnableInvalidOwner"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"type":"error","name":"OwnableUnauthorizedAccount"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"type":"error","name":"StringTooLong"},{"inputs":[],"type":"error","name":"TokenIdMismatch"},{"inputs":[{"internalType":"address","name":"product","type":"address","indexed":true},{"internalType":"address","name":"device","type":"address","indexed":true}],"type":"event","name":"DeviceActivated","anonymous":false},{"inputs":[{"internalType":"address","name":"product","type":"address","indexed":true},{"internalType":"address","name":"device","type":"address","indexed":true},{"internalType":"uint256","name":"tokenId","type":"uint256","indexed":true}],"type":"event","name":"DeviceCreated","anonymous":false},{"inputs":[],"type":"event","name":"EIP712DomainChanged","anonymous":false},{"inputs":[{"internalType":"address","name":"previousOwner","type":"address","indexed":true},{"internalType":"address","name":"newOwner","type":"address","indexed":true}],"type":"event","name":"OwnershipTransferred","anonymous":false},{"inputs":[{"internalType":"address","name":"vendor","type":"address","indexed":true},{"internalType":"address","name":"productImpl","type":"address","indexed":true},{"internalType":"address","name":"product","type":"address","indexed":true}],"type":"event","name":"ProductCreated","anonymous":false},{"inputs":[],"stateMutability":"view","type":"function","name":"ACTIVATE_DEVICE_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[{"internalType":"struct ProductFactory.ActivateDeviceArgs","name":"args","type":"tuple","components":[{"internalType":"address","name":"product","type":"address"},{"internalType":"address","name":"device","type":"address"},{"internalType":"bytes","name":"deviceSignature","type":"bytes"},{"internalType":"uint256","name":"deviceDeadline","type":"uint256"}]},{"internalType":"struct ProductFactory.EIP712Signature","name":"signature","type":"tuple","components":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint256","name":"deadline","type":"uint256"}]}],"stateMutability":"nonpayable","type":"function","name":"activateDevice"},{"inputs":[{"internalType":"struct ProductFactory.CreateActivatedDevicesArgs","name":"args","type":"tuple","components":[{"internalType":"address","name":"product","type":"address"},{"internalType":"address[]","name":"devices","type":"address[]"},{"internalType":"address[]","name":"receivers","type":"address[]"}]}],"stateMutability":"nonpayable","type":"function","name":"createActivatedDevices"},{"inputs":[{"internalType":"struct ProductFactory.CreateDevicesArgs","name":"args","type":"tuple","components":[{"internalType":"address","name":"product","type":"address"},{"internalType":"address[]","name":"devices","type":"address[]"}]}],"stateMutability":"nonpayable","type":"function","name":"createDevices"},{"inputs":[{"internalType":"struct ProductFactory.CreateProductArgs","name":"args","type":"tuple","components":[{"internalType":"address","name":"productImpl","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"baseTokenURI","type":"string"}]}],"stateMutability":"nonpayable","type":"function","name":"createProduct","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}]},{"inputs":[{"internalType":"address","name":"product","type":"address"},{"internalType":"address","name":"device","type":"address"}],"stateMutability":"view","type":"function","name":"getDeviceTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"getDomainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[{"internalType":"address","name":"product","type":"address"}],"stateMutability":"view","type":"function","name":"getVendorByProduct","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"nonpayable","type":"function","name":"renounceOwnership"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"transferOwnership"}],"devdoc":{"kind":"dev","methods":{"eip712Domain()":{"details":"See {IERC-5267}."},"owner()":{"details":"Returns the address of the current owner."},"renounceOwnership()":{"details":"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."},"transferOwnership(address)":{"details":"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."}},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"remappings":["@forge-std-1.9.1/=dependencies/forge-std-1.9.1/","@openzeppelin-contracts-5.0.2/=dependencies/@openzeppelin-contracts-5.0.2/","@openzeppelin-contracts-upgradeable-5.0.2/=dependencies/@openzeppelin-contracts-upgradeable-5.0.2/","@openzeppelin/contracts-upgradeable/=dependencies/@openzeppelin-contracts-upgradeable-5.0.2/","@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.0.2/","forge-std-1.9.1/=dependencies/forge-std-1.9.1/src/","forge-std/=dependencies/forge-std-1.9.1/src/"],"optimizer":{"enabled":true,"runs":200},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"contracts/ProductFactory.sol":"ProductFactory"},"evmVersion":"paris","libraries":{}},"sources":{"contracts/IProduct.sol":{"keccak256":"0x6cdaf79f90839e8af876816a9b371de13324adb455a6cdee759de2b108c12712","urls":["bzz-raw://040a3225f5c5ffce4a30396f518cdb7b6f40527f2fc4519eff659c8e441cccb0","dweb:/ipfs/QmYgH4w2UoF2SnZQRMD234TjJQQ6Wp6RtgMNMdEtKzjryQ"],"license":"MIT"},"contracts/ProductFactory.sol":{"keccak256":"0xe438d70a0477073c924343fdc951d5ecdc65319bc16374de2c3cd37d55133f8f","urls":["bzz-raw://f11b859bcec0230dcd1fa8bd8dc481c671665445b9f41a238220d4855be29037","dweb:/ipfs/QmNkCrEe97wkDkHMhD58YbyiovJpN7fBQokUTyq32yZn6J"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/access/Ownable.sol":{"keccak256":"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb","urls":["bzz-raw://8ed324d3920bb545059d66ab97d43e43ee85fd3bd52e03e401f020afb0b120f6","dweb:/ipfs/QmfEckWLmZkDDcoWrkEvMWhms66xwTLff9DDhegYpvHo1a"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/interfaces/IERC5267.sol":{"keccak256":"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92","urls":["bzz-raw://c5c0f29195ad64cbe556da8e257dac8f05f78c53f90323c0d2accf8e6922d33a","dweb:/ipfs/QmQ61TED8uaCZwcbh8KkgRSsCav7x7HbcGHwHts3U4DmUP"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/proxy/Clones.sol":{"keccak256":"0xd18408af8a91bedb3d56343eeb9b30eb852e6dea93a5e2d5c6db9ca4cb905155","urls":["bzz-raw://061475b7302a732dc598907790f407417551c2b13e89daa57b3698489ef5484b","dweb:/ipfs/QmdX5qmk3VSniSErFuD4aVawQxUi2MuUbP7spPcHddPfcX"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/token/ERC721/IERC721.sol":{"keccak256":"0x5ef46daa3b58ef2702279d514780316efaa952915ee1aa3396f041ee2982b0b4","urls":["bzz-raw://2f8f2a76e23b02fc69e8cd24c3cb47da6c7af3a2d6c3a382f8ac25c6e094ade7","dweb:/ipfs/QmPV4ZS4tPVv4mTCf9ejyZ1ai57EEibDRj7mN2ARDCLV5n"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/utils/Context.sol":{"keccak256":"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2","urls":["bzz-raw://6a708e8a5bdb1011c2c381c9a5cfd8a9a956d7d0a9dc1bd8bcdaf52f76ef2f12","dweb:/ipfs/Qmax9WHBnVsZP46ZxEMNRQpLQnrdE4dK8LehML1Py8FowF"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/utils/ShortStrings.sol":{"keccak256":"0x18a7171df639a934592915a520ecb97c5bbc9675a1105607aac8a94e72bf62c6","urls":["bzz-raw://7478e1f13da69a2867ccd883001d836b75620362e743f196376d63ed0c422a1c","dweb:/ipfs/QmWywcQ9TNfwtoqAxbn25d8C5VrV12PrPS9UjtGe6pL2BA"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/utils/StorageSlot.sol":{"keccak256":"0x32ba59b4b7299237c8ba56319110989d7978a039faf754793064e967e5894418","urls":["bzz-raw://1ae50c8b562427df610cc4540c9bf104acca7ef8e2dcae567ae7e52272281e9c","dweb:/ipfs/QmTHiadFCSJUPpRjNegc5SahmeU8bAoY8i9Aq6tVscbcKR"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/utils/Strings.sol":{"keccak256":"0x55f102ea785d8399c0e58d1108e2d289506dde18abc6db1b7f68c1f9f9bc5792","urls":["bzz-raw://6e52e0a7765c943ef14e5bcf11e46e6139fa044be564881378349236bf2e3453","dweb:/ipfs/QmZEeeXoFPW47amyP35gfzomF9DixqqTEPwzBakv6cZw6i"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/utils/cryptography/ECDSA.sol":{"keccak256":"0xeed0a08b0b091f528356cbc7245891a4c748682d4f6a18055e8e6ca77d12a6cf","urls":["bzz-raw://ba80ba06c8e6be852847e4c5f4492cef801feb6558ae09ed705ff2e04ea8b13c","dweb:/ipfs/QmXRJDv3xHLVQCVXg1ZvR35QS9sij5y9NDWYzMfUfAdTHF"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/utils/cryptography/EIP712.sol":{"keccak256":"0x999f705a027ed6dc2d4e0df2cc4a509852c6bfd11de1c8161bf88832d0503fd0","urls":["bzz-raw://0798def67258d9a3cc20b2b4da7ebf351a5cefe0abfdd665d2d81f8e32f89b21","dweb:/ipfs/QmPEvJosnPfzHNjKvCv2D3891mA2Ww8eUwkqrxBjuYdHCt"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/utils/cryptography/MessageHashUtils.sol":{"keccak256":"0xba333517a3add42cd35fe877656fc3dfcc9de53baa4f3aabbd6d12a92e4ea435","urls":["bzz-raw://2ceacff44c0fdc81e48e0e0b1db87a2076d3c1fb497341de077bf1da9f6b406c","dweb:/ipfs/QmRUo1muMRAewxrKQ7TkXUtknyRoR57AyEkoPpiuZQ8FzX"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/utils/introspection/IERC165.sol":{"keccak256":"0x4296879f55019b23e135000eb36896057e7101fb7fb859c5ef690cf14643757b","urls":["bzz-raw://87b3541437c8c443ccd36795e56a338ed12855eec17f8da624511b8d1a7e14df","dweb:/ipfs/QmeJQCtZrQjtJLr6u7ZHWeH3pBnjtLWzvRrKViAi7UZqxL"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/utils/math/Math.sol":{"keccak256":"0x005ec64c6313f0555d59e278f9a7a5ab2db5bdc72a027f255a37c327af1ec02d","urls":["bzz-raw://4ece9f0b9c8daca08c76b6b5405a6446b6f73b3a15fab7ff56e296cbd4a2c875","dweb:/ipfs/QmQyRpyPRL5SQuAgj6SHmbir3foX65FJjbVTTQrA2EFg6L"],"license":"MIT"},"dependencies/@openzeppelin-contracts-5.0.2/utils/math/SignedMath.sol":{"keccak256":"0x5f7e4076e175393767754387c962926577f1660dd9b810187b9002407656be72","urls":["bzz-raw://7d533a1c97cd43a57cd9c465f7ee8dd0e39ae93a8fb8ff8e5303a356b081cdcc","dweb:/ipfs/QmVBEei6aTnvYNZp2CHYVNKyZS4q1KkjANfY39WVXZXVoT"],"license":"MIT"}},"version":1},"id":2} \ No newline at end of file diff --git a/tool/src/typechain/ProductFactory.ts b/tool/src/generated/IProductFactory.ts similarity index 63% rename from tool/src/typechain/ProductFactory.ts rename to tool/src/generated/IProductFactory.ts index 9190391..6862d1c 100644 --- a/tool/src/typechain/ProductFactory.ts +++ b/tool/src/generated/IProductFactory.ts @@ -26,7 +26,7 @@ import type { OnEvent, } from "./common"; -export declare namespace ProductFactory { +export declare namespace IProductFactory { export type ActivateDeviceArgsStruct = { product: string; device: string; @@ -62,6 +62,18 @@ export declare namespace ProductFactory { BigNumber ] & { signer: string; v: number; r: string; s: string; deadline: BigNumber }; + export type CreateActivatedDeviceArgsStruct = { + product: string; + device: string; + receiver: string; + }; + + export type CreateActivatedDeviceArgsStructOutput = [ + string, + string, + string + ] & { product: string; device: string; receiver: string }; + export type CreateActivatedDevicesArgsStruct = { product: string; devices: string[]; @@ -74,6 +86,13 @@ export declare namespace ProductFactory { string[] ] & { product: string; devices: string[]; receivers: string[] }; + export type CreateDeviceArgsStruct = { product: string; device: string }; + + export type CreateDeviceArgsStructOutput = [string, string] & { + product: string; + device: string; + }; + export type CreateDevicesArgsStruct = { product: string; devices: string[] }; export type CreateDevicesArgsStructOutput = [string, string[]] & { @@ -101,64 +120,58 @@ export declare namespace ProductFactory { }; } -export interface ProductFactoryInterface extends utils.Interface { +export interface IProductFactoryInterface extends utils.Interface { functions: { - "ACTIVATE_DEVICE_TYPEHASH()": FunctionFragment; "activateDevice((address,address,bytes,uint256),(address,uint8,bytes32,bytes32,uint256))": FunctionFragment; + "createActivatedDevice((address,address,address))": FunctionFragment; "createActivatedDevices((address,address[],address[]))": FunctionFragment; + "createDevice((address,address))": FunctionFragment; "createDevices((address,address[]))": FunctionFragment; "createProduct((address,string,string,string))": FunctionFragment; - "eip712Domain()": FunctionFragment; "getDeviceTokenId(address,address)": FunctionFragment; "getDomainSeparator()": FunctionFragment; "getVendorByProduct(address)": FunctionFragment; - "owner()": FunctionFragment; - "renounceOwnership()": FunctionFragment; - "transferOwnership(address)": FunctionFragment; }; getFunction( nameOrSignatureOrTopic: - | "ACTIVATE_DEVICE_TYPEHASH" | "activateDevice" + | "createActivatedDevice" | "createActivatedDevices" + | "createDevice" | "createDevices" | "createProduct" - | "eip712Domain" | "getDeviceTokenId" | "getDomainSeparator" | "getVendorByProduct" - | "owner" - | "renounceOwnership" - | "transferOwnership" ): FunctionFragment; - encodeFunctionData( - functionFragment: "ACTIVATE_DEVICE_TYPEHASH", - values?: undefined - ): string; encodeFunctionData( functionFragment: "activateDevice", values: [ - ProductFactory.ActivateDeviceArgsStruct, - ProductFactory.EIP712SignatureStruct + IProductFactory.ActivateDeviceArgsStruct, + IProductFactory.EIP712SignatureStruct ] ): string; + encodeFunctionData( + functionFragment: "createActivatedDevice", + values: [IProductFactory.CreateActivatedDeviceArgsStruct] + ): string; encodeFunctionData( functionFragment: "createActivatedDevices", - values: [ProductFactory.CreateActivatedDevicesArgsStruct] + values: [IProductFactory.CreateActivatedDevicesArgsStruct] ): string; encodeFunctionData( - functionFragment: "createDevices", - values: [ProductFactory.CreateDevicesArgsStruct] + functionFragment: "createDevice", + values: [IProductFactory.CreateDeviceArgsStruct] ): string; encodeFunctionData( - functionFragment: "createProduct", - values: [ProductFactory.CreateProductArgsStruct] + functionFragment: "createDevices", + values: [IProductFactory.CreateDevicesArgsStruct] ): string; encodeFunctionData( - functionFragment: "eip712Domain", - values?: undefined + functionFragment: "createProduct", + values: [IProductFactory.CreateProductArgsStruct] ): string; encodeFunctionData( functionFragment: "getDeviceTokenId", @@ -172,22 +185,13 @@ export interface ProductFactoryInterface extends utils.Interface { functionFragment: "getVendorByProduct", values: [string] ): string; - encodeFunctionData(functionFragment: "owner", values?: undefined): string; - encodeFunctionData( - functionFragment: "renounceOwnership", - values?: undefined - ): string; - encodeFunctionData( - functionFragment: "transferOwnership", - values: [string] - ): string; decodeFunctionResult( - functionFragment: "ACTIVATE_DEVICE_TYPEHASH", + functionFragment: "activateDevice", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "activateDevice", + functionFragment: "createActivatedDevice", data: BytesLike ): Result; decodeFunctionResult( @@ -195,15 +199,15 @@ export interface ProductFactoryInterface extends utils.Interface { data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "createDevices", + functionFragment: "createDevice", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "createProduct", + functionFragment: "createDevices", data: BytesLike ): Result; decodeFunctionResult( - functionFragment: "eip712Domain", + functionFragment: "createProduct", data: BytesLike ): Result; decodeFunctionResult( @@ -218,37 +222,25 @@ export interface ProductFactoryInterface extends utils.Interface { functionFragment: "getVendorByProduct", data: BytesLike ): Result; - decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "renounceOwnership", - data: BytesLike - ): Result; - decodeFunctionResult( - functionFragment: "transferOwnership", - data: BytesLike - ): Result; events: { - "DeviceActivated(address,address)": EventFragment; + "DeviceActivated(address,address,address)": EventFragment; "DeviceCreated(address,address,uint256)": EventFragment; - "EIP712DomainChanged()": EventFragment; - "OwnershipTransferred(address,address)": EventFragment; "ProductCreated(address,address,address)": EventFragment; }; getEvent(nameOrSignatureOrTopic: "DeviceActivated"): EventFragment; getEvent(nameOrSignatureOrTopic: "DeviceCreated"): EventFragment; - getEvent(nameOrSignatureOrTopic: "EIP712DomainChanged"): EventFragment; - getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; getEvent(nameOrSignatureOrTopic: "ProductCreated"): EventFragment; } export interface DeviceActivatedEventObject { product: string; device: string; + receiver: string; } export type DeviceActivatedEvent = TypedEvent< - [string, string], + [string, string, string], DeviceActivatedEventObject >; @@ -266,27 +258,6 @@ export type DeviceCreatedEvent = TypedEvent< export type DeviceCreatedEventFilter = TypedEventFilter; -export interface EIP712DomainChangedEventObject {} -export type EIP712DomainChangedEvent = TypedEvent< - [], - EIP712DomainChangedEventObject ->; - -export type EIP712DomainChangedEventFilter = - TypedEventFilter; - -export interface OwnershipTransferredEventObject { - previousOwner: string; - newOwner: string; -} -export type OwnershipTransferredEvent = TypedEvent< - [string, string], - OwnershipTransferredEventObject ->; - -export type OwnershipTransferredEventFilter = - TypedEventFilter; - export interface ProductCreatedEventObject { vendor: string; productImpl: string; @@ -299,12 +270,12 @@ export type ProductCreatedEvent = TypedEvent< export type ProductCreatedEventFilter = TypedEventFilter; -export interface ProductFactory extends BaseContract { +export interface IProductFactory extends BaseContract { connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; deployed(): Promise; - interface: ProductFactoryInterface; + interface: IProductFactoryInterface; queryFilter( event: TypedEventFilter, @@ -326,43 +297,37 @@ export interface ProductFactory extends BaseContract { removeListener: OnEvent; functions: { - ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; - activateDevice( - args: ProductFactory.ActivateDeviceArgsStruct, - signature: ProductFactory.EIP712SignatureStruct, + args: IProductFactory.ActivateDeviceArgsStruct, + signature: IProductFactory.EIP712SignatureStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createActivatedDevice( + args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: Overrides & { from?: string } ): Promise; createActivatedDevices( - args: ProductFactory.CreateActivatedDevicesArgsStruct, + args: IProductFactory.CreateActivatedDevicesArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createDevice( + args: IProductFactory.CreateDeviceArgsStruct, overrides?: Overrides & { from?: string } ): Promise; createDevices( - args: ProductFactory.CreateDevicesArgsStruct, + args: IProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { from?: string } ): Promise; createProduct( - args: ProductFactory.CreateProductArgsStruct, + args: IProductFactory.CreateProductArgsStruct, overrides?: Overrides & { from?: string } ): Promise; - eip712Domain( - overrides?: CallOverrides - ): Promise< - [string, string, string, BigNumber, string, string, BigNumber[]] & { - fields: string; - name: string; - version: string; - chainId: BigNumber; - verifyingContract: string; - salt: string; - extensions: BigNumber[]; - } - >; - getDeviceTokenId( product: string, device: string, @@ -375,56 +340,39 @@ export interface ProductFactory extends BaseContract { product: string, overrides?: CallOverrides ): Promise<[string]>; - - owner(overrides?: CallOverrides): Promise<[string]>; - - renounceOwnership( - overrides?: Overrides & { from?: string } - ): Promise; - - transferOwnership( - newOwner: string, - overrides?: Overrides & { from?: string } - ): Promise; }; - ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise; - activateDevice( - args: ProductFactory.ActivateDeviceArgsStruct, - signature: ProductFactory.EIP712SignatureStruct, + args: IProductFactory.ActivateDeviceArgsStruct, + signature: IProductFactory.EIP712SignatureStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createActivatedDevice( + args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: Overrides & { from?: string } ): Promise; createActivatedDevices( - args: ProductFactory.CreateActivatedDevicesArgsStruct, + args: IProductFactory.CreateActivatedDevicesArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createDevice( + args: IProductFactory.CreateDeviceArgsStruct, overrides?: Overrides & { from?: string } ): Promise; createDevices( - args: ProductFactory.CreateDevicesArgsStruct, + args: IProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { from?: string } ): Promise; createProduct( - args: ProductFactory.CreateProductArgsStruct, + args: IProductFactory.CreateProductArgsStruct, overrides?: Overrides & { from?: string } ): Promise; - eip712Domain( - overrides?: CallOverrides - ): Promise< - [string, string, string, BigNumber, string, string, BigNumber[]] & { - fields: string; - name: string; - version: string; - chainId: BigNumber; - verifyingContract: string; - salt: string; - extensions: BigNumber[]; - } - >; - getDeviceTokenId( product: string, device: string, @@ -438,55 +386,38 @@ export interface ProductFactory extends BaseContract { overrides?: CallOverrides ): Promise; - owner(overrides?: CallOverrides): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: string } - ): Promise; - - transferOwnership( - newOwner: string, - overrides?: Overrides & { from?: string } - ): Promise; - callStatic: { - ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise; - activateDevice( - args: ProductFactory.ActivateDeviceArgsStruct, - signature: ProductFactory.EIP712SignatureStruct, + args: IProductFactory.ActivateDeviceArgsStruct, + signature: IProductFactory.EIP712SignatureStruct, overrides?: CallOverrides ): Promise; + createActivatedDevice( + args: IProductFactory.CreateActivatedDeviceArgsStruct, + overrides?: CallOverrides + ): Promise; + createActivatedDevices( - args: ProductFactory.CreateActivatedDevicesArgsStruct, + args: IProductFactory.CreateActivatedDevicesArgsStruct, + overrides?: CallOverrides + ): Promise; + + createDevice( + args: IProductFactory.CreateDeviceArgsStruct, overrides?: CallOverrides ): Promise; createDevices( - args: ProductFactory.CreateDevicesArgsStruct, + args: IProductFactory.CreateDevicesArgsStruct, overrides?: CallOverrides ): Promise; createProduct( - args: ProductFactory.CreateProductArgsStruct, + args: IProductFactory.CreateProductArgsStruct, overrides?: CallOverrides ): Promise; - eip712Domain( - overrides?: CallOverrides - ): Promise< - [string, string, string, BigNumber, string, string, BigNumber[]] & { - fields: string; - name: string; - version: string; - chainId: BigNumber; - verifyingContract: string; - salt: string; - extensions: BigNumber[]; - } - >; - getDeviceTokenId( product: string, device: string, @@ -499,25 +430,18 @@ export interface ProductFactory extends BaseContract { product: string, overrides?: CallOverrides ): Promise; - - owner(overrides?: CallOverrides): Promise; - - renounceOwnership(overrides?: CallOverrides): Promise; - - transferOwnership( - newOwner: string, - overrides?: CallOverrides - ): Promise; }; filters: { - "DeviceActivated(address,address)"( + "DeviceActivated(address,address,address)"( product?: string | null, - device?: string | null + device?: string | null, + receiver?: null ): DeviceActivatedEventFilter; DeviceActivated( product?: string | null, - device?: string | null + device?: string | null, + receiver?: null ): DeviceActivatedEventFilter; "DeviceCreated(address,address,uint256)"( @@ -531,18 +455,6 @@ export interface ProductFactory extends BaseContract { tokenId?: BigNumberish | null ): DeviceCreatedEventFilter; - "EIP712DomainChanged()"(): EIP712DomainChangedEventFilter; - EIP712DomainChanged(): EIP712DomainChangedEventFilter; - - "OwnershipTransferred(address,address)"( - previousOwner?: string | null, - newOwner?: string | null - ): OwnershipTransferredEventFilter; - OwnershipTransferred( - previousOwner?: string | null, - newOwner?: string | null - ): OwnershipTransferredEventFilter; - "ProductCreated(address,address,address)"( vendor?: string | null, productImpl?: string | null, @@ -556,31 +468,37 @@ export interface ProductFactory extends BaseContract { }; estimateGas: { - ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise; - activateDevice( - args: ProductFactory.ActivateDeviceArgsStruct, - signature: ProductFactory.EIP712SignatureStruct, + args: IProductFactory.ActivateDeviceArgsStruct, + signature: IProductFactory.EIP712SignatureStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createActivatedDevice( + args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: Overrides & { from?: string } ): Promise; createActivatedDevices( - args: ProductFactory.CreateActivatedDevicesArgsStruct, + args: IProductFactory.CreateActivatedDevicesArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createDevice( + args: IProductFactory.CreateDeviceArgsStruct, overrides?: Overrides & { from?: string } ): Promise; createDevices( - args: ProductFactory.CreateDevicesArgsStruct, + args: IProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { from?: string } ): Promise; createProduct( - args: ProductFactory.CreateProductArgsStruct, + args: IProductFactory.CreateProductArgsStruct, overrides?: Overrides & { from?: string } ): Promise; - eip712Domain(overrides?: CallOverrides): Promise; - getDeviceTokenId( product: string, device: string, @@ -593,47 +511,40 @@ export interface ProductFactory extends BaseContract { product: string, overrides?: CallOverrides ): Promise; - - owner(overrides?: CallOverrides): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: string } - ): Promise; - - transferOwnership( - newOwner: string, - overrides?: Overrides & { from?: string } - ): Promise; }; populateTransaction: { - ACTIVATE_DEVICE_TYPEHASH( - overrides?: CallOverrides + activateDevice( + args: IProductFactory.ActivateDeviceArgsStruct, + signature: IProductFactory.EIP712SignatureStruct, + overrides?: Overrides & { from?: string } ): Promise; - activateDevice( - args: ProductFactory.ActivateDeviceArgsStruct, - signature: ProductFactory.EIP712SignatureStruct, + createActivatedDevice( + args: IProductFactory.CreateActivatedDeviceArgsStruct, overrides?: Overrides & { from?: string } ): Promise; createActivatedDevices( - args: ProductFactory.CreateActivatedDevicesArgsStruct, + args: IProductFactory.CreateActivatedDevicesArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createDevice( + args: IProductFactory.CreateDeviceArgsStruct, overrides?: Overrides & { from?: string } ): Promise; createDevices( - args: ProductFactory.CreateDevicesArgsStruct, + args: IProductFactory.CreateDevicesArgsStruct, overrides?: Overrides & { from?: string } ): Promise; createProduct( - args: ProductFactory.CreateProductArgsStruct, + args: IProductFactory.CreateProductArgsStruct, overrides?: Overrides & { from?: string } ): Promise; - eip712Domain(overrides?: CallOverrides): Promise; - getDeviceTokenId( product: string, device: string, @@ -648,16 +559,5 @@ export interface ProductFactory extends BaseContract { product: string, overrides?: CallOverrides ): Promise; - - owner(overrides?: CallOverrides): Promise; - - renounceOwnership( - overrides?: Overrides & { from?: string } - ): Promise; - - transferOwnership( - newOwner: string, - overrides?: Overrides & { from?: string } - ): Promise; }; } diff --git a/tool/src/generated/ProductFactory.ts b/tool/src/generated/ProductFactory.ts new file mode 100644 index 0000000..8fdc2a0 --- /dev/null +++ b/tool/src/generated/ProductFactory.ts @@ -0,0 +1,946 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "./common"; + +export declare namespace IProductFactory { + export type ActivateDeviceArgsStruct = { + product: string; + device: string; + deviceSignature: BytesLike; + deviceDeadline: BigNumberish; + }; + + export type ActivateDeviceArgsStructOutput = [ + string, + string, + string, + BigNumber + ] & { + product: string; + device: string; + deviceSignature: string; + deviceDeadline: BigNumber; + }; + + export type EIP712SignatureStruct = { + signer: string; + v: BigNumberish; + r: BytesLike; + s: BytesLike; + deadline: BigNumberish; + }; + + export type EIP712SignatureStructOutput = [ + string, + number, + string, + string, + BigNumber + ] & { signer: string; v: number; r: string; s: string; deadline: BigNumber }; + + export type CreateActivatedDeviceArgsStruct = { + product: string; + device: string; + receiver: string; + }; + + export type CreateActivatedDeviceArgsStructOutput = [ + string, + string, + string + ] & { product: string; device: string; receiver: string }; + + export type CreateActivatedDevicesArgsStruct = { + product: string; + devices: string[]; + receivers: string[]; + }; + + export type CreateActivatedDevicesArgsStructOutput = [ + string, + string[], + string[] + ] & { product: string; devices: string[]; receivers: string[] }; + + export type CreateDeviceArgsStruct = { product: string; device: string }; + + export type CreateDeviceArgsStructOutput = [string, string] & { + product: string; + device: string; + }; + + export type CreateDevicesArgsStruct = { product: string; devices: string[] }; + + export type CreateDevicesArgsStructOutput = [string, string[]] & { + product: string; + devices: string[]; + }; + + export type CreateProductArgsStruct = { + productImpl: string; + name: string; + symbol: string; + baseTokenURI: string; + }; + + export type CreateProductArgsStructOutput = [ + string, + string, + string, + string + ] & { + productImpl: string; + name: string; + symbol: string; + baseTokenURI: string; + }; +} + +export interface ProductFactoryInterface extends utils.Interface { + functions: { + "ACTIVATE_DEVICE_TYPEHASH()": FunctionFragment; + "DEPHY_PREFIX()": FunctionFragment; + "UPGRADE_INTERFACE_VERSION()": FunctionFragment; + "activateDevice((address,address,bytes,uint256),(address,uint8,bytes32,bytes32,uint256))": FunctionFragment; + "createActivatedDevice((address,address,address))": FunctionFragment; + "createActivatedDevices((address,address[],address[]))": FunctionFragment; + "createDevice((address,address))": FunctionFragment; + "createDevices((address,address[]))": FunctionFragment; + "createProduct((address,string,string,string))": FunctionFragment; + "eip712Domain()": FunctionFragment; + "getDeviceTokenId(address,address)": FunctionFragment; + "getDomainSeparator()": FunctionFragment; + "getVendorByProduct(address)": FunctionFragment; + "initialize(address)": FunctionFragment; + "owner()": FunctionFragment; + "paused()": FunctionFragment; + "proxiableUUID()": FunctionFragment; + "renounceOwnership()": FunctionFragment; + "transferOwnership(address)": FunctionFragment; + "upgradeToAndCall(address,bytes)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "ACTIVATE_DEVICE_TYPEHASH" + | "DEPHY_PREFIX" + | "UPGRADE_INTERFACE_VERSION" + | "activateDevice" + | "createActivatedDevice" + | "createActivatedDevices" + | "createDevice" + | "createDevices" + | "createProduct" + | "eip712Domain" + | "getDeviceTokenId" + | "getDomainSeparator" + | "getVendorByProduct" + | "initialize" + | "owner" + | "paused" + | "proxiableUUID" + | "renounceOwnership" + | "transferOwnership" + | "upgradeToAndCall" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "ACTIVATE_DEVICE_TYPEHASH", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "DEPHY_PREFIX", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "UPGRADE_INTERFACE_VERSION", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "activateDevice", + values: [ + IProductFactory.ActivateDeviceArgsStruct, + IProductFactory.EIP712SignatureStruct + ] + ): string; + encodeFunctionData( + functionFragment: "createActivatedDevice", + values: [IProductFactory.CreateActivatedDeviceArgsStruct] + ): string; + encodeFunctionData( + functionFragment: "createActivatedDevices", + values: [IProductFactory.CreateActivatedDevicesArgsStruct] + ): string; + encodeFunctionData( + functionFragment: "createDevice", + values: [IProductFactory.CreateDeviceArgsStruct] + ): string; + encodeFunctionData( + functionFragment: "createDevices", + values: [IProductFactory.CreateDevicesArgsStruct] + ): string; + encodeFunctionData( + functionFragment: "createProduct", + values: [IProductFactory.CreateProductArgsStruct] + ): string; + encodeFunctionData( + functionFragment: "eip712Domain", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getDeviceTokenId", + values: [string, string] + ): string; + encodeFunctionData( + functionFragment: "getDomainSeparator", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getVendorByProduct", + values: [string] + ): string; + encodeFunctionData(functionFragment: "initialize", values: [string]): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData(functionFragment: "paused", values?: undefined): string; + encodeFunctionData( + functionFragment: "proxiableUUID", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "upgradeToAndCall", + values: [string, BytesLike] + ): string; + + decodeFunctionResult( + functionFragment: "ACTIVATE_DEVICE_TYPEHASH", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "DEPHY_PREFIX", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "UPGRADE_INTERFACE_VERSION", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "activateDevice", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createActivatedDevice", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createActivatedDevices", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createDevice", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createDevices", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "createProduct", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "eip712Domain", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getDeviceTokenId", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getDomainSeparator", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getVendorByProduct", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "paused", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "proxiableUUID", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "upgradeToAndCall", + data: BytesLike + ): Result; + + events: { + "DeviceActivated(address,address,address)": EventFragment; + "DeviceCreated(address,address,uint256)": EventFragment; + "EIP712DomainChanged()": EventFragment; + "Initialized(uint64)": EventFragment; + "OwnershipTransferred(address,address)": EventFragment; + "Paused(address)": EventFragment; + "ProductCreated(address,address,address)": EventFragment; + "Unpaused(address)": EventFragment; + "Upgraded(address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "DeviceActivated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "DeviceCreated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "EIP712DomainChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Paused"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ProductCreated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Unpaused"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Upgraded"): EventFragment; +} + +export interface DeviceActivatedEventObject { + product: string; + device: string; + receiver: string; +} +export type DeviceActivatedEvent = TypedEvent< + [string, string, string], + DeviceActivatedEventObject +>; + +export type DeviceActivatedEventFilter = TypedEventFilter; + +export interface DeviceCreatedEventObject { + product: string; + device: string; + tokenId: BigNumber; +} +export type DeviceCreatedEvent = TypedEvent< + [string, string, BigNumber], + DeviceCreatedEventObject +>; + +export type DeviceCreatedEventFilter = TypedEventFilter; + +export interface EIP712DomainChangedEventObject {} +export type EIP712DomainChangedEvent = TypedEvent< + [], + EIP712DomainChangedEventObject +>; + +export type EIP712DomainChangedEventFilter = + TypedEventFilter; + +export interface InitializedEventObject { + version: BigNumber; +} +export type InitializedEvent = TypedEvent<[BigNumber], InitializedEventObject>; + +export type InitializedEventFilter = TypedEventFilter; + +export interface OwnershipTransferredEventObject { + previousOwner: string; + newOwner: string; +} +export type OwnershipTransferredEvent = TypedEvent< + [string, string], + OwnershipTransferredEventObject +>; + +export type OwnershipTransferredEventFilter = + TypedEventFilter; + +export interface PausedEventObject { + account: string; +} +export type PausedEvent = TypedEvent<[string], PausedEventObject>; + +export type PausedEventFilter = TypedEventFilter; + +export interface ProductCreatedEventObject { + vendor: string; + productImpl: string; + product: string; +} +export type ProductCreatedEvent = TypedEvent< + [string, string, string], + ProductCreatedEventObject +>; + +export type ProductCreatedEventFilter = TypedEventFilter; + +export interface UnpausedEventObject { + account: string; +} +export type UnpausedEvent = TypedEvent<[string], UnpausedEventObject>; + +export type UnpausedEventFilter = TypedEventFilter; + +export interface UpgradedEventObject { + implementation: string; +} +export type UpgradedEvent = TypedEvent<[string], UpgradedEventObject>; + +export type UpgradedEventFilter = TypedEventFilter; + +export interface ProductFactory extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: ProductFactoryInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; + + DEPHY_PREFIX(overrides?: CallOverrides): Promise<[string]>; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise<[string]>; + + activateDevice( + args: IProductFactory.ActivateDeviceArgsStruct, + signature: IProductFactory.EIP712SignatureStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createActivatedDevice( + args: IProductFactory.CreateActivatedDeviceArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createActivatedDevices( + args: IProductFactory.CreateActivatedDevicesArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createDevice( + args: IProductFactory.CreateDeviceArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createDevices( + args: IProductFactory.CreateDevicesArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createProduct( + args: IProductFactory.CreateProductArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + eip712Domain( + overrides?: CallOverrides + ): Promise< + [string, string, string, BigNumber, string, string, BigNumber[]] & { + fields: string; + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; + salt: string; + extensions: BigNumber[]; + } + >; + + getDeviceTokenId( + product: string, + device: string, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + getDomainSeparator(overrides?: CallOverrides): Promise<[string]>; + + getVendorByProduct( + product: string, + overrides?: CallOverrides + ): Promise<[string]>; + + initialize( + initialOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + owner(overrides?: CallOverrides): Promise<[string]>; + + paused(overrides?: CallOverrides): Promise<[boolean]>; + + proxiableUUID(overrides?: CallOverrides): Promise<[string]>; + + renounceOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + }; + + ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise; + + DEPHY_PREFIX(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + activateDevice( + args: IProductFactory.ActivateDeviceArgsStruct, + signature: IProductFactory.EIP712SignatureStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createActivatedDevice( + args: IProductFactory.CreateActivatedDeviceArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createActivatedDevices( + args: IProductFactory.CreateActivatedDevicesArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createDevice( + args: IProductFactory.CreateDeviceArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createDevices( + args: IProductFactory.CreateDevicesArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createProduct( + args: IProductFactory.CreateProductArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + eip712Domain( + overrides?: CallOverrides + ): Promise< + [string, string, string, BigNumber, string, string, BigNumber[]] & { + fields: string; + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; + salt: string; + extensions: BigNumber[]; + } + >; + + getDeviceTokenId( + product: string, + device: string, + overrides?: CallOverrides + ): Promise; + + getDomainSeparator(overrides?: CallOverrides): Promise; + + getVendorByProduct( + product: string, + overrides?: CallOverrides + ): Promise; + + initialize( + initialOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + paused(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + + callStatic: { + ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise; + + DEPHY_PREFIX(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + activateDevice( + args: IProductFactory.ActivateDeviceArgsStruct, + signature: IProductFactory.EIP712SignatureStruct, + overrides?: CallOverrides + ): Promise; + + createActivatedDevice( + args: IProductFactory.CreateActivatedDeviceArgsStruct, + overrides?: CallOverrides + ): Promise; + + createActivatedDevices( + args: IProductFactory.CreateActivatedDevicesArgsStruct, + overrides?: CallOverrides + ): Promise; + + createDevice( + args: IProductFactory.CreateDeviceArgsStruct, + overrides?: CallOverrides + ): Promise; + + createDevices( + args: IProductFactory.CreateDevicesArgsStruct, + overrides?: CallOverrides + ): Promise; + + createProduct( + args: IProductFactory.CreateProductArgsStruct, + overrides?: CallOverrides + ): Promise; + + eip712Domain( + overrides?: CallOverrides + ): Promise< + [string, string, string, BigNumber, string, string, BigNumber[]] & { + fields: string; + name: string; + version: string; + chainId: BigNumber; + verifyingContract: string; + salt: string; + extensions: BigNumber[]; + } + >; + + getDeviceTokenId( + product: string, + device: string, + overrides?: CallOverrides + ): Promise; + + getDomainSeparator(overrides?: CallOverrides): Promise; + + getVendorByProduct( + product: string, + overrides?: CallOverrides + ): Promise; + + initialize(initialOwner: string, overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + paused(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + renounceOwnership(overrides?: CallOverrides): Promise; + + transferOwnership( + newOwner: string, + overrides?: CallOverrides + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "DeviceActivated(address,address,address)"( + product?: string | null, + device?: string | null, + receiver?: null + ): DeviceActivatedEventFilter; + DeviceActivated( + product?: string | null, + device?: string | null, + receiver?: null + ): DeviceActivatedEventFilter; + + "DeviceCreated(address,address,uint256)"( + product?: string | null, + device?: string | null, + tokenId?: BigNumberish | null + ): DeviceCreatedEventFilter; + DeviceCreated( + product?: string | null, + device?: string | null, + tokenId?: BigNumberish | null + ): DeviceCreatedEventFilter; + + "EIP712DomainChanged()"(): EIP712DomainChangedEventFilter; + EIP712DomainChanged(): EIP712DomainChangedEventFilter; + + "Initialized(uint64)"(version?: null): InitializedEventFilter; + Initialized(version?: null): InitializedEventFilter; + + "OwnershipTransferred(address,address)"( + previousOwner?: string | null, + newOwner?: string | null + ): OwnershipTransferredEventFilter; + OwnershipTransferred( + previousOwner?: string | null, + newOwner?: string | null + ): OwnershipTransferredEventFilter; + + "Paused(address)"(account?: null): PausedEventFilter; + Paused(account?: null): PausedEventFilter; + + "ProductCreated(address,address,address)"( + vendor?: string | null, + productImpl?: string | null, + product?: string | null + ): ProductCreatedEventFilter; + ProductCreated( + vendor?: string | null, + productImpl?: string | null, + product?: string | null + ): ProductCreatedEventFilter; + + "Unpaused(address)"(account?: null): UnpausedEventFilter; + Unpaused(account?: null): UnpausedEventFilter; + + "Upgraded(address)"(implementation?: string | null): UpgradedEventFilter; + Upgraded(implementation?: string | null): UpgradedEventFilter; + }; + + estimateGas: { + ACTIVATE_DEVICE_TYPEHASH(overrides?: CallOverrides): Promise; + + DEPHY_PREFIX(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION(overrides?: CallOverrides): Promise; + + activateDevice( + args: IProductFactory.ActivateDeviceArgsStruct, + signature: IProductFactory.EIP712SignatureStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createActivatedDevice( + args: IProductFactory.CreateActivatedDeviceArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createActivatedDevices( + args: IProductFactory.CreateActivatedDevicesArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createDevice( + args: IProductFactory.CreateDeviceArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createDevices( + args: IProductFactory.CreateDevicesArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createProduct( + args: IProductFactory.CreateProductArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise; + + getDeviceTokenId( + product: string, + device: string, + overrides?: CallOverrides + ): Promise; + + getDomainSeparator(overrides?: CallOverrides): Promise; + + getVendorByProduct( + product: string, + overrides?: CallOverrides + ): Promise; + + initialize( + initialOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + paused(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + }; + + populateTransaction: { + ACTIVATE_DEVICE_TYPEHASH( + overrides?: CallOverrides + ): Promise; + + DEPHY_PREFIX(overrides?: CallOverrides): Promise; + + UPGRADE_INTERFACE_VERSION( + overrides?: CallOverrides + ): Promise; + + activateDevice( + args: IProductFactory.ActivateDeviceArgsStruct, + signature: IProductFactory.EIP712SignatureStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createActivatedDevice( + args: IProductFactory.CreateActivatedDeviceArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createActivatedDevices( + args: IProductFactory.CreateActivatedDevicesArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createDevice( + args: IProductFactory.CreateDeviceArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createDevices( + args: IProductFactory.CreateDevicesArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + createProduct( + args: IProductFactory.CreateProductArgsStruct, + overrides?: Overrides & { from?: string } + ): Promise; + + eip712Domain(overrides?: CallOverrides): Promise; + + getDeviceTokenId( + product: string, + device: string, + overrides?: CallOverrides + ): Promise; + + getDomainSeparator( + overrides?: CallOverrides + ): Promise; + + getVendorByProduct( + product: string, + overrides?: CallOverrides + ): Promise; + + initialize( + initialOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + paused(overrides?: CallOverrides): Promise; + + proxiableUUID(overrides?: CallOverrides): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: string } + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string } + ): Promise; + + upgradeToAndCall( + newImplementation: string, + data: BytesLike, + overrides?: PayableOverrides & { from?: string } + ): Promise; + }; +} diff --git a/tool/src/typechain/common.ts b/tool/src/generated/common.ts similarity index 100% rename from tool/src/typechain/common.ts rename to tool/src/generated/common.ts diff --git a/tool/src/generated/factories/IProductFactory__factory.ts b/tool/src/generated/factories/IProductFactory__factory.ts new file mode 100644 index 0000000..0d7645f --- /dev/null +++ b/tool/src/generated/factories/IProductFactory__factory.ts @@ -0,0 +1,421 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + IProductFactory, + IProductFactoryInterface, +} from "../IProductFactory"; + +const _abi = [ + { + type: "function", + name: "activateDevice", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.ActivateDeviceArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + { + name: "deviceSignature", + type: "bytes", + internalType: "bytes", + }, + { + name: "deviceDeadline", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "signature", + type: "tuple", + internalType: "struct IProductFactory.EIP712Signature", + components: [ + { + name: "signer", + type: "address", + internalType: "address", + }, + { + name: "v", + type: "uint8", + internalType: "uint8", + }, + { + name: "r", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "s", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "deadline", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createActivatedDevice", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateActivatedDeviceArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + { + name: "receiver", + type: "address", + internalType: "address", + }, + ], + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createActivatedDevices", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateActivatedDevicesArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "devices", + type: "address[]", + internalType: "address[]", + }, + { + name: "receivers", + type: "address[]", + internalType: "address[]", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createDevice", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateDeviceArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createDevices", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateDevicesArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "devices", + type: "address[]", + internalType: "address[]", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createProduct", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateProductArgs", + components: [ + { + name: "productImpl", + type: "address", + internalType: "address", + }, + { + name: "name", + type: "string", + internalType: "string", + }, + { + name: "symbol", + type: "string", + internalType: "string", + }, + { + name: "baseTokenURI", + type: "string", + internalType: "string", + }, + ], + }, + ], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "getDeviceTokenId", + inputs: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getDomainSeparator", + inputs: [], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getVendorByProduct", + inputs: [ + { + name: "product", + type: "address", + internalType: "address", + }, + ], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "event", + name: "DeviceActivated", + inputs: [ + { + name: "product", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "device", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "receiver", + type: "address", + indexed: false, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "DeviceCreated", + inputs: [ + { + name: "product", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "device", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "tokenId", + type: "uint256", + indexed: true, + internalType: "uint256", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ProductCreated", + inputs: [ + { + name: "vendor", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "productImpl", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "product", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "DeviceAlreadyCreated", + inputs: [], + }, + { + type: "error", + name: "DeviceSignatureExpired", + inputs: [], + }, + { + type: "error", + name: "DeviceSignatureMismatch", + inputs: [], + }, + { + type: "error", + name: "EIP712SignatureExpired", + inputs: [], + }, + { + type: "error", + name: "EIP712SignatureMismatch", + inputs: [], + }, + { + type: "error", + name: "NotProductTemplate", + inputs: [], + }, + { + type: "error", + name: "NotVendor", + inputs: [], + }, + { + type: "error", + name: "TokenIdMismatch", + inputs: [], + }, +] as const; + +export class IProductFactory__factory { + static readonly abi = _abi; + static createInterface(): IProductFactoryInterface { + return new utils.Interface(_abi) as IProductFactoryInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): IProductFactory { + return new Contract(address, _abi, signerOrProvider) as IProductFactory; + } +} diff --git a/tool/src/generated/factories/ProductFactory__factory.ts b/tool/src/generated/factories/ProductFactory__factory.ts new file mode 100644 index 0000000..8374c7b --- /dev/null +++ b/tool/src/generated/factories/ProductFactory__factory.ts @@ -0,0 +1,833 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers"; +import type { Provider, TransactionRequest } from "@ethersproject/providers"; +import type { + ProductFactory, + ProductFactoryInterface, +} from "../ProductFactory"; + +const _abi = [ + { + type: "function", + name: "ACTIVATE_DEVICE_TYPEHASH", + inputs: [], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "DEPHY_PREFIX", + inputs: [], + outputs: [ + { + name: "", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "UPGRADE_INTERFACE_VERSION", + inputs: [], + outputs: [ + { + name: "", + type: "string", + internalType: "string", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "activateDevice", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.ActivateDeviceArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + { + name: "deviceSignature", + type: "bytes", + internalType: "bytes", + }, + { + name: "deviceDeadline", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "signature", + type: "tuple", + internalType: "struct IProductFactory.EIP712Signature", + components: [ + { + name: "signer", + type: "address", + internalType: "address", + }, + { + name: "v", + type: "uint8", + internalType: "uint8", + }, + { + name: "r", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "s", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "deadline", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createActivatedDevice", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateActivatedDeviceArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + { + name: "receiver", + type: "address", + internalType: "address", + }, + ], + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createActivatedDevices", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateActivatedDevicesArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "devices", + type: "address[]", + internalType: "address[]", + }, + { + name: "receivers", + type: "address[]", + internalType: "address[]", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createDevice", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateDeviceArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createDevices", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateDevicesArgs", + components: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "devices", + type: "address[]", + internalType: "address[]", + }, + ], + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "createProduct", + inputs: [ + { + name: "args", + type: "tuple", + internalType: "struct IProductFactory.CreateProductArgs", + components: [ + { + name: "productImpl", + type: "address", + internalType: "address", + }, + { + name: "name", + type: "string", + internalType: "string", + }, + { + name: "symbol", + type: "string", + internalType: "string", + }, + { + name: "baseTokenURI", + type: "string", + internalType: "string", + }, + ], + }, + ], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "eip712Domain", + inputs: [], + outputs: [ + { + name: "fields", + type: "bytes1", + internalType: "bytes1", + }, + { + name: "name", + type: "string", + internalType: "string", + }, + { + name: "version", + type: "string", + internalType: "string", + }, + { + name: "chainId", + type: "uint256", + internalType: "uint256", + }, + { + name: "verifyingContract", + type: "address", + internalType: "address", + }, + { + name: "salt", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "extensions", + type: "uint256[]", + internalType: "uint256[]", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getDeviceTokenId", + inputs: [ + { + name: "product", + type: "address", + internalType: "address", + }, + { + name: "device", + type: "address", + internalType: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getDomainSeparator", + inputs: [], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getVendorByProduct", + inputs: [ + { + name: "product", + type: "address", + internalType: "address", + }, + ], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "initialize", + inputs: [ + { + name: "initialOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "owner", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "paused", + inputs: [], + outputs: [ + { + name: "", + type: "bool", + internalType: "bool", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "proxiableUUID", + inputs: [], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "renounceOwnership", + inputs: [], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "transferOwnership", + inputs: [ + { + name: "newOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "upgradeToAndCall", + inputs: [ + { + name: "newImplementation", + type: "address", + internalType: "address", + }, + { + name: "data", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "payable", + }, + { + type: "event", + name: "DeviceActivated", + inputs: [ + { + name: "product", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "device", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "receiver", + type: "address", + indexed: false, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "DeviceCreated", + inputs: [ + { + name: "product", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "device", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "tokenId", + type: "uint256", + indexed: true, + internalType: "uint256", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "EIP712DomainChanged", + inputs: [], + anonymous: false, + }, + { + type: "event", + name: "Initialized", + inputs: [ + { + name: "version", + type: "uint64", + indexed: false, + internalType: "uint64", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "OwnershipTransferred", + inputs: [ + { + name: "previousOwner", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "newOwner", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "Paused", + inputs: [ + { + name: "account", + type: "address", + indexed: false, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ProductCreated", + inputs: [ + { + name: "vendor", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "productImpl", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "product", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "Unpaused", + inputs: [ + { + name: "account", + type: "address", + indexed: false, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "Upgraded", + inputs: [ + { + name: "implementation", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "AddressEmptyCode", + inputs: [ + { + name: "target", + type: "address", + internalType: "address", + }, + ], + }, + { + type: "error", + name: "DeviceAlreadyCreated", + inputs: [], + }, + { + type: "error", + name: "DeviceSignatureExpired", + inputs: [], + }, + { + type: "error", + name: "DeviceSignatureMismatch", + inputs: [], + }, + { + type: "error", + name: "ECDSAInvalidSignature", + inputs: [], + }, + { + type: "error", + name: "ECDSAInvalidSignatureLength", + inputs: [ + { + name: "length", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + type: "error", + name: "ECDSAInvalidSignatureS", + inputs: [ + { + name: "s", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, + { + type: "error", + name: "EIP712SignatureExpired", + inputs: [], + }, + { + type: "error", + name: "EIP712SignatureMismatch", + inputs: [], + }, + { + type: "error", + name: "ERC1167FailedCreateClone", + inputs: [], + }, + { + type: "error", + name: "ERC1967InvalidImplementation", + inputs: [ + { + name: "implementation", + type: "address", + internalType: "address", + }, + ], + }, + { + type: "error", + name: "ERC1967NonPayable", + inputs: [], + }, + { + type: "error", + name: "EnforcedPause", + inputs: [], + }, + { + type: "error", + name: "ExpectedPause", + inputs: [], + }, + { + type: "error", + name: "FailedInnerCall", + inputs: [], + }, + { + type: "error", + name: "InvalidInitialization", + inputs: [], + }, + { + type: "error", + name: "NotInitializing", + inputs: [], + }, + { + type: "error", + name: "NotProductTemplate", + inputs: [], + }, + { + type: "error", + name: "NotVendor", + inputs: [], + }, + { + type: "error", + name: "OwnableInvalidOwner", + inputs: [ + { + name: "owner", + type: "address", + internalType: "address", + }, + ], + }, + { + type: "error", + name: "OwnableUnauthorizedAccount", + inputs: [ + { + name: "account", + type: "address", + internalType: "address", + }, + ], + }, + { + type: "error", + name: "ReentrancyGuardReentrantCall", + inputs: [], + }, + { + type: "error", + name: "TokenIdMismatch", + inputs: [], + }, + { + type: "error", + name: "UUPSUnauthorizedCallContext", + inputs: [], + }, + { + type: "error", + name: "UUPSUnsupportedProxiableUUID", + inputs: [ + { + name: "slot", + type: "bytes32", + internalType: "bytes32", + }, + ], + }, +] as const; + +const _bytecode = + "0x60a060405230608052348015601357600080fd5b506080516127b261003d600039600081816111520152818161117b01526112c101526127b26000f3fe60806040526004361061011e5760003560e01c806384b0196e116100a0578063bb189de111610064578063bb189de1146103ca578063c4d66de8146103ea578063ed24911d1461040a578063f2fde38b1461041f578063f9d8ee941461043f57600080fd5b806384b0196e146102e65780638da5cb5b1461030e578063904b55a51461034b578063ad3cb1cc14610384578063b063cb54146103b557600080fd5b806352d1902d116100e757806352d1902d14610206578063565501b4146102295780635c975abb146102495780635d25e6321461028b578063715018a6146102d157600080fd5b80622ca198146101235780631aaa192d146101605780633a7eece8146101b15780634be60db3146101d35780634f1ef286146101f3575b600080fd5b34801561012f57600080fd5b5061014361013e366004611eb4565b61045f565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561016c57600080fd5b506101a4604051806040016040528060188152602001772222a8242cafa4a22fa9a4a3a722a22fa6a2a9a9a0a3a29d60411b81525081565b6040516101579190611fda565b3480156101bd57600080fd5b506101d16101cc366004612076565b6105f8565b005b3480156101df57600080fd5b506101d16101ee3660046120f6565b610835565b6101d16102013660046121a1565b6108e3565b34801561021257600080fd5b5061021b610902565b604051908152602001610157565b34801561023557600080fd5b5061021b6102443660046121ee565b61091f565b34801561025557600080fd5b507fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff166040519015158152602001610157565b34801561029757600080fd5b5061021b6102a636600461223e565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156102dd57600080fd5b506101d161099e565b3480156102f257600080fd5b506102fb6109b2565b6040516101579796959493929190612271565b34801561031a57600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b0316610143565b34801561035757600080fd5b50610143610366366004612309565b6001600160a01b039081166000908152602081905260409020541690565b34801561039057600080fd5b506101a4604051806040016040528060058152602001640352e302e360dc1b81525081565b3480156103c157600080fd5b5061021b610a63565b3480156103d657600080fd5b506101d16103e53660046123a7565b610a86565b3480156103f657600080fd5b506101d1610405366004612309565b610ce0565b34801561041657600080fd5b5061021b610e4f565b34801561042b57600080fd5b506101d161043a366004612309565b610e5e565b34801561044b57600080fd5b506101d161045a36600461244d565b610e99565b6000610469610ef7565b610471610f2f565b81516040516301ffc9a760e01b815263cc2a041160e01b60048201526001600160a01b03909116906301ffc9a790602401602060405180830381865afa1580156104bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e3919061248c565b61050057604051630fb9181b60e11b815260040160405180910390fd5b600061050f8360000151610f72565b9050806001600160a01b031663a6487c538460200151856040015186606001516040518463ffffffff1660e01b815260040161054d939291906124ae565b600060405180830381600087803b15801561056757600080fd5b505af115801561057b573d6000803e3d6000fd5b5050506001600160a01b0380831660008181526020819052604080822080546001600160a01b0319163390811790915588519151939550931692917f0d516d8b14b989f8763b7f1b93e8e08f0f5ff06e0b833b8d080f0f1f33f9f3029190a490506105f3600160008051602061275d83398151915255565b919050565b610600610ef7565b610608610f2f565b80516001600160a01b0380821660009081526020819052604090205416331461064457604051630143454560e01b815260040160405180910390fd5b60005b8260200151518110156108195782516001600160a01b03166000908152600160209081526040822090850151805183919085908110610688576106886124e7565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205411156106d0576040516353eadbf760e11b815260040160405180910390fd5b82516040516335313c2160e11b81523060048201526000916001600160a01b031690636a627842906024016020604051808303816000875af115801561071a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073e91906124fd565b9050806001600086600001516001600160a01b03166001600160a01b03168152602001908152602001600020600086602001518581518110610782576107826124e7565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080846020015183815181106107c5576107c56124e7565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a450600101610647565b5050610832600160008051602061275d83398151915255565b50565b61083d610ef7565b610845610f2f565b80516001600160a01b0380821660009081526020819052604090205416331461088157604051630143454560e01b815260040160405180910390fd5b60005b826020015151811015610819576108da8360000151846020015183815181106108af576108af6124e7565b6020026020010151856040015184815181106108cd576108cd6124e7565b6020026020010151610ff3565b50600101610884565b6108eb611147565b6108f4826111ec565b6108fe82826111f4565b5050565b600061090c6112b6565b5060008051602061273d83398151915290565b6000610929610ef7565b610931610f2f565b81516001600160a01b0380821660009081526020819052604090205416331461096d57604051630143454560e01b815260040160405180910390fd5b610984836000015184602001518560400151610ff3565b9150506105f3600160008051602061275d83398151915255565b6109a66112ff565b6109b0600061135a565b565b6000606080828080838160008051602061271d83398151915280549091501580156109df57506001810154155b610a285760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b60448201526064015b60405180910390fd5b610a306113cb565b610a3861148e565b60408051600080825260208201909252600f60f81b9c939b5091995046985030975095509350915050565b6040518060a00160405280606c81526020016126b1606c91398051906020012081565b610a8e610ef7565b610a96610f2f565b6000610b3b610b356040518060a00160405280606c81526020016126b1606c913980516020918201208651878301516040808a015180519086012060608b015160808b01519251610b1a9792939192019586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b604051602081830303815290604052805190602001206114cd565b83611500565b9050806001600160a01b031682600001516001600160a01b031614610b735760405163680a7f5760e11b815260040160405180910390fd5b6000610bbc610bad8560600151604051602001610b9291815260200190565b60405160208183030381529060405280519060200120611598565b856040015186606001516115fa565b9050806001600160a01b031684602001516001600160a01b031614610bf457604051639918f91160e01b815260040160405180910390fd5b83516001600160a01b039081166000818152600160209081526040808320828a015186168452909152908190205490516323b872dd60e01b815230600482015292851660248401526044830152906323b872dd90606401600060405180830381600087803b158015610c6557600080fd5b505af1158015610c79573d6000803e3d6000fd5b50505060208086015186516040516001600160a01b03878116825292831694509116917fa9aa76dc8d402b3621cd270e623dcae6acc94ab94199a5f20c4758aae86175db910160405180910390a350506108fe600160008051602061275d83398151915255565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b0316600081158015610d255750825b90506000826001600160401b03166001148015610d415750303b155b905081158015610d4f575080155b15610d6d5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610d9757845460ff60401b1916600160401b1785555b610da086611631565b610de96040518060400160405280600e81526020016d50726f64756374466163746f727960901b815250604051806040016040528060018152602001603160f81b815250611642565b610df1611654565b610df9611664565b610e01611674565b8315610e4757845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b6000610e5961167c565b905090565b610e666112ff565b6001600160a01b038116610e9057604051631e4fbdf760e01b815260006004820152602401610a1f565b6108328161135a565b610ea1610ef7565b610ea9610f2f565b80516001600160a01b03808216600090815260208190526040902054163314610ee557604051630143454560e01b815260040160405180910390fd5b61081982600001518360200151611686565b60008051602061275d833981519152805460011901610f2957604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16156109b05760405163d93c066560e01b815260040160405180910390fd5b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b0381166105f3576040516330be1a3d60e21b815260040160405180910390fd5b600160008051602061275d83398151915255565b6001600160a01b03808416600090815260016020908152604080832093861683529290529081205415611039576040516353eadbf760e11b815260040160405180910390fd5b6040516335313c2160e11b81526001600160a01b038381166004830152851690636a627842906024016020604051808303816000875af1158015611081573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a591906124fd565b6001600160a01b038086166000818152600160209081526040808320948916808452949091528082208590555193945084937f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c79190a46040516001600160a01b03838116825280851691908616907fa9aa76dc8d402b3621cd270e623dcae6acc94ab94199a5f20c4758aae86175db9060200160405180910390a39392505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806111ce57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166111c260008051602061273d833981519152546001600160a01b031690565b6001600160a01b031614155b156109b05760405163703e46dd60e11b815260040160405180910390fd5b6108326112ff565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561124e575060408051601f3d908101601f1916820190925261124b918101906124fd565b60015b61127657604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610a1f565b60008051602061273d83398151915281146112a757604051632a87526960e21b815260048101829052602401610a1f565b6112b18383611792565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109b05760405163703e46dd60e11b815260040160405180910390fd5b336113317f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146109b05760405163118cdaa760e01b8152336004820152602401610a1f565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d102805460609160008051602061271d8339815191529161140a90612516565b80601f016020809104026020016040519081016040528092919081815260200182805461143690612516565b80156114835780601f1061145857610100808354040283529160200191611483565b820191906000526020600020905b81548152906001019060200180831161146657829003601f168201915b505050505091505090565b7fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d103805460609160008051602061271d8339815191529161140a90612516565b60006114fa6114da61167c565b8360405161190160f01b8152600281019290925260228201526042902090565b92915050565b600042826080015110156115275760405163f6d5e7cb60e01b815260040160405180910390fd5b602080830151604080850151606080870151835160008082529681018086528a905260ff90951693850193909352830152608082015260019060a0016020604051602081039080840390855afa158015611585573d6000803e3d6000fd5b5050604051601f19015195945050505050565b6000604051806040016040528060188152602001772222a8242cafa4a22fa9a4a3a722a22fa6a2a9a9a0a3a29d60411b815250826040516020016115dd929190612550565b604051602081830303815290604052805190602001209050919050565b60004282101561161d57604051636932286960e11b815260040160405180910390fd5b61162784846117e8565b90505b9392505050565b611639611812565b6108328161185b565b61164a611812565b6108fe8282611863565b61165c611812565b6109b06118c4565b61166c611812565b6109b06118cc565b6109b0611812565b6000610e596118ff565b6001600160a01b038083166000908152600160209081526040808320938516835292905290812054156116cc576040516353eadbf760e11b815260040160405180910390fd5b6040516335313c2160e11b81523060048201526001600160a01b03841690636a627842906024016020604051808303816000875af1158015611712573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173691906124fd565b6001600160a01b038085166000818152600160209081526040808320948816808452949091528082208590555193945084937f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c79190a492915050565b61179b82611973565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156117e0576112b182826119d8565b6108fe611a4e565b6000806000806117f88686611a6d565b9250925092506118088282611aba565b5090949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166109b057604051631afcd79f60e31b815260040160405180910390fd5b610e66611812565b61186b611812565b60008051602061271d8339815191527fa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1026118a584826125c0565b50600381016118b483826125c0565b5060008082556001909101555050565b610fdf611812565b6118d4611812565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff19169055565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61192a611b73565b611932611bdd565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b806001600160a01b03163b6000036119a957604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610a1f565b60008051602061273d83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516119f5919061267e565b600060405180830381855af49150503d8060008114611a30576040519150601f19603f3d011682016040523d82523d6000602084013e611a35565b606091505b5091509150611a45858383611c21565b95945050505050565b34156109b05760405163b398979f60e01b815260040160405180910390fd5b60008060008351604103611aa75760208401516040850151606086015160001a611a9988828585611c7d565b955095509550505050611ab3565b50508151600091506002905b9250925092565b6000826003811115611ace57611ace61269a565b03611ad7575050565b6001826003811115611aeb57611aeb61269a565b03611b095760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115611b1d57611b1d61269a565b03611b3e5760405163fce698f760e01b815260048101829052602401610a1f565b6003826003811115611b5257611b5261269a565b036108fe576040516335e2f38360e21b815260048101829052602401610a1f565b600060008051602061271d83398151915281611b8d6113cb565b805190915015611ba557805160209091012092915050565b81548015611bb4579392505050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470935050505090565b600060008051602061271d83398151915281611bf761148e565b805190915015611c0f57805160209091012092915050565b60018201548015611bb4579392505050565b606082611c3657611c3182611d4c565b61162a565b8151158015611c4d57506001600160a01b0384163b155b15611c7657604051639996b31560e01b81526001600160a01b0385166004820152602401610a1f565b508061162a565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611cb85750600091506003905082611d42565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611d0c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d3857506000925060019150829050611d42565b9250600091508190505b9450945094915050565b805115611d5c5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715611dad57611dad611d75565b60405290565b604080519081016001600160401b0381118282101715611dad57611dad611d75565b604051606081016001600160401b0381118282101715611dad57611dad611d75565b604051601f8201601f191681016001600160401b0381118282101715611e1f57611e1f611d75565b604052919050565b80356001600160a01b03811681146105f357600080fd5b600082601f830112611e4f57600080fd5b8135602083016000806001600160401b03841115611e6f57611e6f611d75565b50601f8301601f1916602001611e8481611df7565b915050828152858383011115611e9957600080fd5b82826020830137600092810160200192909252509392505050565b600060208284031215611ec657600080fd5b81356001600160401b03811115611edc57600080fd5b820160808185031215611eee57600080fd5b611ef6611d8b565b611eff82611e27565b815260208201356001600160401b03811115611f1a57600080fd5b611f2686828501611e3e565b60208301525060408201356001600160401b03811115611f4557600080fd5b611f5186828501611e3e565b60408301525060608201356001600160401b03811115611f7057600080fd5b611f7c86828501611e3e565b606083015250949350505050565b60005b83811015611fa5578181015183820152602001611f8d565b50506000910152565b60008151808452611fc6816020860160208601611f8a565b601f01601f19169290920160200192915050565b60208152600061162a6020830184611fae565b600082601f830112611ffe57600080fd5b81356001600160401b0381111561201757612017611d75565b8060051b61202760208201611df7565b9182526020818501810192908101908684111561204357600080fd5b6020860192505b8383101561206c5761205b83611e27565b82526020928301929091019061204a565b9695505050505050565b60006020828403121561208857600080fd5b81356001600160401b0381111561209e57600080fd5b8201604081850312156120b057600080fd5b6120b8611db3565b6120c182611e27565b815260208201356001600160401b038111156120dc57600080fd5b6120e886828501611fed565b602083015250949350505050565b60006020828403121561210857600080fd5b81356001600160401b0381111561211e57600080fd5b82016060818503121561213057600080fd5b612138611dd5565b61214182611e27565b815260208201356001600160401b0381111561215c57600080fd5b61216886828501611fed565b60208301525060408201356001600160401b0381111561218757600080fd5b61219386828501611fed565b604083015250949350505050565b600080604083850312156121b457600080fd5b6121bd83611e27565b915060208301356001600160401b038111156121d857600080fd5b6121e485828601611e3e565b9150509250929050565b6000606082840312801561220157600080fd5b5061220a611dd5565b61221383611e27565b815261222160208401611e27565b602082015261223260408401611e27565b60408201529392505050565b6000806040838503121561225157600080fd5b61225a83611e27565b915061226860208401611e27565b90509250929050565b60ff60f81b8816815260e06020820152600061229060e0830189611fae565b82810360408401526122a28189611fae565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b818110156122f85783518352602093840193909201916001016122da565b50909b9a5050505050505050505050565b60006020828403121561231b57600080fd5b61162a82611e27565b600060a0828403121561233657600080fd5b60405160a081016001600160401b038111828210171561235857612358611d75565b60405290508061236783611e27565b8152602083013560ff8116811461237d57600080fd5b60208201526040838101359082015260608084013590820152608092830135920191909152919050565b60008060c083850312156123ba57600080fd5b82356001600160401b038111156123d057600080fd5b8301608081860312156123e257600080fd5b6123ea611d8b565b6123f382611e27565b815261240160208301611e27565b602082015260408201356001600160401b0381111561241f57600080fd5b61242b87828501611e3e565b6040830152506060918201359181019190915291506122688460208501612324565b6000604082840312801561246057600080fd5b50612469611db3565b61247283611e27565b815261248060208401611e27565b60208201529392505050565b60006020828403121561249e57600080fd5b8151801515811461162a57600080fd5b6060815260006124c16060830186611fae565b82810360208401526124d38186611fae565b9050828103604084015261206c8185611fae565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561250f57600080fd5b5051919050565b600181811c9082168061252a57607f821691505b60208210810361254a57634e487b7160e01b600052602260045260246000fd5b50919050565b60008351612562818460208801611f8a565b9190910191825250602001919050565b601f8211156112b157806000526020600020601f840160051c810160208510156125995750805b601f840160051c820191505b818110156125b957600081556001016125a5565b5050505050565b81516001600160401b038111156125d9576125d9611d75565b6125ed816125e78454612516565b84612572565b6020601f82116001811461262157600083156126095750848201515b600019600385901b1c1916600184901b1784556125b9565b600084815260208120601f198516915b828110156126515787850151825560209485019460019092019101612631565b508482101561266f5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60008251612690818460208701611f8a565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfe416374697661746544657669636528616464726573732070726f647563742c61646472657373206465766963652c6279746573206465766963655369676e61747572652c75696e7432353620646576696365446561646c696e652c75696e7432353620646561646c696e6529a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a264697066735822122088e3123e0fb6fa0954df9c6ab388e7ef9ffad0da9af00d6067643d9844033d1264736f6c634300081a0033"; + +type ProductFactoryConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: ProductFactoryConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class ProductFactory__factory extends ContractFactory { + constructor(...args: ProductFactoryConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override deploy( + overrides?: Overrides & { from?: string } + ): Promise { + return super.deploy(overrides || {}) as Promise; + } + override getDeployTransaction( + overrides?: Overrides & { from?: string } + ): TransactionRequest { + return super.getDeployTransaction(overrides || {}); + } + override attach(address: string): ProductFactory { + return super.attach(address) as ProductFactory; + } + override connect(signer: Signer): ProductFactory__factory { + return super.connect(signer) as ProductFactory__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): ProductFactoryInterface { + return new utils.Interface(_abi) as ProductFactoryInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): ProductFactory { + return new Contract(address, _abi, signerOrProvider) as ProductFactory; + } +} diff --git a/tool/src/typechain/factories/index.ts b/tool/src/generated/factories/index.ts similarity index 69% rename from tool/src/typechain/factories/index.ts rename to tool/src/generated/factories/index.ts index 0e7afb4..a7d3b07 100644 --- a/tool/src/typechain/factories/index.ts +++ b/tool/src/generated/factories/index.ts @@ -1,4 +1,5 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ +export { IProductFactory__factory } from "./IProductFactory__factory"; export { ProductFactory__factory } from "./ProductFactory__factory"; diff --git a/tool/src/typechain/index.ts b/tool/src/generated/index.ts similarity index 65% rename from tool/src/typechain/index.ts rename to tool/src/generated/index.ts index 46dbdd4..1aafa5f 100644 --- a/tool/src/typechain/index.ts +++ b/tool/src/generated/index.ts @@ -1,6 +1,8 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ +export type { IProductFactory } from "./IProductFactory"; export type { ProductFactory } from "./ProductFactory"; export * as factories from "./factories"; export { ProductFactory__factory } from "./factories/ProductFactory__factory"; +export { IProductFactory__factory } from "./factories/IProductFactory__factory"; diff --git a/tool/src/typechain/factories/ProductFactory__factory.ts b/tool/src/typechain/factories/ProductFactory__factory.ts deleted file mode 100644 index 8bdb083..0000000 --- a/tool/src/typechain/factories/ProductFactory__factory.ts +++ /dev/null @@ -1,590 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers"; -import type { Provider, TransactionRequest } from "@ethersproject/providers"; -import type { - ProductFactory, - ProductFactoryInterface, -} from "../ProductFactory"; - -const _abi = [ - { - type: "constructor", - inputs: [ - { - name: "initialOwner", - type: "address", - internalType: "address", - }, - ], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "ACTIVATE_DEVICE_TYPEHASH", - inputs: [], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "activateDevice", - inputs: [ - { - name: "args", - type: "tuple", - internalType: "struct ProductFactory.ActivateDeviceArgs", - components: [ - { - name: "product", - type: "address", - internalType: "address", - }, - { - name: "device", - type: "address", - internalType: "address", - }, - { - name: "deviceSignature", - type: "bytes", - internalType: "bytes", - }, - { - name: "deviceDeadline", - type: "uint256", - internalType: "uint256", - }, - ], - }, - { - name: "signature", - type: "tuple", - internalType: "struct ProductFactory.EIP712Signature", - components: [ - { - name: "signer", - type: "address", - internalType: "address", - }, - { - name: "v", - type: "uint8", - internalType: "uint8", - }, - { - name: "r", - type: "bytes32", - internalType: "bytes32", - }, - { - name: "s", - type: "bytes32", - internalType: "bytes32", - }, - { - name: "deadline", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "createActivatedDevices", - inputs: [ - { - name: "args", - type: "tuple", - internalType: "struct ProductFactory.CreateActivatedDevicesArgs", - components: [ - { - name: "product", - type: "address", - internalType: "address", - }, - { - name: "devices", - type: "address[]", - internalType: "address[]", - }, - { - name: "receivers", - type: "address[]", - internalType: "address[]", - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "createDevices", - inputs: [ - { - name: "args", - type: "tuple", - internalType: "struct ProductFactory.CreateDevicesArgs", - components: [ - { - name: "product", - type: "address", - internalType: "address", - }, - { - name: "devices", - type: "address[]", - internalType: "address[]", - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "createProduct", - inputs: [ - { - name: "args", - type: "tuple", - internalType: "struct ProductFactory.CreateProductArgs", - components: [ - { - name: "productImpl", - type: "address", - internalType: "address", - }, - { - name: "name", - type: "string", - internalType: "string", - }, - { - name: "symbol", - type: "string", - internalType: "string", - }, - { - name: "baseTokenURI", - type: "string", - internalType: "string", - }, - ], - }, - ], - outputs: [ - { - name: "", - type: "address", - internalType: "address", - }, - ], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "eip712Domain", - inputs: [], - outputs: [ - { - name: "fields", - type: "bytes1", - internalType: "bytes1", - }, - { - name: "name", - type: "string", - internalType: "string", - }, - { - name: "version", - type: "string", - internalType: "string", - }, - { - name: "chainId", - type: "uint256", - internalType: "uint256", - }, - { - name: "verifyingContract", - type: "address", - internalType: "address", - }, - { - name: "salt", - type: "bytes32", - internalType: "bytes32", - }, - { - name: "extensions", - type: "uint256[]", - internalType: "uint256[]", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getDeviceTokenId", - inputs: [ - { - name: "product", - type: "address", - internalType: "address", - }, - { - name: "device", - type: "address", - internalType: "address", - }, - ], - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getDomainSeparator", - inputs: [], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getVendorByProduct", - inputs: [ - { - name: "product", - type: "address", - internalType: "address", - }, - ], - outputs: [ - { - name: "", - type: "address", - internalType: "address", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "owner", - inputs: [], - outputs: [ - { - name: "", - type: "address", - internalType: "address", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "renounceOwnership", - inputs: [], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "transferOwnership", - inputs: [ - { - name: "newOwner", - type: "address", - internalType: "address", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "event", - name: "DeviceActivated", - inputs: [ - { - name: "product", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "device", - type: "address", - indexed: true, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "DeviceCreated", - inputs: [ - { - name: "product", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "device", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "tokenId", - type: "uint256", - indexed: true, - internalType: "uint256", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "EIP712DomainChanged", - inputs: [], - anonymous: false, - }, - { - type: "event", - name: "OwnershipTransferred", - inputs: [ - { - name: "previousOwner", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "newOwner", - type: "address", - indexed: true, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "ProductCreated", - inputs: [ - { - name: "vendor", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "productImpl", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "product", - type: "address", - indexed: true, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "error", - name: "DeviceAlreadyCreated", - inputs: [], - }, - { - type: "error", - name: "DeviceSignatureExpired", - inputs: [], - }, - { - type: "error", - name: "DeviceSignatureMismatch", - inputs: [], - }, - { - type: "error", - name: "ECDSAInvalidSignature", - inputs: [], - }, - { - type: "error", - name: "ECDSAInvalidSignatureLength", - inputs: [ - { - name: "length", - type: "uint256", - internalType: "uint256", - }, - ], - }, - { - type: "error", - name: "ECDSAInvalidSignatureS", - inputs: [ - { - name: "s", - type: "bytes32", - internalType: "bytes32", - }, - ], - }, - { - type: "error", - name: "EIP712SignatureExpired", - inputs: [], - }, - { - type: "error", - name: "EIP712SignatureMismatch", - inputs: [], - }, - { - type: "error", - name: "ERC1167FailedCreateClone", - inputs: [], - }, - { - type: "error", - name: "InvalidShortString", - inputs: [], - }, - { - type: "error", - name: "NotProductTemplate", - inputs: [], - }, - { - type: "error", - name: "NotVendor", - inputs: [], - }, - { - type: "error", - name: "OwnableInvalidOwner", - inputs: [ - { - name: "owner", - type: "address", - internalType: "address", - }, - ], - }, - { - type: "error", - name: "OwnableUnauthorizedAccount", - inputs: [ - { - name: "account", - type: "address", - internalType: "address", - }, - ], - }, - { - type: "error", - name: "StringTooLong", - inputs: [ - { - name: "str", - type: "string", - internalType: "string", - }, - ], - }, - { - type: "error", - name: "TokenIdMismatch", - inputs: [], - }, -] as const; - -const _bytecode = - "0x61016060405234801561001157600080fd5b50604051611e2d380380611e2d8339810160408190526100309161021f565b604080518082018252600e81526d50726f64756374466163746f727960901b602080830191909152825180840190935260018352603160f81b9083015290826001600160a01b03811661009e57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6100a78161015e565b506100b38260016101ae565b610120526100c28160026101ae565b61014052815160208084019190912060e052815190820120610100524660a05261014f60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0525061041e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020835110156101ca576101c3836101e1565b90506101db565b816101d584826102ee565b5060ff90505b92915050565b600080829050601f8151111561020c578260405163305a27a960e01b815260040161009591906103ac565b8051610217826103fa565b179392505050565b60006020828403121561023157600080fd5b81516001600160a01b038116811461024857600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061027957607f821691505b60208210810361029957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156102e957806000526020600020601f840160051c810160208510156102c65750805b601f840160051c820191505b818110156102e657600081556001016102d2565b50505b505050565b81516001600160401b038111156103075761030761024f565b61031b816103158454610265565b8461029f565b6020601f82116001811461034f57600083156103375750848201515b600019600385901b1c1916600184901b1784556102e6565b600084815260208120601f198516915b8281101561037f578785015182556020948501946001909201910161035f565b508482101561039d5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b602081526000825180602084015260005b818110156103da57602081860181015160408684010152016103bd565b506000604082850101526040601f19601f83011684010191505092915050565b805160208083015191908110156102995760001960209190910360031b1b16919050565b60805160a05160c05160e0516101005161012051610140516119b56104786000396000610c8601526000610c5901526000610e8001526000610e5801526000610db301526000610ddd01526000610e0701526119b56000f3fe608060405234801561001057600080fd5b50600436106100b35760003560e01c80638da5cb5b116100715780638da5cb5b14610154578063904b55a514610165578063b063cb5414610191578063bb189de114610199578063ed24911d146101ac578063f2fde38b146101b457600080fd5b80622ca198146100b85780633a7eece8146100e85780634be60db3146100fd5780635d25e63214610110578063715018a61461013157806384b0196e14610139575b600080fd5b6100cb6100c636600461130f565b6101c7565b6040516001600160a01b0390911681526020015b60405180910390f35b6100fb6100f636600461146e565b610339565b005b6100fb61010b36600461150b565b61054f565b61012361011e3660046115b6565b6107f4565b6040519081526020016100df565b6100fb610821565b610141610835565b6040516100df979695949392919061162f565b6000546001600160a01b03166100cb565b6100cb6101733660046116c7565b6001600160a01b039081166000908152600360205260409020541690565b61012361087b565b6100fb6101a7366004611765565b61089e565b610123610b11565b6100fb6101c23660046116c7565b610b20565b80516040516301ffc9a760e01b815263360ff5e360e01b60048201526000916001600160a01b0316906301ffc9a790602401602060405180830381865afa158015610216573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023a919061181f565b61025757604051630fb9181b60e11b815260040160405180910390fd5b60006102668360000151610b63565b9050806001600160a01b0316635c6d8da1846020015185604001518660600151306040518563ffffffff1660e01b81526004016102a69493929190611841565b600060405180830381600087803b1580156102c057600080fd5b505af11580156102d4573d6000803e3d6000fd5b5050506001600160a01b0380831660008181526003602052604080822080546001600160a01b0319163390811790915588519151939550931692917f0d516d8b14b989f8763b7f1b93e8e08f0f5ff06e0b833b8d080f0f1f33f9f3029190a492915050565b80516001600160a01b0380821660009081526003602052604090205416331461037557604051630143454560e01b815260040160405180910390fd5b60005b82602001515181101561054a5782516001600160a01b031660009081526004602090815260408220908501518051839190859081106103b9576103b9611894565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020541115610401576040516353eadbf760e11b815260040160405180910390fd5b82516040516335313c2160e11b81523060048201526000916001600160a01b031690636a627842906024016020604051808303816000875af115801561044b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046f91906118aa565b9050806004600086600001516001600160a01b03166001600160a01b031681526020019081526020016000206000866020015185815181106104b3576104b3611894565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208190555080846020015183815181106104f6576104f6611894565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a450600101610378565b505050565b80516001600160a01b0380821660009081526003602052604090205416331461058b57604051630143454560e01b815260040160405180910390fd5b60005b82602001515181101561054a5782516001600160a01b031660009081526004602090815260408220908501518051839190859081106105cf576105cf611894565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020541115610617576040516353eadbf760e11b815260040160405180910390fd5b600083600001516001600160a01b0316636a6278428560400151848151811061064257610642611894565b60200260200101516040518263ffffffff1660e01b815260040161067591906001600160a01b0391909116815260200190565b6020604051808303816000875af1158015610694573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b891906118aa565b9050806004600086600001516001600160a01b03166001600160a01b031681526020019081526020016000206000866020015185815181106106fc576106fc611894565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808460200151838151811061073f5761073f611894565b60200260200101516001600160a01b031685600001516001600160a01b03167f9f8ee02843e6d9d43d51ce2e6063a09267f22193680a24600bf13e4efca5d0c760405160405180910390a4836040015182815181106107a0576107a0611894565b60200260200101516001600160a01b031684600001516001600160a01b03167ff297737e991455288ddb7481b53c270d8821275ddfdf4e82af900234f8e2925960405160405180910390a35060010161058e565b6001600160a01b038083166000908152600460209081526040808320938516835292905220545b92915050565b610829610bd5565b6108336000610c02565b565b600060608060008060006060610849610c52565b610851610c7f565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6040518060a00160405280606c8152602001611914606c91398051906020012081565b600061094361093d6040518060a00160405280606c8152602001611914606c913980516020918201208651878301516040808a015180519086012060608b015160808b015192516109229792939192019586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b60405160208183030381529060405280519060200120610cac565b83610cd9565b9050806001600160a01b031682600001516001600160a01b03161461097b5760405163680a7f5760e11b815260040160405180910390fd5b6000610a096109fa856060015160405160200161099a91815260200190565b60408051601f1981840301815282825280516020918201207f44455048595f49445f5349474e45445f4d4553534147453a000000000000000084830152603880850191909152825180850390910181526058909301909152815191012090565b85604001518660600151610d71565b9050806001600160a01b031684602001516001600160a01b031614610a4157604051639918f91160e01b815260040160405180910390fd5b83516001600160a01b039081166000818152600460208181526040808420828b015187168552909152918290205491516323b872dd60e01b8152309181019190915292851660248401526044830152906323b872dd90606401600060405180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b505050602085015185516040516001600160a01b0392831693509116907ff297737e991455288ddb7481b53c270d8821275ddfdf4e82af900234f8e2925990600090a350505050565b6000610b1b610da6565b905090565b610b28610bd5565b6001600160a01b038116610b5757604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b610b6081610c02565b50565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116610bd0576040516330be1a3d60e21b815260040160405180910390fd5b919050565b6000546001600160a01b031633146108335760405163118cdaa760e01b8152336004820152602401610b4e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060610b1b7f00000000000000000000000000000000000000000000000000000000000000006001610ed1565b6060610b1b7f00000000000000000000000000000000000000000000000000000000000000006002610ed1565b600061081b610cb9610da6565b8360405161190160f01b8152600281019290925260228201526042902090565b60004282608001511015610d005760405163f6d5e7cb60e01b815260040160405180910390fd5b602080830151604080850151606080870151835160008082529681018086528a905260ff90951693850193909352830152608082015260019060a0016020604051602081039080840390855afa158015610d5e573d6000803e3d6000fd5b5050604051601f19015195945050505050565b600042821015610d9457604051636932286960e11b815260040160405180910390fd5b610d9e8484610f7c565b949350505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610dff57507f000000000000000000000000000000000000000000000000000000000000000046145b15610e2957507f000000000000000000000000000000000000000000000000000000000000000090565b610b1b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b606060ff8314610eeb57610ee483610fa6565b905061081b565b818054610ef7906118c3565b80601f0160208091040260200160405190810160405280929190818152602001828054610f23906118c3565b8015610f705780601f10610f4557610100808354040283529160200191610f70565b820191906000526020600020905b815481529060010190602001808311610f5357829003601f168201915b5050505050905061081b565b600080600080610f8c8686610fe5565b925092509250610f9c8282611032565b5090949350505050565b60606000610fb3836110ef565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6000806000835160410361101f5760208401516040850151606086015160001a61101188828585611117565b95509550955050505061102b565b50508151600091506002905b9250925092565b6000826003811115611046576110466118fd565b0361104f575050565b6001826003811115611063576110636118fd565b036110815760405163f645eedf60e01b815260040160405180910390fd5b6002826003811115611095576110956118fd565b036110b65760405163fce698f760e01b815260048101829052602401610b4e565b60038260038111156110ca576110ca6118fd565b036110eb576040516335e2f38360e21b815260048101829052602401610b4e565b5050565b600060ff8216601f81111561081b57604051632cd44ac360e21b815260040160405180910390fd5b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561115257506000915060039050826111dc565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156111a6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166111d2575060009250600191508290506111dc565b9250600091508190505b9450945094915050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b038111828210171561121e5761121e6111e6565b60405290565b604051606081016001600160401b038111828210171561121e5761121e6111e6565b604051601f8201601f191681016001600160401b038111828210171561126e5761126e6111e6565b604052919050565b80356001600160a01b0381168114610bd057600080fd5b6000806001600160401b038411156112a7576112a76111e6565b50601f8301601f19166020016112bc81611246565b9150508281528383830111156112d157600080fd5b828260208301376000602084830101529392505050565b600082601f8301126112f957600080fd5b6113088383356020850161128d565b9392505050565b60006020828403121561132157600080fd5b81356001600160401b0381111561133757600080fd5b82016080818503121561134957600080fd5b6113516111fc565b61135a82611276565b815260208201356001600160401b0381111561137557600080fd5b611381868285016112e8565b60208301525060408201356001600160401b038111156113a057600080fd5b6113ac868285016112e8565b60408301525060608201356001600160401b038111156113cb57600080fd5b6113d7868285016112e8565b606083015250949350505050565b600082601f8301126113f657600080fd5b81356001600160401b0381111561140f5761140f6111e6565b8060051b61141f60208201611246565b9182526020818501810192908101908684111561143b57600080fd5b6020860192505b838310156114645761145383611276565b825260209283019290910190611442565b9695505050505050565b60006020828403121561148057600080fd5b81356001600160401b0381111561149657600080fd5b8201604081850312156114a857600080fd5b604080519081016001600160401b03811182821017156114ca576114ca6111e6565b6040526114d682611276565b815260208201356001600160401b038111156114f157600080fd5b6114fd868285016113e5565b602083015250949350505050565b60006020828403121561151d57600080fd5b81356001600160401b0381111561153357600080fd5b82016060818503121561154557600080fd5b61154d611224565b61155682611276565b815260208201356001600160401b0381111561157157600080fd5b61157d868285016113e5565b60208301525060408201356001600160401b0381111561159c57600080fd5b6115a8868285016113e5565b604083015250949350505050565b600080604083850312156115c957600080fd5b6115d283611276565b91506115e060208401611276565b90509250929050565b6000815180845260005b8181101561160f576020818501810151868301820152016115f3565b506000602082860101526020601f19601f83011685010191505092915050565b60ff60f81b8816815260e06020820152600061164e60e08301896115e9565b828103604084015261166081896115e9565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501528451808252602080870193509091019060005b818110156116b6578351835260209384019390920191600101611698565b50909b9a5050505050505050505050565b6000602082840312156116d957600080fd5b61130882611276565b600060a082840312156116f457600080fd5b60405160a081016001600160401b0381118282101715611716576117166111e6565b60405290508061172583611276565b8152602083013560ff8116811461173b57600080fd5b60208201526040838101359082015260608084013590820152608092830135920191909152919050565b60008060c0838503121561177857600080fd5b82356001600160401b0381111561178e57600080fd5b8301608081860312156117a057600080fd5b6117a86111fc565b6117b182611276565b81526117bf60208301611276565b602082015260408201356001600160401b038111156117dd57600080fd5b8201601f810187136117ee57600080fd5b6117fd8782356020840161128d565b6040830152506060918201359181019190915291506115e084602085016116e2565b60006020828403121561183157600080fd5b8151801515811461130857600080fd5b60808152600061185460808301876115e9565b828103602084015261186681876115e9565b9050828103604084015261187a81866115e9565b91505060018060a01b038316606083015295945050505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156118bc57600080fd5b5051919050565b600181811c908216806118d757607f821691505b6020821081036118f757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052602160045260246000fdfe416374697661746544657669636528616464726573732070726f647563742c61646472657373206465766963652c6279746573206465766963655369676e61747572652c75696e7432353620646576696365446561646c696e652c75696e7432353620646561646c696e6529a26469706673582212205aae321411c9f4bb762f3838fd491f112fc34ff33add75c3b487b884160409fb64736f6c634300081a0033"; - -type ProductFactoryConstructorParams = - | [signer?: Signer] - | ConstructorParameters; - -const isSuperArgs = ( - xs: ProductFactoryConstructorParams -): xs is ConstructorParameters => xs.length > 1; - -export class ProductFactory__factory extends ContractFactory { - constructor(...args: ProductFactoryConstructorParams) { - if (isSuperArgs(args)) { - super(...args); - } else { - super(_abi, _bytecode, args[0]); - } - } - - override deploy( - initialOwner: string, - overrides?: Overrides & { from?: string } - ): Promise { - return super.deploy( - initialOwner, - overrides || {} - ) as Promise; - } - override getDeployTransaction( - initialOwner: string, - overrides?: Overrides & { from?: string } - ): TransactionRequest { - return super.getDeployTransaction(initialOwner, overrides || {}); - } - override attach(address: string): ProductFactory { - return super.attach(address) as ProductFactory; - } - override connect(signer: Signer): ProductFactory__factory { - return super.connect(signer) as ProductFactory__factory; - } - - static readonly bytecode = _bytecode; - static readonly abi = _abi; - static createInterface(): ProductFactoryInterface { - return new utils.Interface(_abi) as ProductFactoryInterface; - } - static connect( - address: string, - signerOrProvider: Signer | Provider - ): ProductFactory { - return new Contract(address, _abi, signerOrProvider) as ProductFactory; - } -} From 5513672ac88fd8bb44619687a521fcf160810b5c Mon Sep 17 00:00:00 2001 From: CanvasL <746591811@qq.com> Date: Wed, 24 Jul 2024 16:08:50 +0800 Subject: [PATCH 3/4] feat: device-simulator --- pnpm-lock.yaml | 48 ++++++- pnpm-workspace.yaml | 4 +- .../contracts-demo}/.gitignore | 0 .../contracts-demo}/README.md | 0 .../contracts-demo}/index.html | 0 .../contracts-demo}/package.json | 2 +- .../contracts-demo}/public/vite.svg | 0 .../contracts-demo}/src/App.css | 0 .../contracts-demo}/src/App.scss | 0 .../contracts-demo}/src/App.tsx | 4 +- .../contracts-demo}/src/index.css | 0 .../contracts-demo}/src/main.tsx | 0 .../contracts-demo}/tsconfig.json | 0 .../contracts-demo}/tsconfig.node.json | 0 .../contracts-demo}/vite.config.ts | 0 .../contracts-sdk}/dist/ProductFactory.d.ts | 0 .../contracts-sdk}/dist/ProductFactory.js | 0 .../dist/generated/IProductFactory.d.ts | 0 .../dist/generated/IProductFactory.js | 0 .../dist/generated/ProductFactory.d.ts | 0 .../dist/generated/ProductFactory.js | 0 .../contracts-sdk}/dist/generated/common.d.ts | 0 .../contracts-sdk}/dist/generated/common.js | 0 .../factories/IProductFactory__factory.d.ts | 0 .../factories/IProductFactory__factory.js | 0 .../factories/ProductFactory__factory.d.ts | 0 .../factories/ProductFactory__factory.js | 0 .../dist/generated/factories/index.d.ts | 0 .../dist/generated/factories/index.js | 0 .../contracts-sdk}/dist/generated/index.d.ts | 0 .../contracts-sdk}/dist/generated/index.js | 0 .../contracts-sdk}/dist/index.d.ts | 0 .../contracts-sdk}/dist/index.js | 0 .../contracts-sdk}/dist/types/chain.d.ts | 0 .../contracts-sdk}/dist/types/chain.js | 0 .../contracts-sdk}/dist/types/index.d.ts | 0 .../contracts-sdk}/dist/types/index.js | 0 .../contracts-sdk}/dist/utils/index.d.ts | 0 .../contracts-sdk}/dist/utils/index.js | 0 .../contracts-sdk}/dist/utils/timestamp.d.ts | 0 .../contracts-sdk}/dist/utils/timestamp.js | 0 tool/packages/contracts-sdk/package.json | 22 ++++ .../contracts-sdk}/src/ProductFactory.ts | 0 .../src/generated/IProductFactory.ts | 0 .../src/generated/ProductFactory.ts | 0 .../contracts-sdk}/src/generated/common.ts | 0 .../factories/IProductFactory__factory.ts | 0 .../factories/ProductFactory__factory.ts | 0 .../src/generated/factories/index.ts | 0 .../contracts-sdk}/src/generated/index.ts | 0 .../{ => packages/contracts-sdk}/src/index.ts | 0 .../contracts-sdk}/src/types/chain.ts | 0 .../contracts-sdk}/src/types/index.ts | 0 .../contracts-sdk}/src/utils/index.ts | 0 .../contracts-sdk}/src/utils/timestamp.ts | 0 tool/packages/contracts-sdk/tsconfig.json | 15 +++ tool/packages/device-simulator/dist/cli.js | 86 +++++++++++++ tool/packages/device-simulator/dist/index.js | 17 +++ tool/packages/device-simulator/package.json | 22 ++++ tool/packages/device-simulator/src/cli.ts | 119 ++++++++++++++++++ tool/packages/device-simulator/src/index.ts | 1 + tool/packages/device-simulator/tsconfig.json | 10 ++ tool/tsconfig.json | 1 - 63 files changed, 342 insertions(+), 9 deletions(-) rename tool/{demo => packages/contracts-demo}/.gitignore (100%) rename tool/{demo => packages/contracts-demo}/README.md (100%) rename tool/{demo => packages/contracts-demo}/index.html (100%) rename tool/{demo => packages/contracts-demo}/package.json (94%) rename tool/{demo => packages/contracts-demo}/public/vite.svg (100%) rename tool/{demo => packages/contracts-demo}/src/App.css (100%) rename tool/{demo => packages/contracts-demo}/src/App.scss (100%) rename tool/{demo => packages/contracts-demo}/src/App.tsx (98%) rename tool/{demo => packages/contracts-demo}/src/index.css (100%) rename tool/{demo => packages/contracts-demo}/src/main.tsx (100%) rename tool/{demo => packages/contracts-demo}/tsconfig.json (100%) rename tool/{demo => packages/contracts-demo}/tsconfig.node.json (100%) rename tool/{demo => packages/contracts-demo}/vite.config.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/ProductFactory.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/ProductFactory.js (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/IProductFactory.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/IProductFactory.js (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/ProductFactory.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/ProductFactory.js (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/common.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/common.js (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/factories/IProductFactory__factory.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/factories/IProductFactory__factory.js (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/factories/ProductFactory__factory.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/factories/ProductFactory__factory.js (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/factories/index.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/factories/index.js (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/index.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/generated/index.js (100%) rename tool/{ => packages/contracts-sdk}/dist/index.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/index.js (100%) rename tool/{ => packages/contracts-sdk}/dist/types/chain.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/types/chain.js (100%) rename tool/{ => packages/contracts-sdk}/dist/types/index.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/types/index.js (100%) rename tool/{ => packages/contracts-sdk}/dist/utils/index.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/utils/index.js (100%) rename tool/{ => packages/contracts-sdk}/dist/utils/timestamp.d.ts (100%) rename tool/{ => packages/contracts-sdk}/dist/utils/timestamp.js (100%) create mode 100644 tool/packages/contracts-sdk/package.json rename tool/{ => packages/contracts-sdk}/src/ProductFactory.ts (100%) rename tool/{ => packages/contracts-sdk}/src/generated/IProductFactory.ts (100%) rename tool/{ => packages/contracts-sdk}/src/generated/ProductFactory.ts (100%) rename tool/{ => packages/contracts-sdk}/src/generated/common.ts (100%) rename tool/{ => packages/contracts-sdk}/src/generated/factories/IProductFactory__factory.ts (100%) rename tool/{ => packages/contracts-sdk}/src/generated/factories/ProductFactory__factory.ts (100%) rename tool/{ => packages/contracts-sdk}/src/generated/factories/index.ts (100%) rename tool/{ => packages/contracts-sdk}/src/generated/index.ts (100%) rename tool/{ => packages/contracts-sdk}/src/index.ts (100%) rename tool/{ => packages/contracts-sdk}/src/types/chain.ts (100%) rename tool/{ => packages/contracts-sdk}/src/types/index.ts (100%) rename tool/{ => packages/contracts-sdk}/src/utils/index.ts (100%) rename tool/{ => packages/contracts-sdk}/src/utils/timestamp.ts (100%) create mode 100644 tool/packages/contracts-sdk/tsconfig.json create mode 100644 tool/packages/device-simulator/dist/cli.js create mode 100644 tool/packages/device-simulator/dist/index.js create mode 100644 tool/packages/device-simulator/package.json create mode 100644 tool/packages/device-simulator/src/cli.ts create mode 100644 tool/packages/device-simulator/src/index.ts create mode 100644 tool/packages/device-simulator/tsconfig.json diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e6448cb..1c4156c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,11 +74,11 @@ importers: specifier: ^8.3.1 version: 8.3.1(typescript@5.0.2) - tool/demo: + tool/packages/contracts-demo: dependencies: dephy-id-evm-tool: specifier: workspace:* - version: link:.. + version: link:../.. ethers: specifier: ^5.7.2 version: 5.7.2 @@ -114,6 +114,50 @@ importers: specifier: ^2.4.4 version: 2.4.4 + tool/packages/contracts-sdk: + dependencies: + ethers: + specifier: ^5.7.2 + version: 5.7.2 + typescript: + specifier: ^5.0.0 + version: 5.0.2 + devDependencies: + '@ethersproject/abi': + specifier: ^5.7.0 + version: 5.7.0 + '@ethersproject/providers': + specifier: ^5.7.2 + version: 5.7.2 + '@typechain/ethers-v5': + specifier: ^11.1.1 + version: 11.1.1(@ethersproject/abi@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.3.1)(typescript@5.0.2) + rimraf: + specifier: ^6.0.0 + version: 6.0.0 + typechain: + specifier: ^8.3.1 + version: 8.3.1(typescript@5.0.2) + + tool/packages/device-simulator: + dependencies: + ethers: + specifier: ^5.7.2 + version: 5.7.2 + typescript: + specifier: ^5.0.0 + version: 5.0.2 + yargs: + specifier: ^17.7.2 + version: 17.7.2 + devDependencies: + '@types/yargs': + specifier: ^17.0.32 + version: 17.0.32 + rimraf: + specifier: ^6.0.0 + version: 6.0.0 + packages: /@adraffy/ens-normalize@1.10.0: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1f81ab6..9490208 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,5 +1,3 @@ packages: - - "." - - "tool" - - "tool/demo" + - "tool/**" - "templates" diff --git a/tool/demo/.gitignore b/tool/packages/contracts-demo/.gitignore similarity index 100% rename from tool/demo/.gitignore rename to tool/packages/contracts-demo/.gitignore diff --git a/tool/demo/README.md b/tool/packages/contracts-demo/README.md similarity index 100% rename from tool/demo/README.md rename to tool/packages/contracts-demo/README.md diff --git a/tool/demo/index.html b/tool/packages/contracts-demo/index.html similarity index 100% rename from tool/demo/index.html rename to tool/packages/contracts-demo/index.html diff --git a/tool/demo/package.json b/tool/packages/contracts-demo/package.json similarity index 94% rename from tool/demo/package.json rename to tool/packages/contracts-demo/package.json index d20005c..2a3aa06 100644 --- a/tool/demo/package.json +++ b/tool/packages/contracts-demo/package.json @@ -1,5 +1,5 @@ { - "name": "dephy-id-evm-tool-demo", + "name": "tool-contracts-demo", "private": true, "version": "0.0.0", "scripts": { diff --git a/tool/demo/public/vite.svg b/tool/packages/contracts-demo/public/vite.svg similarity index 100% rename from tool/demo/public/vite.svg rename to tool/packages/contracts-demo/public/vite.svg diff --git a/tool/demo/src/App.css b/tool/packages/contracts-demo/src/App.css similarity index 100% rename from tool/demo/src/App.css rename to tool/packages/contracts-demo/src/App.css diff --git a/tool/demo/src/App.scss b/tool/packages/contracts-demo/src/App.scss similarity index 100% rename from tool/demo/src/App.scss rename to tool/packages/contracts-demo/src/App.scss diff --git a/tool/demo/src/App.tsx b/tool/packages/contracts-demo/src/App.tsx similarity index 98% rename from tool/demo/src/App.tsx rename to tool/packages/contracts-demo/src/App.tsx index 0ee1384..27f886e 100644 --- a/tool/demo/src/App.tsx +++ b/tool/packages/contracts-demo/src/App.tsx @@ -1,8 +1,8 @@ import React, { useState, useEffect } from "react"; import "./App.scss"; import { ContractTransaction, Signer, ethers } from "ethers"; -import { ProductFactory, ChainId } from "../../dist"; -import ADDRESS_JSON from "../../../addresses.json"; +import { ProductFactory, ChainId } from "dephy-id-evm-tool/dist"; +import ADDRESS_JSON from "../../../../addresses.json"; const BASE_SEPOLIA_PARAMS = { chainId: "0x14a34", diff --git a/tool/demo/src/index.css b/tool/packages/contracts-demo/src/index.css similarity index 100% rename from tool/demo/src/index.css rename to tool/packages/contracts-demo/src/index.css diff --git a/tool/demo/src/main.tsx b/tool/packages/contracts-demo/src/main.tsx similarity index 100% rename from tool/demo/src/main.tsx rename to tool/packages/contracts-demo/src/main.tsx diff --git a/tool/demo/tsconfig.json b/tool/packages/contracts-demo/tsconfig.json similarity index 100% rename from tool/demo/tsconfig.json rename to tool/packages/contracts-demo/tsconfig.json diff --git a/tool/demo/tsconfig.node.json b/tool/packages/contracts-demo/tsconfig.node.json similarity index 100% rename from tool/demo/tsconfig.node.json rename to tool/packages/contracts-demo/tsconfig.node.json diff --git a/tool/demo/vite.config.ts b/tool/packages/contracts-demo/vite.config.ts similarity index 100% rename from tool/demo/vite.config.ts rename to tool/packages/contracts-demo/vite.config.ts diff --git a/tool/dist/ProductFactory.d.ts b/tool/packages/contracts-sdk/dist/ProductFactory.d.ts similarity index 100% rename from tool/dist/ProductFactory.d.ts rename to tool/packages/contracts-sdk/dist/ProductFactory.d.ts diff --git a/tool/dist/ProductFactory.js b/tool/packages/contracts-sdk/dist/ProductFactory.js similarity index 100% rename from tool/dist/ProductFactory.js rename to tool/packages/contracts-sdk/dist/ProductFactory.js diff --git a/tool/dist/generated/IProductFactory.d.ts b/tool/packages/contracts-sdk/dist/generated/IProductFactory.d.ts similarity index 100% rename from tool/dist/generated/IProductFactory.d.ts rename to tool/packages/contracts-sdk/dist/generated/IProductFactory.d.ts diff --git a/tool/dist/generated/IProductFactory.js b/tool/packages/contracts-sdk/dist/generated/IProductFactory.js similarity index 100% rename from tool/dist/generated/IProductFactory.js rename to tool/packages/contracts-sdk/dist/generated/IProductFactory.js diff --git a/tool/dist/generated/ProductFactory.d.ts b/tool/packages/contracts-sdk/dist/generated/ProductFactory.d.ts similarity index 100% rename from tool/dist/generated/ProductFactory.d.ts rename to tool/packages/contracts-sdk/dist/generated/ProductFactory.d.ts diff --git a/tool/dist/generated/ProductFactory.js b/tool/packages/contracts-sdk/dist/generated/ProductFactory.js similarity index 100% rename from tool/dist/generated/ProductFactory.js rename to tool/packages/contracts-sdk/dist/generated/ProductFactory.js diff --git a/tool/dist/generated/common.d.ts b/tool/packages/contracts-sdk/dist/generated/common.d.ts similarity index 100% rename from tool/dist/generated/common.d.ts rename to tool/packages/contracts-sdk/dist/generated/common.d.ts diff --git a/tool/dist/generated/common.js b/tool/packages/contracts-sdk/dist/generated/common.js similarity index 100% rename from tool/dist/generated/common.js rename to tool/packages/contracts-sdk/dist/generated/common.js diff --git a/tool/dist/generated/factories/IProductFactory__factory.d.ts b/tool/packages/contracts-sdk/dist/generated/factories/IProductFactory__factory.d.ts similarity index 100% rename from tool/dist/generated/factories/IProductFactory__factory.d.ts rename to tool/packages/contracts-sdk/dist/generated/factories/IProductFactory__factory.d.ts diff --git a/tool/dist/generated/factories/IProductFactory__factory.js b/tool/packages/contracts-sdk/dist/generated/factories/IProductFactory__factory.js similarity index 100% rename from tool/dist/generated/factories/IProductFactory__factory.js rename to tool/packages/contracts-sdk/dist/generated/factories/IProductFactory__factory.js diff --git a/tool/dist/generated/factories/ProductFactory__factory.d.ts b/tool/packages/contracts-sdk/dist/generated/factories/ProductFactory__factory.d.ts similarity index 100% rename from tool/dist/generated/factories/ProductFactory__factory.d.ts rename to tool/packages/contracts-sdk/dist/generated/factories/ProductFactory__factory.d.ts diff --git a/tool/dist/generated/factories/ProductFactory__factory.js b/tool/packages/contracts-sdk/dist/generated/factories/ProductFactory__factory.js similarity index 100% rename from tool/dist/generated/factories/ProductFactory__factory.js rename to tool/packages/contracts-sdk/dist/generated/factories/ProductFactory__factory.js diff --git a/tool/dist/generated/factories/index.d.ts b/tool/packages/contracts-sdk/dist/generated/factories/index.d.ts similarity index 100% rename from tool/dist/generated/factories/index.d.ts rename to tool/packages/contracts-sdk/dist/generated/factories/index.d.ts diff --git a/tool/dist/generated/factories/index.js b/tool/packages/contracts-sdk/dist/generated/factories/index.js similarity index 100% rename from tool/dist/generated/factories/index.js rename to tool/packages/contracts-sdk/dist/generated/factories/index.js diff --git a/tool/dist/generated/index.d.ts b/tool/packages/contracts-sdk/dist/generated/index.d.ts similarity index 100% rename from tool/dist/generated/index.d.ts rename to tool/packages/contracts-sdk/dist/generated/index.d.ts diff --git a/tool/dist/generated/index.js b/tool/packages/contracts-sdk/dist/generated/index.js similarity index 100% rename from tool/dist/generated/index.js rename to tool/packages/contracts-sdk/dist/generated/index.js diff --git a/tool/dist/index.d.ts b/tool/packages/contracts-sdk/dist/index.d.ts similarity index 100% rename from tool/dist/index.d.ts rename to tool/packages/contracts-sdk/dist/index.d.ts diff --git a/tool/dist/index.js b/tool/packages/contracts-sdk/dist/index.js similarity index 100% rename from tool/dist/index.js rename to tool/packages/contracts-sdk/dist/index.js diff --git a/tool/dist/types/chain.d.ts b/tool/packages/contracts-sdk/dist/types/chain.d.ts similarity index 100% rename from tool/dist/types/chain.d.ts rename to tool/packages/contracts-sdk/dist/types/chain.d.ts diff --git a/tool/dist/types/chain.js b/tool/packages/contracts-sdk/dist/types/chain.js similarity index 100% rename from tool/dist/types/chain.js rename to tool/packages/contracts-sdk/dist/types/chain.js diff --git a/tool/dist/types/index.d.ts b/tool/packages/contracts-sdk/dist/types/index.d.ts similarity index 100% rename from tool/dist/types/index.d.ts rename to tool/packages/contracts-sdk/dist/types/index.d.ts diff --git a/tool/dist/types/index.js b/tool/packages/contracts-sdk/dist/types/index.js similarity index 100% rename from tool/dist/types/index.js rename to tool/packages/contracts-sdk/dist/types/index.js diff --git a/tool/dist/utils/index.d.ts b/tool/packages/contracts-sdk/dist/utils/index.d.ts similarity index 100% rename from tool/dist/utils/index.d.ts rename to tool/packages/contracts-sdk/dist/utils/index.d.ts diff --git a/tool/dist/utils/index.js b/tool/packages/contracts-sdk/dist/utils/index.js similarity index 100% rename from tool/dist/utils/index.js rename to tool/packages/contracts-sdk/dist/utils/index.js diff --git a/tool/dist/utils/timestamp.d.ts b/tool/packages/contracts-sdk/dist/utils/timestamp.d.ts similarity index 100% rename from tool/dist/utils/timestamp.d.ts rename to tool/packages/contracts-sdk/dist/utils/timestamp.d.ts diff --git a/tool/dist/utils/timestamp.js b/tool/packages/contracts-sdk/dist/utils/timestamp.js similarity index 100% rename from tool/dist/utils/timestamp.js rename to tool/packages/contracts-sdk/dist/utils/timestamp.js diff --git a/tool/packages/contracts-sdk/package.json b/tool/packages/contracts-sdk/package.json new file mode 100644 index 0000000..7b71400 --- /dev/null +++ b/tool/packages/contracts-sdk/package.json @@ -0,0 +1,22 @@ +{ + "name": "tool-contracts-sdk", + "module": "src/index.ts", + "type": "module", + "scripts": { + "typechain": "rimraf src/generated/* && typechain --target ethers-v5 --out-dir src/generated/ '../out/ProductFactory.sol/ProductFactory.json' '../out/IProductFactory.sol/IProductFactory.json'", + "build": "rimraf dist/* && tsc -p tsconfig.json" + }, + "devDependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/providers": "^5.7.2", + "rimraf": "^6.0.0", + "typechain": "^8.3.1", + "@typechain/ethers-v5": "^11.1.1" + }, + "peerDependencies": { + "typescript": "^5.0.0" + }, + "dependencies": { + "ethers": "^5.7.2" + } +} \ No newline at end of file diff --git a/tool/src/ProductFactory.ts b/tool/packages/contracts-sdk/src/ProductFactory.ts similarity index 100% rename from tool/src/ProductFactory.ts rename to tool/packages/contracts-sdk/src/ProductFactory.ts diff --git a/tool/src/generated/IProductFactory.ts b/tool/packages/contracts-sdk/src/generated/IProductFactory.ts similarity index 100% rename from tool/src/generated/IProductFactory.ts rename to tool/packages/contracts-sdk/src/generated/IProductFactory.ts diff --git a/tool/src/generated/ProductFactory.ts b/tool/packages/contracts-sdk/src/generated/ProductFactory.ts similarity index 100% rename from tool/src/generated/ProductFactory.ts rename to tool/packages/contracts-sdk/src/generated/ProductFactory.ts diff --git a/tool/src/generated/common.ts b/tool/packages/contracts-sdk/src/generated/common.ts similarity index 100% rename from tool/src/generated/common.ts rename to tool/packages/contracts-sdk/src/generated/common.ts diff --git a/tool/src/generated/factories/IProductFactory__factory.ts b/tool/packages/contracts-sdk/src/generated/factories/IProductFactory__factory.ts similarity index 100% rename from tool/src/generated/factories/IProductFactory__factory.ts rename to tool/packages/contracts-sdk/src/generated/factories/IProductFactory__factory.ts diff --git a/tool/src/generated/factories/ProductFactory__factory.ts b/tool/packages/contracts-sdk/src/generated/factories/ProductFactory__factory.ts similarity index 100% rename from tool/src/generated/factories/ProductFactory__factory.ts rename to tool/packages/contracts-sdk/src/generated/factories/ProductFactory__factory.ts diff --git a/tool/src/generated/factories/index.ts b/tool/packages/contracts-sdk/src/generated/factories/index.ts similarity index 100% rename from tool/src/generated/factories/index.ts rename to tool/packages/contracts-sdk/src/generated/factories/index.ts diff --git a/tool/src/generated/index.ts b/tool/packages/contracts-sdk/src/generated/index.ts similarity index 100% rename from tool/src/generated/index.ts rename to tool/packages/contracts-sdk/src/generated/index.ts diff --git a/tool/src/index.ts b/tool/packages/contracts-sdk/src/index.ts similarity index 100% rename from tool/src/index.ts rename to tool/packages/contracts-sdk/src/index.ts diff --git a/tool/src/types/chain.ts b/tool/packages/contracts-sdk/src/types/chain.ts similarity index 100% rename from tool/src/types/chain.ts rename to tool/packages/contracts-sdk/src/types/chain.ts diff --git a/tool/src/types/index.ts b/tool/packages/contracts-sdk/src/types/index.ts similarity index 100% rename from tool/src/types/index.ts rename to tool/packages/contracts-sdk/src/types/index.ts diff --git a/tool/src/utils/index.ts b/tool/packages/contracts-sdk/src/utils/index.ts similarity index 100% rename from tool/src/utils/index.ts rename to tool/packages/contracts-sdk/src/utils/index.ts diff --git a/tool/src/utils/timestamp.ts b/tool/packages/contracts-sdk/src/utils/timestamp.ts similarity index 100% rename from tool/src/utils/timestamp.ts rename to tool/packages/contracts-sdk/src/utils/timestamp.ts diff --git a/tool/packages/contracts-sdk/tsconfig.json b/tool/packages/contracts-sdk/tsconfig.json new file mode 100644 index 0000000..e744a08 --- /dev/null +++ b/tool/packages/contracts-sdk/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + "module": "ESNext" /* Specify what module code is generated. */, + "rootDir": "./src" /* Specify the root folder within your source files. */, + "moduleResolution": "Bundler", + "resolveJsonModule": true /* Enable importing .json files. */, + "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, + "outDir": "./dist" /* Specify an output folder for all emitted files. */, + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, + "strict": true /* Enable all strict type-checking options. */, + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, +} diff --git a/tool/packages/device-simulator/dist/cli.js b/tool/packages/device-simulator/dist/cli.js new file mode 100644 index 0000000..e7b68c1 --- /dev/null +++ b/tool/packages/device-simulator/dist/cli.js @@ -0,0 +1,86 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const ethers_1 = require("ethers"); +const yargs_1 = __importDefault(require("yargs")); +const helpers_1 = require("yargs/helpers"); +const fs_1 = __importDefault(require("fs")); +const path_1 = __importDefault(require("path")); +// Function to write JSON data to a file +function writeJsonToFile(filePath, data) { + fs_1.default.writeFileSync(filePath, JSON.stringify(data, null, 2)); +} +// Define the paths for the private key and signature files relative to the current working directory +const tmpDir = path_1.default.resolve(process.cwd(), "./tmp"); +const privateKeyFilePath = path_1.default.join(tmpDir, "privatekey.json"); +const signatureFilePath = path_1.default.join(tmpDir, "signature.json"); +(0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)) + .command("create", "Create a new private key and save it to a file. If a private key already exists, the command will exit with a message.", () => __awaiter(void 0, void 0, void 0, function* () { + // Ensure the tmp directory exists + if (!fs_1.default.existsSync(tmpDir)) { + fs_1.default.mkdirSync(tmpDir); + } + // Check if the private key file already exists + if (fs_1.default.existsSync(privateKeyFilePath)) { + console.log("A private key already exists in ./tmp/privatekey.json. Exiting without creating a new key."); + process.exit(1); + } + // Generate a new private key + const wallet = ethers_1.ethers.Wallet.createRandom(); + const privateKeyData = { + privateKey: wallet.privateKey, + address: wallet.address, + }; + // Write the private key to the file + writeJsonToFile(privateKeyFilePath, privateKeyData); + console.log("A new private key has been created and saved to:", privateKeyFilePath); +})) + .command("sign", "Sign a message using the existing private key. The signature and the message expiration time will be saved to a file.", { + expiration: { + type: "number", + demandOption: false, + description: "The expiration time for the message signature in seconds. Defaults to 3600 seconds (1 hour).", + }, +}, (args) => __awaiter(void 0, void 0, void 0, function* () { + // Ensure the tmp directory exists + if (!fs_1.default.existsSync(tmpDir)) { + fs_1.default.mkdirSync(tmpDir); + } + // Check if the private key file exists + if (!fs_1.default.existsSync(privateKeyFilePath)) { + console.log("No private key found. Please create a private key first using the 'create' command."); + process.exit(1); + } + // Read the private key from the file + const privateKeyData = JSON.parse(fs_1.default.readFileSync(privateKeyFilePath, "utf-8")); + const wallet = new ethers_1.ethers.Wallet(privateKeyData.privateKey); + // Set default expiration time if not provided + if (!args.expiration) { + args.expiration = 3600; + } + // Calculate the device deadline + const deviceDeadline = (Math.floor(Date.now() / 1000) + args.expiration).toString(); + // Hash the message + const hashedMessage = ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.defaultAbiCoder.encode(["uint256"], [deviceDeadline])); + const digest = ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.solidityPack(["string", "bytes32"], ["DEPHY_ID_SIGNED_MESSAGE:", hashedMessage])); + const { v, r, s } = wallet._signingKey().signDigest(digest); + const deviceSignature = ethers_1.ethers.utils.solidityPack(["bytes32", "bytes32", "uint8"], [r, s, v]); + const signatureData = { + deviceSignature, + deviceDeadline, + }; + writeJsonToFile(signatureFilePath, signatureData); + console.log("The message has been signed and the signature has been saved to:", signatureFilePath); +})) + .help().argv; diff --git a/tool/packages/device-simulator/dist/index.js b/tool/packages/device-simulator/dist/index.js new file mode 100644 index 0000000..9b0a458 --- /dev/null +++ b/tool/packages/device-simulator/dist/index.js @@ -0,0 +1,17 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./cli"), exports); diff --git a/tool/packages/device-simulator/package.json b/tool/packages/device-simulator/package.json new file mode 100644 index 0000000..77c37c9 --- /dev/null +++ b/tool/packages/device-simulator/package.json @@ -0,0 +1,22 @@ +{ + "name": "tool-device-simulator", + "main": "dist/index.js", + "scripts": { + "build": "rimraf dist/* && tsc -p tsconfig.json", + "cli": "node ./dist/index.js" + }, + "devDependencies": { + "@types/yargs": "^17.0.32", + "rimraf": "^6.0.0" + }, + "bin": { + "device-simulator": "./dist/index.js" + }, + "peerDependencies": { + "typescript": "^5.0.0" + }, + "dependencies": { + "ethers": "^5.7.2", + "yargs": "^17.7.2" + } +} diff --git a/tool/packages/device-simulator/src/cli.ts b/tool/packages/device-simulator/src/cli.ts new file mode 100644 index 0000000..e5d0904 --- /dev/null +++ b/tool/packages/device-simulator/src/cli.ts @@ -0,0 +1,119 @@ +import { ethers } from "ethers"; +import yargs from "yargs"; +import { hideBin } from "yargs/helpers"; +import fs from "fs"; +import path from "path"; + +// Function to write JSON data to a file +function writeJsonToFile(filePath: string, data: object) { + fs.writeFileSync(filePath, JSON.stringify(data, null, 2)); +} + +// Define the paths for the private key and signature files relative to the current working directory +const tmpDir = path.resolve(process.cwd(), "./tmp"); +const privateKeyFilePath = path.join(tmpDir, "privatekey.json"); +const signatureFilePath = path.join(tmpDir, "signature.json"); + +yargs(hideBin(process.argv)) + .command( + "create", + "Create a new private key and save it to a file. If a private key already exists, the command will exit with a message.", + async () => { + // Ensure the tmp directory exists + if (!fs.existsSync(tmpDir)) { + fs.mkdirSync(tmpDir); + } + + // Check if the private key file already exists + if (fs.existsSync(privateKeyFilePath)) { + console.log( + "A private key already exists in ./tmp/privatekey.json. Exiting without creating a new key." + ); + process.exit(1); + } + + // Generate a new private key + const wallet = ethers.Wallet.createRandom(); + const privateKeyData = { + privateKey: wallet.privateKey, + address: wallet.address, + }; + + // Write the private key to the file + writeJsonToFile(privateKeyFilePath, privateKeyData); + console.log( + "A new private key has been created and saved to:", + privateKeyFilePath + ); + } + ) + .command( + "sign", + "Sign a message using the existing private key. The signature and the message expiration time will be saved to a file.", + { + expiration: { + type: "number", + demandOption: false, + description: + "The expiration time for the message signature in seconds. Defaults to 3600 seconds (1 hour).", + }, + }, + async (args) => { + // Ensure the tmp directory exists + if (!fs.existsSync(tmpDir)) { + fs.mkdirSync(tmpDir); + } + + // Check if the private key file exists + if (!fs.existsSync(privateKeyFilePath)) { + console.log( + "No private key found. Please create a private key first using the 'create' command." + ); + process.exit(1); + } + + // Read the private key from the file + const privateKeyData = JSON.parse( + fs.readFileSync(privateKeyFilePath, "utf-8") + ); + const wallet = new ethers.Wallet(privateKeyData.privateKey); + + // Set default expiration time if not provided + if (!args.expiration) { + args.expiration = 3600; + } + + // Calculate the device deadline + const deviceDeadline = ( + Math.floor(Date.now() / 1000) + args.expiration + ).toString(); + + // Hash the message + const hashedMessage = ethers.utils.keccak256( + ethers.utils.defaultAbiCoder.encode(["uint256"], [deviceDeadline]) + ); + const digest = ethers.utils.keccak256( + ethers.utils.solidityPack( + ["string", "bytes32"], + ["DEPHY_ID_SIGNED_MESSAGE:", hashedMessage] + ) + ); + + const { v, r, s } = wallet._signingKey().signDigest(digest); + const deviceSignature = ethers.utils.solidityPack( + ["bytes32", "bytes32", "uint8"], + [r, s, v] + ); + + const signatureData = { + deviceSignature, + deviceDeadline, + }; + writeJsonToFile(signatureFilePath, signatureData); + console.log( + "The message has been signed and the signature has been saved to:", + signatureFilePath + ); + } + ) + .help().argv; diff --git a/tool/packages/device-simulator/src/index.ts b/tool/packages/device-simulator/src/index.ts new file mode 100644 index 0000000..84c1dcb --- /dev/null +++ b/tool/packages/device-simulator/src/index.ts @@ -0,0 +1 @@ +export * from "./cli"; \ No newline at end of file diff --git a/tool/packages/device-simulator/tsconfig.json b/tool/packages/device-simulator/tsconfig.json new file mode 100644 index 0000000..33c463f --- /dev/null +++ b/tool/packages/device-simulator/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "ES2015", + "module": "CommonJS", + "strict": true, + "outDir": "./dist", + "esModuleInterop": true, + "moduleResolution": "node" + }, +} diff --git a/tool/tsconfig.json b/tool/tsconfig.json index 5b3c280..e744a08 100644 --- a/tool/tsconfig.json +++ b/tool/tsconfig.json @@ -12,5 +12,4 @@ "strict": true /* Enable all strict type-checking options. */, "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, - "exclude": ["dist", "demo"] } From 018ac593ca2bd87c05b43e7313eb490cd59fb2d7 Mon Sep 17 00:00:00 2001 From: CanvasL <746591811@qq.com> Date: Wed, 24 Jul 2024 17:52:19 +0800 Subject: [PATCH 4/4] fix: import in demo --- tool/packages/contracts-demo/src/App.css | 56 ------------------------ tool/packages/contracts-demo/src/App.tsx | 4 +- 2 files changed, 2 insertions(+), 58 deletions(-) delete mode 100644 tool/packages/contracts-demo/src/App.css diff --git a/tool/packages/contracts-demo/src/App.css b/tool/packages/contracts-demo/src/App.css deleted file mode 100644 index 4b9c79e..0000000 --- a/tool/packages/contracts-demo/src/App.css +++ /dev/null @@ -1,56 +0,0 @@ -#root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; -} -.logo:hover { - filter: drop-shadow(0 0 2em #646cffaa); -} -.logo.react:hover { - filter: drop-shadow(0 0 2em #61dafbaa); -} - -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } -} - -.card { - padding: 2em; -} - -.read-the-docs { - color: #888; -} - -button { - display: block; - margin: 0 auto 10px; -} - -.blackText { - color: black; - font-family: Poppins; -} - -.json { - word-break: break-all; - text-align: left; -} diff --git a/tool/packages/contracts-demo/src/App.tsx b/tool/packages/contracts-demo/src/App.tsx index 27f886e..7f658fb 100644 --- a/tool/packages/contracts-demo/src/App.tsx +++ b/tool/packages/contracts-demo/src/App.tsx @@ -1,7 +1,7 @@ -import React, { useState, useEffect } from "react"; +import { useState, useEffect } from "react"; import "./App.scss"; import { ContractTransaction, Signer, ethers } from "ethers"; -import { ProductFactory, ChainId } from "dephy-id-evm-tool/dist"; +import { ProductFactory, ChainId } from "../../contracts-sdk/dist"; import ADDRESS_JSON from "../../../../addresses.json"; const BASE_SEPOLIA_PARAMS = {