From 1a199949b60bc1b3aa00b6498dd7c68603d9b4f7 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Fri, 1 Sep 2023 11:00:38 +0400 Subject: [PATCH] refactor: remove readline, add system contract import (#47) --- contracts/TestSystemContract.sol | 8 +- index.ts | 5 - package.json | 1 - .../zevm/SystemContract.sol/SystemContract.ts | 706 ++++++++++++++++++ .../SystemContractErrors.ts | 55 ++ .../zevm/SystemContract.sol/index.ts | 5 + .../contracts/zevm/index.ts | 2 + .../SystemContractErrors__factory.ts | 55 ++ .../SystemContract__factory.ts | 495 ++++++++++++ .../zevm/SystemContract.sol/index.ts | 5 + .../contracts/zevm/index.ts | 1 + .../TestSystemContract__factory.ts | 2 +- typechain-types/hardhat.d.ts | 18 + typechain-types/index.ts | 6 +- yarn.lock | 5 - 15 files changed, 1349 insertions(+), 20 deletions(-) delete mode 100644 index.ts create mode 100644 typechain-types/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContract.ts create mode 100644 typechain-types/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContractErrors.ts create mode 100644 typechain-types/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/index.ts create mode 100644 typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContractErrors__factory.ts create mode 100644 typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContract__factory.ts create mode 100644 typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/index.ts diff --git a/contracts/TestSystemContract.sol b/contracts/TestSystemContract.sol index 283631dc..8adc6f4d 100644 --- a/contracts/TestSystemContract.sol +++ b/contracts/TestSystemContract.sol @@ -3,18 +3,14 @@ pragma solidity 0.8.7; import "@zetachain/protocol-contracts/contracts/zevm/interfaces/zContract.sol"; import "@zetachain/protocol-contracts/contracts/zevm/interfaces/IZRC20.sol"; +import "@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol"; -interface SystemContractErrors { +contract TestSystemContract { error CallerIsNotFungibleModule(); - error InvalidTarget(); - error CantBeIdenticalAddresses(); - error CantBeZeroAddress(); -} -contract TestSystemContract is SystemContractErrors { mapping(uint256 => uint256) public gasPriceByChainId; mapping(uint256 => address) public gasCoinZRC20ByChainId; mapping(uint256 => address) public gasZetaPoolByChainId; diff --git a/index.ts b/index.ts deleted file mode 100644 index ddcdf29e..00000000 --- a/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { getFees } from "./helpers/fees"; - -(async () => { - console.log(await getFees("ccm", "goerli_testnet")); -})(); diff --git a/package.json b/package.json index 2d96038a..e6d4cfbf 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,6 @@ "moment": "^2.29.4", "ora": "5.4.1", "spinnies": "^0.5.1", - "readline": "^1.3.0", "tiny-secp256k1": "^2.2.3", "ws": "^8.13.0" } diff --git a/typechain-types/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContract.ts b/typechain-types/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContract.ts new file mode 100644 index 00000000..03f6536e --- /dev/null +++ b/typechain-types/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContract.ts @@ -0,0 +1,706 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +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, + PromiseOrValue, +} from "../../../../../common"; + +export type ZContextStruct = { + origin: PromiseOrValue; + sender: PromiseOrValue; + chainID: PromiseOrValue; +}; + +export type ZContextStructOutput = [string, string, BigNumber] & { + origin: string; + sender: string; + chainID: BigNumber; +}; + +export interface SystemContractInterface extends utils.Interface { + functions: { + "FUNGIBLE_MODULE_ADDRESS()": FunctionFragment; + "depositAndCall((bytes,address,uint256),address,uint256,address,bytes)": FunctionFragment; + "gasCoinZRC20ByChainId(uint256)": FunctionFragment; + "gasPriceByChainId(uint256)": FunctionFragment; + "gasZetaPoolByChainId(uint256)": FunctionFragment; + "setConnectorZEVMAddress(address)": FunctionFragment; + "setGasCoinZRC20(uint256,address)": FunctionFragment; + "setGasPrice(uint256,uint256)": FunctionFragment; + "setGasZetaPool(uint256,address)": FunctionFragment; + "setWZETAContractAddress(address)": FunctionFragment; + "uniswapv2FactoryAddress()": FunctionFragment; + "uniswapv2PairFor(address,address,address)": FunctionFragment; + "uniswapv2Router02Address()": FunctionFragment; + "wZetaContractAddress()": FunctionFragment; + "zetaConnectorZEVMAddress()": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "FUNGIBLE_MODULE_ADDRESS" + | "depositAndCall" + | "gasCoinZRC20ByChainId" + | "gasPriceByChainId" + | "gasZetaPoolByChainId" + | "setConnectorZEVMAddress" + | "setGasCoinZRC20" + | "setGasPrice" + | "setGasZetaPool" + | "setWZETAContractAddress" + | "uniswapv2FactoryAddress" + | "uniswapv2PairFor" + | "uniswapv2Router02Address" + | "wZetaContractAddress" + | "zetaConnectorZEVMAddress" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "FUNGIBLE_MODULE_ADDRESS", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "depositAndCall", + values: [ + ZContextStruct, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "gasCoinZRC20ByChainId", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "gasPriceByChainId", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "gasZetaPoolByChainId", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setConnectorZEVMAddress", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setGasCoinZRC20", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setGasPrice", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setGasZetaPool", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setWZETAContractAddress", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "uniswapv2FactoryAddress", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "uniswapv2PairFor", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "uniswapv2Router02Address", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "wZetaContractAddress", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "zetaConnectorZEVMAddress", + values?: undefined + ): string; + + decodeFunctionResult( + functionFragment: "FUNGIBLE_MODULE_ADDRESS", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "depositAndCall", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gasCoinZRC20ByChainId", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gasPriceByChainId", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gasZetaPoolByChainId", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setConnectorZEVMAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setGasCoinZRC20", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setGasPrice", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setGasZetaPool", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setWZETAContractAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "uniswapv2FactoryAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "uniswapv2PairFor", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "uniswapv2Router02Address", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "wZetaContractAddress", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "zetaConnectorZEVMAddress", + data: BytesLike + ): Result; + + events: { + "SetConnectorZEVM(address)": EventFragment; + "SetGasCoin(uint256,address)": EventFragment; + "SetGasPrice(uint256,uint256)": EventFragment; + "SetGasZetaPool(uint256,address)": EventFragment; + "SetWZeta(address)": EventFragment; + "SystemContractDeployed()": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "SetConnectorZEVM"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SetGasCoin"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SetGasPrice"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SetGasZetaPool"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SetWZeta"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SystemContractDeployed"): EventFragment; +} + +export interface SetConnectorZEVMEventObject { + arg0: string; +} +export type SetConnectorZEVMEvent = TypedEvent< + [string], + SetConnectorZEVMEventObject +>; + +export type SetConnectorZEVMEventFilter = + TypedEventFilter; + +export interface SetGasCoinEventObject { + arg0: BigNumber; + arg1: string; +} +export type SetGasCoinEvent = TypedEvent< + [BigNumber, string], + SetGasCoinEventObject +>; + +export type SetGasCoinEventFilter = TypedEventFilter; + +export interface SetGasPriceEventObject { + arg0: BigNumber; + arg1: BigNumber; +} +export type SetGasPriceEvent = TypedEvent< + [BigNumber, BigNumber], + SetGasPriceEventObject +>; + +export type SetGasPriceEventFilter = TypedEventFilter; + +export interface SetGasZetaPoolEventObject { + arg0: BigNumber; + arg1: string; +} +export type SetGasZetaPoolEvent = TypedEvent< + [BigNumber, string], + SetGasZetaPoolEventObject +>; + +export type SetGasZetaPoolEventFilter = TypedEventFilter; + +export interface SetWZetaEventObject { + arg0: string; +} +export type SetWZetaEvent = TypedEvent<[string], SetWZetaEventObject>; + +export type SetWZetaEventFilter = TypedEventFilter; + +export interface SystemContractDeployedEventObject {} +export type SystemContractDeployedEvent = TypedEvent< + [], + SystemContractDeployedEventObject +>; + +export type SystemContractDeployedEventFilter = + TypedEventFilter; + +export interface SystemContract extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: SystemContractInterface; + + 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: { + FUNGIBLE_MODULE_ADDRESS(overrides?: CallOverrides): Promise<[string]>; + + depositAndCall( + context: ZContextStruct, + zrc20: PromiseOrValue, + amount: PromiseOrValue, + target: PromiseOrValue, + message: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + gasCoinZRC20ByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[string]>; + + gasPriceByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + gasZetaPoolByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[string]>; + + setConnectorZEVMAddress( + addr: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGasCoinZRC20( + chainID: PromiseOrValue, + zrc20: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGasPrice( + chainID: PromiseOrValue, + price: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGasZetaPool( + chainID: PromiseOrValue, + erc20: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setWZETAContractAddress( + addr: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + uniswapv2FactoryAddress(overrides?: CallOverrides): Promise<[string]>; + + uniswapv2PairFor( + factory: PromiseOrValue, + tokenA: PromiseOrValue, + tokenB: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[string] & { pair: string }>; + + uniswapv2Router02Address(overrides?: CallOverrides): Promise<[string]>; + + wZetaContractAddress(overrides?: CallOverrides): Promise<[string]>; + + zetaConnectorZEVMAddress(overrides?: CallOverrides): Promise<[string]>; + }; + + FUNGIBLE_MODULE_ADDRESS(overrides?: CallOverrides): Promise; + + depositAndCall( + context: ZContextStruct, + zrc20: PromiseOrValue, + amount: PromiseOrValue, + target: PromiseOrValue, + message: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + gasCoinZRC20ByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + gasPriceByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + gasZetaPoolByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setConnectorZEVMAddress( + addr: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGasCoinZRC20( + chainID: PromiseOrValue, + zrc20: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGasPrice( + chainID: PromiseOrValue, + price: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGasZetaPool( + chainID: PromiseOrValue, + erc20: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setWZETAContractAddress( + addr: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + uniswapv2FactoryAddress(overrides?: CallOverrides): Promise; + + uniswapv2PairFor( + factory: PromiseOrValue, + tokenA: PromiseOrValue, + tokenB: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + uniswapv2Router02Address(overrides?: CallOverrides): Promise; + + wZetaContractAddress(overrides?: CallOverrides): Promise; + + zetaConnectorZEVMAddress(overrides?: CallOverrides): Promise; + + callStatic: { + FUNGIBLE_MODULE_ADDRESS(overrides?: CallOverrides): Promise; + + depositAndCall( + context: ZContextStruct, + zrc20: PromiseOrValue, + amount: PromiseOrValue, + target: PromiseOrValue, + message: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + gasCoinZRC20ByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + gasPriceByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + gasZetaPoolByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setConnectorZEVMAddress( + addr: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setGasCoinZRC20( + chainID: PromiseOrValue, + zrc20: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setGasPrice( + chainID: PromiseOrValue, + price: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setGasZetaPool( + chainID: PromiseOrValue, + erc20: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setWZETAContractAddress( + addr: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + uniswapv2FactoryAddress(overrides?: CallOverrides): Promise; + + uniswapv2PairFor( + factory: PromiseOrValue, + tokenA: PromiseOrValue, + tokenB: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + uniswapv2Router02Address(overrides?: CallOverrides): Promise; + + wZetaContractAddress(overrides?: CallOverrides): Promise; + + zetaConnectorZEVMAddress(overrides?: CallOverrides): Promise; + }; + + filters: { + "SetConnectorZEVM(address)"(arg0?: null): SetConnectorZEVMEventFilter; + SetConnectorZEVM(arg0?: null): SetConnectorZEVMEventFilter; + + "SetGasCoin(uint256,address)"( + arg0?: null, + arg1?: null + ): SetGasCoinEventFilter; + SetGasCoin(arg0?: null, arg1?: null): SetGasCoinEventFilter; + + "SetGasPrice(uint256,uint256)"( + arg0?: null, + arg1?: null + ): SetGasPriceEventFilter; + SetGasPrice(arg0?: null, arg1?: null): SetGasPriceEventFilter; + + "SetGasZetaPool(uint256,address)"( + arg0?: null, + arg1?: null + ): SetGasZetaPoolEventFilter; + SetGasZetaPool(arg0?: null, arg1?: null): SetGasZetaPoolEventFilter; + + "SetWZeta(address)"(arg0?: null): SetWZetaEventFilter; + SetWZeta(arg0?: null): SetWZetaEventFilter; + + "SystemContractDeployed()"(): SystemContractDeployedEventFilter; + SystemContractDeployed(): SystemContractDeployedEventFilter; + }; + + estimateGas: { + FUNGIBLE_MODULE_ADDRESS(overrides?: CallOverrides): Promise; + + depositAndCall( + context: ZContextStruct, + zrc20: PromiseOrValue, + amount: PromiseOrValue, + target: PromiseOrValue, + message: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + gasCoinZRC20ByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + gasPriceByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + gasZetaPoolByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setConnectorZEVMAddress( + addr: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGasCoinZRC20( + chainID: PromiseOrValue, + zrc20: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGasPrice( + chainID: PromiseOrValue, + price: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGasZetaPool( + chainID: PromiseOrValue, + erc20: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setWZETAContractAddress( + addr: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + uniswapv2FactoryAddress(overrides?: CallOverrides): Promise; + + uniswapv2PairFor( + factory: PromiseOrValue, + tokenA: PromiseOrValue, + tokenB: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + uniswapv2Router02Address(overrides?: CallOverrides): Promise; + + wZetaContractAddress(overrides?: CallOverrides): Promise; + + zetaConnectorZEVMAddress(overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + FUNGIBLE_MODULE_ADDRESS( + overrides?: CallOverrides + ): Promise; + + depositAndCall( + context: ZContextStruct, + zrc20: PromiseOrValue, + amount: PromiseOrValue, + target: PromiseOrValue, + message: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + gasCoinZRC20ByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + gasPriceByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + gasZetaPoolByChainId( + arg0: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setConnectorZEVMAddress( + addr: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGasCoinZRC20( + chainID: PromiseOrValue, + zrc20: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGasPrice( + chainID: PromiseOrValue, + price: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setGasZetaPool( + chainID: PromiseOrValue, + erc20: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setWZETAContractAddress( + addr: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + uniswapv2FactoryAddress( + overrides?: CallOverrides + ): Promise; + + uniswapv2PairFor( + factory: PromiseOrValue, + tokenA: PromiseOrValue, + tokenB: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + uniswapv2Router02Address( + overrides?: CallOverrides + ): Promise; + + wZetaContractAddress( + overrides?: CallOverrides + ): Promise; + + zetaConnectorZEVMAddress( + overrides?: CallOverrides + ): Promise; + }; +} diff --git a/typechain-types/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContractErrors.ts b/typechain-types/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContractErrors.ts new file mode 100644 index 00000000..f07fd66d --- /dev/null +++ b/typechain-types/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContractErrors.ts @@ -0,0 +1,55 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { BaseContract, Signer, utils } from "ethers"; + +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, +} from "../../../../../common"; + +export interface SystemContractErrorsInterface extends utils.Interface { + functions: {}; + + events: {}; +} + +export interface SystemContractErrors extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: SystemContractErrorsInterface; + + 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: {}; + + callStatic: {}; + + filters: {}; + + estimateGas: {}; + + populateTransaction: {}; +} diff --git a/typechain-types/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/index.ts b/typechain-types/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/index.ts new file mode 100644 index 00000000..d5591cc5 --- /dev/null +++ b/typechain-types/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/index.ts @@ -0,0 +1,5 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { SystemContract } from "./SystemContract"; +export type { SystemContractErrors } from "./SystemContractErrors"; diff --git a/typechain-types/@zetachain/protocol-contracts/contracts/zevm/index.ts b/typechain-types/@zetachain/protocol-contracts/contracts/zevm/index.ts index 92159233..c60bf1f6 100644 --- a/typechain-types/@zetachain/protocol-contracts/contracts/zevm/index.ts +++ b/typechain-types/@zetachain/protocol-contracts/contracts/zevm/index.ts @@ -1,5 +1,7 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ +import type * as systemContractSol from "./SystemContract.sol"; +export type { systemContractSol }; import type * as interfaces from "./interfaces"; export type { interfaces }; diff --git a/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContractErrors__factory.ts b/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContractErrors__factory.ts new file mode 100644 index 00000000..1b5fb74d --- /dev/null +++ b/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContractErrors__factory.ts @@ -0,0 +1,55 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + SystemContractErrors, + SystemContractErrorsInterface, +} from "../../../../../../@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContractErrors"; + +const _abi = [ + { + inputs: [], + name: "CallerIsNotFungibleModule", + type: "error", + }, + { + inputs: [], + name: "CantBeIdenticalAddresses", + type: "error", + }, + { + inputs: [], + name: "CantBeZeroAddress", + type: "error", + }, + { + inputs: [], + name: "InvalidTarget", + type: "error", + }, + { + inputs: [], + name: "ZeroAddress", + type: "error", + }, +] as const; + +export class SystemContractErrors__factory { + static readonly abi = _abi; + static createInterface(): SystemContractErrorsInterface { + return new utils.Interface(_abi) as SystemContractErrorsInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): SystemContractErrors { + return new Contract( + address, + _abi, + signerOrProvider + ) as SystemContractErrors; + } +} diff --git a/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContract__factory.ts b/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContract__factory.ts new file mode 100644 index 00000000..0f4533d3 --- /dev/null +++ b/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContract__factory.ts @@ -0,0 +1,495 @@ +/* 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 { PromiseOrValue } from "../../../../../../common"; +import type { + SystemContract, + SystemContractInterface, +} from "../../../../../../@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContract"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "wzeta_", + type: "address", + }, + { + internalType: "address", + name: "uniswapv2Factory_", + type: "address", + }, + { + internalType: "address", + name: "uniswapv2Router02_", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "CallerIsNotFungibleModule", + type: "error", + }, + { + inputs: [], + name: "CantBeIdenticalAddresses", + type: "error", + }, + { + inputs: [], + name: "CantBeZeroAddress", + type: "error", + }, + { + inputs: [], + name: "InvalidTarget", + type: "error", + }, + { + inputs: [], + name: "ZeroAddress", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "", + type: "address", + }, + ], + name: "SetConnectorZEVM", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "", + type: "address", + }, + ], + name: "SetGasCoin", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "SetGasPrice", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "", + type: "address", + }, + ], + name: "SetGasZetaPool", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "", + type: "address", + }, + ], + name: "SetWZeta", + type: "event", + }, + { + anonymous: false, + inputs: [], + name: "SystemContractDeployed", + type: "event", + }, + { + inputs: [], + name: "FUNGIBLE_MODULE_ADDRESS", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "bytes", + name: "origin", + type: "bytes", + }, + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "uint256", + name: "chainID", + type: "uint256", + }, + ], + internalType: "struct zContext", + name: "context", + type: "tuple", + }, + { + internalType: "address", + name: "zrc20", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "address", + name: "target", + type: "address", + }, + { + internalType: "bytes", + name: "message", + type: "bytes", + }, + ], + name: "depositAndCall", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "gasCoinZRC20ByChainId", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "gasPriceByChainId", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "gasZetaPoolByChainId", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address", + }, + ], + name: "setConnectorZEVMAddress", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "chainID", + type: "uint256", + }, + { + internalType: "address", + name: "zrc20", + type: "address", + }, + ], + name: "setGasCoinZRC20", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "chainID", + type: "uint256", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + ], + name: "setGasPrice", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "chainID", + type: "uint256", + }, + { + internalType: "address", + name: "erc20", + type: "address", + }, + ], + name: "setGasZetaPool", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address", + }, + ], + name: "setWZETAContractAddress", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "uniswapv2FactoryAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "factory", + type: "address", + }, + { + internalType: "address", + name: "tokenA", + type: "address", + }, + { + internalType: "address", + name: "tokenB", + type: "address", + }, + ], + name: "uniswapv2PairFor", + outputs: [ + { + internalType: "address", + name: "pair", + type: "address", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [], + name: "uniswapv2Router02Address", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "wZetaContractAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "zetaConnectorZEVMAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; + +const _bytecode = + "0x60c06040523480156200001157600080fd5b50604051620018aa380380620018aa8339818101604052810190620000379190620001ac565b73735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614620000b1576040517f2b2add3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250507f80699e81136d69cb8367ad52a994e25c722a86da654b561d0c14b61a777e7ac560405160405180910390a15050506200025b565b600081519050620001a68162000241565b92915050565b600080600060608486031215620001c857620001c76200023c565b5b6000620001d88682870162000195565b9350506020620001eb8682870162000195565b9250506040620001fe8682870162000195565b9150509250925092565b600062000215826200021c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600080fd5b6200024c8162000208565b81146200025857600080fd5b50565b60805160601c60a05160601c61161c6200028e600039600061051b0152600081816105bd0152610bc5015261161c6000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806397770dff11610097578063c63585cc11610066578063c63585cc1461025e578063d7fd7afb1461028e578063d936a012146102be578063ee2815ba146102dc576100f5565b806397770dff146101ec578063a7cb050714610208578063c39aca3714610224578063c62178ac14610240576100f5565b8063513a9c05116100d3578063513a9c0514610164578063569541b914610194578063842da36d146101b257806391dd645f146101d0576100f5565b80630be15547146100fa5780631f0e251b1461012a5780633ce4a5bc14610146575b600080fd5b610114600480360381019061010f9190611022565b6102f8565b60405161012191906112b1565b60405180910390f35b610144600480360381019061013f9190610ebf565b61032b565b005b61014e6104a8565b60405161015b91906112b1565b60405180910390f35b61017e60048036038101906101799190611022565b6104c0565b60405161018b91906112b1565b60405180910390f35b61019c6104f3565b6040516101a991906112b1565b60405180910390f35b6101ba610519565b6040516101c791906112b1565b60405180910390f35b6101ea60048036038101906101e5919061104f565b61053d565b005b61020660048036038101906102019190610ebf565b610697565b005b610222600480360381019061021d919061108f565b610814565b005b61023e60048036038101906102399190610f6c565b6108e1565b005b610248610b13565b60405161025591906112b1565b60405180910390f35b61027860048036038101906102739190610eec565b610b39565b60405161028591906112b1565b60405180910390f35b6102a860048036038101906102a39190611022565b610bab565b6040516102b5919061134a565b60405180910390f35b6102c6610bc3565b6040516102d391906112b1565b60405180910390f35b6102f660048036038101906102f1919061104f565b610be7565b005b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b73735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103a4576040517f2b2add3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561040b576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f3ade88e3922d64780e1bf4460d364c2970b69da813f9c0c07a1c187b5647636c600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405161049d91906112b1565b60405180910390a150565b73735b14bb79463307aacbed86daf3322b1e6226ab81565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b73735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105b6576040517f2b2add3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006106057f0000000000000000000000000000000000000000000000000000000000000000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610b39565b9050806002600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f0ecec485166da6139b13bb7e033e9446e2d35348e80ebf1180d4afe2dba1704e838260405161068a929190611365565b60405180910390a1505050565b73735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610710576040517f2b2add3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610777576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fdba79d534382d1a8ae108e4c8ecb27c6ae42ab8b91d44eedf88bd329f3868d5e600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405161080991906112b1565b60405180910390a150565b73735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461088d576040517f2b2add3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600080848152602001908152602001600020819055507f49f492222906ac486c3c1401fa545626df1f0c0e5a77a05597ea2ed66af9850d82826040516108d592919061138e565b60405180910390a15050565b73735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461095a576040517f2b2add3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806109d357503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15610a0a576040517f82d5d76a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff166347e7ef2484866040518363ffffffff1660e01b8152600401610a459291906112cc565b602060405180830381600087803b158015610a5f57600080fd5b505af1158015610a73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a979190610f3f565b508273ffffffffffffffffffffffffffffffffffffffff1663de43156e87878786866040518663ffffffff1660e01b8152600401610ad99594939291906112f5565b600060405180830381600087803b158015610af357600080fd5b505af1158015610b07573d6000803e3d6000fd5b50505050505050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000610b488585610cef565b91509150858282604051602001610b60929190611243565b60405160208183030381529060405280519060200120604051602001610b8792919061126f565b6040516020818303038152906040528051906020012060001c925050509392505050565b60006020528060005260406000206000915090505481565b7f000000000000000000000000000000000000000000000000000000000000000081565b73735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c60576040517f2b2add3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fd1b36d30f6248e97c473b4d1348ca164a4ef6759022f54a58ec200326c39c45d8282604051610ce3929190611365565b60405180910390a15050565b6000808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415610d58576040517fcb1e7cfe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1610610d92578284610d95565b83835b8092508193505050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e04576040517f78b507da00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b9250929050565b600081359050610e1a816115a1565b92915050565b600081519050610e2f816115b8565b92915050565b60008083601f840112610e4b57610e4a61150e565b5b8235905067ffffffffffffffff811115610e6857610e67611509565b5b602083019150836001820283011115610e8457610e8361151d565b5b9250929050565b600060608284031215610ea157610ea0611513565b5b81905092915050565b600081359050610eb9816115cf565b92915050565b600060208284031215610ed557610ed461152c565b5b6000610ee384828501610e0b565b91505092915050565b600080600060608486031215610f0557610f0461152c565b5b6000610f1386828701610e0b565b9350506020610f2486828701610e0b565b9250506040610f3586828701610e0b565b9150509250925092565b600060208284031215610f5557610f5461152c565b5b6000610f6384828501610e20565b91505092915050565b60008060008060008060a08789031215610f8957610f8861152c565b5b600087013567ffffffffffffffff811115610fa757610fa6611522565b5b610fb389828a01610e8b565b9650506020610fc489828a01610e0b565b9550506040610fd589828a01610eaa565b9450506060610fe689828a01610e0b565b935050608087013567ffffffffffffffff81111561100757611006611522565b5b61101389828a01610e35565b92509250509295509295509295565b6000602082840312156110385761103761152c565b5b600061104684828501610eaa565b91505092915050565b600080604083850312156110665761106561152c565b5b600061107485828601610eaa565b925050602061108585828601610e0b565b9150509250929050565b600080604083850312156110a6576110a561152c565b5b60006110b485828601610eaa565b92505060206110c585828601610eaa565b9150509250929050565b6110d881611475565b82525050565b6110e781611475565b82525050565b6110fe6110f982611475565b6114d6565b82525050565b61111561111082611493565b6114e8565b82525050565b600061112783856113b7565b93506111348385846114c7565b61113d83611531565b840190509392505050565b600061115483856113c8565b93506111618385846114c7565b61116a83611531565b840190509392505050565b60006111826020836113d9565b915061118d8261154f565b602082019050919050565b60006111a56001836113d9565b91506111b082611578565b600182019050919050565b6000606083016111ce60008401846113fb565b85830360008701526111e183828461111b565b925050506111f260208401846113e4565b6111ff60208601826110cf565b5061120d604084018461145e565b61121a6040860182611225565b508091505092915050565b61122e816114bd565b82525050565b61123d816114bd565b82525050565b600061124f82856110ed565b60148201915061125f82846110ed565b6014820191508190509392505050565b600061127a82611198565b915061128682856110ed565b6014820191506112968284611104565b6020820191506112a582611175565b91508190509392505050565b60006020820190506112c660008301846110de565b92915050565b60006040820190506112e160008301856110de565b6112ee6020830184611234565b9392505050565b6000608082019050818103600083015261130f81886111bb565b905061131e60208301876110de565b61132b6040830186611234565b818103606083015261133e818486611148565b90509695505050505050565b600060208201905061135f6000830184611234565b92915050565b600060408201905061137a6000830185611234565b61138760208301846110de565b9392505050565b60006040820190506113a36000830185611234565b6113b06020830184611234565b9392505050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006113f36020840184610e0b565b905092915050565b6000808335600160200384360303811261141857611417611527565b5b83810192508235915060208301925067ffffffffffffffff8211156114405761143f611504565b5b60018202360384131561145657611455611518565b5b509250929050565b600061146d6020840184610eaa565b905092915050565b60006114808261149d565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60006114e1826114f2565b9050919050565b6000819050919050565b60006114fd82611542565b9050919050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f600082015250565b7fff00000000000000000000000000000000000000000000000000000000000000600082015250565b6115aa81611475565b81146115b557600080fd5b50565b6115c181611487565b81146115cc57600080fd5b50565b6115d8816114bd565b81146115e357600080fd5b5056fea2646970667358221220abc631448c64fd9f3fac6218e024bdf1dd8935964dcdf2e981c65163599f794764736f6c63430008070033"; + +type SystemContractConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: SystemContractConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class SystemContract__factory extends ContractFactory { + constructor(...args: SystemContractConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override deploy( + wzeta_: PromiseOrValue, + uniswapv2Factory_: PromiseOrValue, + uniswapv2Router02_: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise { + return super.deploy( + wzeta_, + uniswapv2Factory_, + uniswapv2Router02_, + overrides || {} + ) as Promise; + } + override getDeployTransaction( + wzeta_: PromiseOrValue, + uniswapv2Factory_: PromiseOrValue, + uniswapv2Router02_: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): TransactionRequest { + return super.getDeployTransaction( + wzeta_, + uniswapv2Factory_, + uniswapv2Router02_, + overrides || {} + ); + } + override attach(address: string): SystemContract { + return super.attach(address) as SystemContract; + } + override connect(signer: Signer): SystemContract__factory { + return super.connect(signer) as SystemContract__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): SystemContractInterface { + return new utils.Interface(_abi) as SystemContractInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): SystemContract { + return new Contract(address, _abi, signerOrProvider) as SystemContract; + } +} diff --git a/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/index.ts b/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/index.ts new file mode 100644 index 00000000..32da62eb --- /dev/null +++ b/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/index.ts @@ -0,0 +1,5 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { SystemContract__factory } from "./SystemContract__factory"; +export { SystemContractErrors__factory } from "./SystemContractErrors__factory"; diff --git a/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/index.ts b/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/index.ts index 1d3444d5..cef0213a 100644 --- a/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/index.ts +++ b/typechain-types/factories/@zetachain/protocol-contracts/contracts/zevm/index.ts @@ -1,4 +1,5 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ +export * as systemContractSol from "./SystemContract.sol"; export * as interfaces from "./interfaces"; diff --git a/typechain-types/factories/contracts/TestSystemContract.sol/TestSystemContract__factory.ts b/typechain-types/factories/contracts/TestSystemContract.sol/TestSystemContract__factory.ts index 6bde78d9..2d5a1849 100644 --- a/typechain-types/factories/contracts/TestSystemContract.sol/TestSystemContract__factory.ts +++ b/typechain-types/factories/contracts/TestSystemContract.sol/TestSystemContract__factory.ts @@ -275,7 +275,7 @@ const _abi = [ ] as const; const _bytecode = - "0x608060405234801561001057600080fd5b506040516108833803806108838339818101604052810190610032919061013e565b82600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f80699e81136d69cb8367ad52a994e25c722a86da654b561d0c14b61a777e7ac560405160405180910390a15050506101df565b600081519050610138816101c8565b92915050565b600080600060608486031215610157576101566101c3565b5b600061016586828701610129565b935050602061017686828701610129565b925050604061018786828701610129565b9150509250925092565b600061019c826101a3565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600080fd5b6101d181610191565b81146101dc57600080fd5b50565b610695806101ee6000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c806397770dff1161006657806397770dff14610134578063a7cb050714610150578063d7fd7afb1461016c578063d936a0121461019c578063ee2815ba146101ba57610093565b80630be1554714610098578063513a9c05146100c8578063569541b9146100f8578063842da36d14610116575b600080fd5b6100b260048036038101906100ad919061049d565b6101d6565b6040516100bf9190610568565b60405180910390f35b6100e260048036038101906100dd919061049d565b610209565b6040516100ef9190610568565b60405180910390f35b61010061023c565b60405161010d9190610568565b60405180910390f35b61011e610262565b60405161012b9190610568565b60405180910390f35b61014e60048036038101906101499190610470565b610288565b005b61016a6004803603810190610165919061050a565b610325565b005b6101866004803603810190610181919061049d565b610379565b6040516101939190610583565b60405180910390f35b6101a4610391565b6040516101b19190610568565b60405180910390f35b6101d460048036038101906101cf91906104ca565b6103b7565b005b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fdba79d534382d1a8ae108e4c8ecb27c6ae42ab8b91d44eedf88bd329f3868d5e600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405161031a9190610568565b60405180910390a150565b80600080848152602001908152602001600020819055507f49f492222906ac486c3c1401fa545626df1f0c0e5a77a05597ea2ed66af9850d828260405161036d9291906105c7565b60405180910390a15050565b60006020528060005260406000206000915090505481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b806001600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fd1b36d30f6248e97c473b4d1348ca164a4ef6759022f54a58ec200326c39c45d828260405161043a92919061059e565b60405180910390a15050565b60008135905061045581610631565b92915050565b60008135905061046a81610648565b92915050565b6000602082840312156104865761048561062c565b5b600061049484828501610446565b91505092915050565b6000602082840312156104b3576104b261062c565b5b60006104c18482850161045b565b91505092915050565b600080604083850312156104e1576104e061062c565b5b60006104ef8582860161045b565b925050602061050085828601610446565b9150509250929050565b600080604083850312156105215761052061062c565b5b600061052f8582860161045b565b92505060206105408582860161045b565b9150509250929050565b610553816105f0565b82525050565b61056281610622565b82525050565b600060208201905061057d600083018461054a565b92915050565b60006020820190506105986000830184610559565b92915050565b60006040820190506105b36000830185610559565b6105c0602083018461054a565b9392505050565b60006040820190506105dc6000830185610559565b6105e96020830184610559565b9392505050565b60006105fb82610602565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600080fd5b61063a816105f0565b811461064557600080fd5b50565b61065181610622565b811461065c57600080fd5b5056fea2646970667358221220e34e863920311779334318276ecdc5d68a2ccc3de054616e2a8fc239318f902b64736f6c63430008070033"; + "0x608060405234801561001057600080fd5b506040516108833803806108838339818101604052810190610032919061013e565b82600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f80699e81136d69cb8367ad52a994e25c722a86da654b561d0c14b61a777e7ac560405160405180910390a15050506101df565b600081519050610138816101c8565b92915050565b600080600060608486031215610157576101566101c3565b5b600061016586828701610129565b935050602061017686828701610129565b925050604061018786828701610129565b9150509250925092565b600061019c826101a3565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600080fd5b6101d181610191565b81146101dc57600080fd5b50565b610695806101ee6000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c806397770dff1161006657806397770dff14610134578063a7cb050714610150578063d7fd7afb1461016c578063d936a0121461019c578063ee2815ba146101ba57610093565b80630be1554714610098578063513a9c05146100c8578063569541b9146100f8578063842da36d14610116575b600080fd5b6100b260048036038101906100ad919061049d565b6101d6565b6040516100bf9190610568565b60405180910390f35b6100e260048036038101906100dd919061049d565b610209565b6040516100ef9190610568565b60405180910390f35b61010061023c565b60405161010d9190610568565b60405180910390f35b61011e610262565b60405161012b9190610568565b60405180910390f35b61014e60048036038101906101499190610470565b610288565b005b61016a6004803603810190610165919061050a565b610325565b005b6101866004803603810190610181919061049d565b610379565b6040516101939190610583565b60405180910390f35b6101a4610391565b6040516101b19190610568565b60405180910390f35b6101d460048036038101906101cf91906104ca565b6103b7565b005b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fdba79d534382d1a8ae108e4c8ecb27c6ae42ab8b91d44eedf88bd329f3868d5e600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405161031a9190610568565b60405180910390a150565b80600080848152602001908152602001600020819055507f49f492222906ac486c3c1401fa545626df1f0c0e5a77a05597ea2ed66af9850d828260405161036d9291906105c7565b60405180910390a15050565b60006020528060005260406000206000915090505481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b806001600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fd1b36d30f6248e97c473b4d1348ca164a4ef6759022f54a58ec200326c39c45d828260405161043a92919061059e565b60405180910390a15050565b60008135905061045581610631565b92915050565b60008135905061046a81610648565b92915050565b6000602082840312156104865761048561062c565b5b600061049484828501610446565b91505092915050565b6000602082840312156104b3576104b261062c565b5b60006104c18482850161045b565b91505092915050565b600080604083850312156104e1576104e061062c565b5b60006104ef8582860161045b565b925050602061050085828601610446565b9150509250929050565b600080604083850312156105215761052061062c565b5b600061052f8582860161045b565b92505060206105408582860161045b565b9150509250929050565b610553816105f0565b82525050565b61056281610622565b82525050565b600060208201905061057d600083018461054a565b92915050565b60006020820190506105986000830184610559565b92915050565b60006040820190506105b36000830185610559565b6105c0602083018461054a565b9392505050565b60006040820190506105dc6000830185610559565b6105e96020830184610559565b9392505050565b60006105fb82610602565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600080fd5b61063a816105f0565b811461064557600080fd5b50565b61065181610622565b811461065c57600080fd5b5056fea26469706673582212204385eb79cbfd3f4c16625b097917df623038e4a25f38987349e8b8396577151064736f6c63430008070033"; type TestSystemContractConstructorParams = | [signer?: Signer] diff --git a/typechain-types/hardhat.d.ts b/typechain-types/hardhat.d.ts index 827eff0f..a25b3118 100644 --- a/typechain-types/hardhat.d.ts +++ b/typechain-types/hardhat.d.ts @@ -76,6 +76,14 @@ declare module "hardhat/types/runtime" { name: "ZContract", signerOrOptions?: ethers.Signer | FactoryOptions ): Promise; + getContractFactory( + name: "SystemContract", + signerOrOptions?: ethers.Signer | FactoryOptions + ): Promise; + getContractFactory( + name: "SystemContractErrors", + signerOrOptions?: ethers.Signer | FactoryOptions + ): Promise; getContractFactory( name: "ZetaEthMock", signerOrOptions?: ethers.Signer | FactoryOptions @@ -181,6 +189,16 @@ declare module "hardhat/types/runtime" { address: string, signer?: ethers.Signer ): Promise; + getContractAt( + name: "SystemContract", + address: string, + signer?: ethers.Signer + ): Promise; + getContractAt( + name: "SystemContractErrors", + address: string, + signer?: ethers.Signer + ): Promise; getContractAt( name: "ZetaEthMock", address: string, diff --git a/typechain-types/index.ts b/typechain-types/index.ts index fe4ae387..9ca133ab 100644 --- a/typechain-types/index.ts +++ b/typechain-types/index.ts @@ -40,12 +40,14 @@ export type { IZRC20 } from "./@zetachain/protocol-contracts/contracts/zevm/inte export { IZRC20__factory } from "./factories/@zetachain/protocol-contracts/contracts/zevm/interfaces/IZRC20__factory"; export type { ZContract } from "./@zetachain/protocol-contracts/contracts/zevm/interfaces/ZContract"; export { ZContract__factory } from "./factories/@zetachain/protocol-contracts/contracts/zevm/interfaces/ZContract__factory"; +export type { SystemContract } from "./@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContract"; +export { SystemContract__factory } from "./factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContract__factory"; +export type { SystemContractErrors } from "./@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContractErrors"; +export { SystemContractErrors__factory } from "./factories/@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol/SystemContractErrors__factory"; export type { ZetaEthMock } from "./contracts/EthZetaMock.sol/ZetaEthMock"; export { ZetaEthMock__factory } from "./factories/contracts/EthZetaMock.sol/ZetaEthMock__factory"; export type { SwapHelperLib } from "./contracts/SwapHelperLib"; export { SwapHelperLib__factory } from "./factories/contracts/SwapHelperLib__factory"; -export type { SystemContractErrors } from "./contracts/TestSystemContract.sol/SystemContractErrors"; -export { SystemContractErrors__factory } from "./factories/contracts/TestSystemContract.sol/SystemContractErrors__factory"; export type { TestSystemContract } from "./contracts/TestSystemContract.sol/TestSystemContract"; export { TestSystemContract__factory } from "./factories/contracts/TestSystemContract.sol/TestSystemContract__factory"; export type { TestZRC20 } from "./contracts/TestZRC20"; diff --git a/yarn.lock b/yarn.lock index 82a7e5e1..774c0d69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6721,11 +6721,6 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -readline@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/readline/-/readline-1.3.0.tgz#c580d77ef2cfc8752b132498060dc9793a7ac01c" - integrity sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg== - rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"