From de279a9e1833a63636183715ea02dccf0fb34a8c Mon Sep 17 00:00:00 2001 From: smart_ex Date: Thu, 7 Jul 2022 16:41:39 +1000 Subject: [PATCH] add OVM gas oracle, typechain --- src/contracts/AggregatorAbi.ts | 250 ++++++---- src/contracts/ERC20Abi.ts | 250 +++++----- src/contracts/MulticallAbi.ts | 11 +- src/contracts/OffchainOracleAbi.ts | 250 ++++++---- src/contracts/OvmGasPriceOracleABI.ts | 427 ++++++++++++++++++ src/contracts/ProxyLightABI.ts | 174 +++---- src/contracts/TornadoABI.ts | 283 +++++++----- src/contracts/TornadoProxyABI.ts | 185 ++++---- src/contracts/common.ts | 2 + .../OvmGasPriceOracleABI__factory.ts | 316 +++++++++++++ src/contracts/factories/index.ts | 1 + src/contracts/index.ts | 2 + src/modules/contracts.ts | 14 +- 13 files changed, 1578 insertions(+), 587 deletions(-) create mode 100644 src/contracts/OvmGasPriceOracleABI.ts create mode 100644 src/contracts/factories/OvmGasPriceOracleABI__factory.ts diff --git a/src/contracts/AggregatorAbi.ts b/src/contracts/AggregatorAbi.ts index bb9e543..0aa17d0 100644 --- a/src/contracts/AggregatorAbi.ts +++ b/src/contracts/AggregatorAbi.ts @@ -15,11 +15,9 @@ import type { } 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'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; export interface AggregatorAbiInterface extends utils.Interface { - contractName: 'AggregatorAbi'; - functions: { 'addConnector(address)': FunctionFragment; 'addOracle(address,uint8)': FunctionFragment; @@ -53,19 +51,22 @@ export interface AggregatorAbiInterface extends utils.Interface { | 'transferOwnership', ): FunctionFragment; - encodeFunctionData(functionFragment: 'addConnector', values: [string]): string; - encodeFunctionData(functionFragment: 'addOracle', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'addConnector', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'addOracle', values: [PromiseOrValue, PromiseOrValue]): string; encodeFunctionData(functionFragment: 'connectors', values?: undefined): string; - encodeFunctionData(functionFragment: 'getRate', values: [string, string, boolean]): string; - encodeFunctionData(functionFragment: 'getRateToEth', values: [string, boolean]): string; + encodeFunctionData( + functionFragment: 'getRate', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'getRateToEth', values: [PromiseOrValue, PromiseOrValue]): string; encodeFunctionData(functionFragment: 'multiWrapper', values?: undefined): string; encodeFunctionData(functionFragment: 'oracles', values?: undefined): string; encodeFunctionData(functionFragment: 'owner', values?: undefined): string; - encodeFunctionData(functionFragment: 'removeConnector', values: [string]): string; - encodeFunctionData(functionFragment: 'removeOracle', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'removeConnector', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'removeOracle', values: [PromiseOrValue, PromiseOrValue]): string; encodeFunctionData(functionFragment: 'renounceOwnership', values?: undefined): string; - encodeFunctionData(functionFragment: 'setMultiWrapper', values: [string]): string; - encodeFunctionData(functionFragment: 'transferOwnership', values: [string]): string; + encodeFunctionData(functionFragment: 'setMultiWrapper', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'transferOwnership', values: [PromiseOrValue]): string; decodeFunctionResult(functionFragment: 'addConnector', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'addOracle', data: BytesLike): Result; @@ -144,8 +145,6 @@ export type OwnershipTransferredEvent = TypedEvent<[string, string], OwnershipTr export type OwnershipTransferredEventFilter = TypedEventFilter; export interface AggregatorAbi extends BaseContract { - contractName: 'AggregatorAbi'; - connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; deployed(): Promise; @@ -168,26 +167,29 @@ export interface AggregatorAbi extends BaseContract { removeListener: OnEvent; functions: { - addConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; + addConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; addOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; connectors(overrides?: CallOverrides): Promise<[string[]] & { allConnectors: string[] }>; getRate( - srcToken: string, - dstToken: string, - useWrappers: boolean, + srcToken: PromiseOrValue, + dstToken: PromiseOrValue, + useWrappers: PromiseOrValue, overrides?: CallOverrides, ): Promise<[BigNumber] & { weightedRate: BigNumber }>; getRateToEth( - srcToken: string, - useSrcWrappers: boolean, + srcToken: PromiseOrValue, + useSrcWrappers: PromiseOrValue, overrides?: CallOverrides, ): Promise<[BigNumber] & { weightedRate: BigNumber }>; @@ -197,40 +199,55 @@ export interface AggregatorAbi extends BaseContract { owner(overrides?: CallOverrides): Promise<[string]>; - removeConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; - - removeOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + removeConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + removeOracle( + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise; setMultiWrapper( - _multiWrapper: string, - overrides?: Overrides & { from?: string | Promise }, + _multiWrapper: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; transferOwnership( - newOwner: string, - overrides?: Overrides & { from?: string | Promise }, + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; }; - addConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; + addConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; addOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; connectors(overrides?: CallOverrides): Promise; - getRate(srcToken: string, dstToken: string, useWrappers: boolean, overrides?: CallOverrides): Promise; + getRate( + srcToken: PromiseOrValue, + dstToken: PromiseOrValue, + useWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; - getRateToEth(srcToken: string, useSrcWrappers: boolean, overrides?: CallOverrides): Promise; + getRateToEth( + srcToken: PromiseOrValue, + useSrcWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; multiWrapper(overrides?: CallOverrides): Promise; @@ -238,33 +255,48 @@ export interface AggregatorAbi extends BaseContract { owner(overrides?: CallOverrides): Promise; - removeConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; + removeConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; removeOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise; setMultiWrapper( - _multiWrapper: string, - overrides?: Overrides & { from?: string | Promise }, + _multiWrapper: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - transferOwnership(newOwner: string, overrides?: Overrides & { from?: string | Promise }): Promise; + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; callStatic: { - addConnector(connector: string, overrides?: CallOverrides): Promise; + addConnector(connector: PromiseOrValue, overrides?: CallOverrides): Promise; - addOracle(oracle: string, oracleKind: BigNumberish, overrides?: CallOverrides): Promise; + addOracle(oracle: PromiseOrValue, oracleKind: PromiseOrValue, overrides?: CallOverrides): Promise; connectors(overrides?: CallOverrides): Promise; - getRate(srcToken: string, dstToken: string, useWrappers: boolean, overrides?: CallOverrides): Promise; + getRate( + srcToken: PromiseOrValue, + dstToken: PromiseOrValue, + useWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; - getRateToEth(srcToken: string, useSrcWrappers: boolean, overrides?: CallOverrides): Promise; + getRateToEth( + srcToken: PromiseOrValue, + useSrcWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; multiWrapper(overrides?: CallOverrides): Promise; @@ -272,15 +304,19 @@ export interface AggregatorAbi extends BaseContract { owner(overrides?: CallOverrides): Promise; - removeConnector(connector: string, overrides?: CallOverrides): Promise; + removeConnector(connector: PromiseOrValue, overrides?: CallOverrides): Promise; - removeOracle(oracle: string, oracleKind: BigNumberish, overrides?: CallOverrides): Promise; + removeOracle( + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; renounceOwnership(overrides?: CallOverrides): Promise; - setMultiWrapper(_multiWrapper: string, overrides?: CallOverrides): Promise; + setMultiWrapper(_multiWrapper: PromiseOrValue, overrides?: CallOverrides): Promise; - transferOwnership(newOwner: string, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise; }; filters: { @@ -300,26 +336,41 @@ export interface AggregatorAbi extends BaseContract { OracleRemoved(oracle?: null, oracleType?: null): OracleRemovedEventFilter; 'OwnershipTransferred(address,address)'( - previousOwner?: string | null, - newOwner?: string | null, + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter; + OwnershipTransferred( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, ): OwnershipTransferredEventFilter; - OwnershipTransferred(previousOwner?: string | null, newOwner?: string | null): OwnershipTransferredEventFilter; }; estimateGas: { - addConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; + addConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; addOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; connectors(overrides?: CallOverrides): Promise; - getRate(srcToken: string, dstToken: string, useWrappers: boolean, overrides?: CallOverrides): Promise; + getRate( + srcToken: PromiseOrValue, + dstToken: PromiseOrValue, + useWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; - getRateToEth(srcToken: string, useSrcWrappers: boolean, overrides?: CallOverrides): Promise; + getRateToEth( + srcToken: PromiseOrValue, + useSrcWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; multiWrapper(overrides?: CallOverrides): Promise; @@ -327,35 +378,56 @@ export interface AggregatorAbi extends BaseContract { owner(overrides?: CallOverrides): Promise; - removeConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; - - removeOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + removeConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + removeOracle( + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; - setMultiWrapper(_multiWrapper: string, overrides?: Overrides & { from?: string | Promise }): Promise; + renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - transferOwnership(newOwner: string, overrides?: Overrides & { from?: string | Promise }): Promise; + setMultiWrapper( + _multiWrapper: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; }; populateTransaction: { - addConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; + addConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; addOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; connectors(overrides?: CallOverrides): Promise; - getRate(srcToken: string, dstToken: string, useWrappers: boolean, overrides?: CallOverrides): Promise; + getRate( + srcToken: PromiseOrValue, + dstToken: PromiseOrValue, + useWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; - getRateToEth(srcToken: string, useSrcWrappers: boolean, overrides?: CallOverrides): Promise; + getRateToEth( + srcToken: PromiseOrValue, + useSrcWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; multiWrapper(overrides?: CallOverrides): Promise; @@ -364,26 +436,26 @@ export interface AggregatorAbi extends BaseContract { owner(overrides?: CallOverrides): Promise; removeConnector( - connector: string, - overrides?: Overrides & { from?: string | Promise }, + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; removeOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise; setMultiWrapper( - _multiWrapper: string, - overrides?: Overrides & { from?: string | Promise }, + _multiWrapper: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; transferOwnership( - newOwner: string, - overrides?: Overrides & { from?: string | Promise }, + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; }; } diff --git a/src/contracts/ERC20Abi.ts b/src/contracts/ERC20Abi.ts index ffcd5fa..7f89f6a 100644 --- a/src/contracts/ERC20Abi.ts +++ b/src/contracts/ERC20Abi.ts @@ -15,11 +15,9 @@ import type { } 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'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; export interface ERC20AbiInterface extends utils.Interface { - contractName: 'ERC20Abi'; - functions: { 'totalSupply()': FunctionFragment; '_totalSupply()': FunctionFragment; @@ -47,15 +45,26 @@ export interface ERC20AbiInterface extends utils.Interface { encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; encodeFunctionData(functionFragment: '_totalSupply', values?: undefined): string; - encodeFunctionData(functionFragment: 'balanceOf', values: [string]): string; - encodeFunctionData(functionFragment: 'transfer', values: [string, BigNumberish]): string; - encodeFunctionData(functionFragment: 'allowance', values: [string, string]): string; - encodeFunctionData(functionFragment: 'transferFrom', values: [string, string, BigNumberish]): string; - encodeFunctionData(functionFragment: 'approve', values: [string, BigNumberish]): string; - encodeFunctionData(functionFragment: 'nonces', values: [string]): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'transfer', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'allowance', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'transferFrom', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'approve', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'nonces', values: [PromiseOrValue]): string; encodeFunctionData( functionFragment: 'permit', - values: [string, string, BigNumberish, BigNumberish, BigNumberish, BytesLike, BytesLike], + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], ): string; decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; @@ -96,8 +105,6 @@ export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEven export type TransferEventFilter = TypedEventFilter; export interface ERC20Abi extends BaseContract { - contractName: 'ERC20Abi'; - connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; deployed(): Promise; @@ -124,40 +131,40 @@ export interface ERC20Abi extends BaseContract { _totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; - balanceOf(who: string, overrides?: CallOverrides): Promise<[BigNumber]>; + balanceOf(who: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; transfer( - to: string, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + to: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - allowance(owner: string, spender: string, overrides?: CallOverrides): Promise<[BigNumber]>; + allowance(owner: PromiseOrValue, spender: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; transferFrom( - from: string, - to: string, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + from: PromiseOrValue, + to: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; approve( - spender: string, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + spender: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - nonces(owner: string, overrides?: CallOverrides): Promise<[BigNumber]>; + nonces(owner: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; permit( - owner: string, - spender: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise }, + owner: PromiseOrValue, + spender: PromiseOrValue, + amount: PromiseOrValue, + deadline: PromiseOrValue, + v: PromiseOrValue, + r: PromiseOrValue, + s: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; }; @@ -165,40 +172,40 @@ export interface ERC20Abi extends BaseContract { _totalSupply(overrides?: CallOverrides): Promise; - balanceOf(who: string, overrides?: CallOverrides): Promise; + balanceOf(who: PromiseOrValue, overrides?: CallOverrides): Promise; transfer( - to: string, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + to: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + allowance(owner: PromiseOrValue, spender: PromiseOrValue, overrides?: CallOverrides): Promise; transferFrom( - from: string, - to: string, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + from: PromiseOrValue, + to: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; approve( - spender: string, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + spender: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - nonces(owner: string, overrides?: CallOverrides): Promise; + nonces(owner: PromiseOrValue, overrides?: CallOverrides): Promise; permit( - owner: string, - spender: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise }, + owner: PromiseOrValue, + spender: PromiseOrValue, + amount: PromiseOrValue, + deadline: PromiseOrValue, + v: PromiseOrValue, + r: PromiseOrValue, + s: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; callStatic: { @@ -206,36 +213,49 @@ export interface ERC20Abi extends BaseContract { _totalSupply(overrides?: CallOverrides): Promise; - balanceOf(who: string, overrides?: CallOverrides): Promise; + balanceOf(who: PromiseOrValue, overrides?: CallOverrides): Promise; - transfer(to: string, value: BigNumberish, overrides?: CallOverrides): Promise; + transfer(to: PromiseOrValue, value: PromiseOrValue, overrides?: CallOverrides): Promise; - allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + allowance(owner: PromiseOrValue, spender: PromiseOrValue, overrides?: CallOverrides): Promise; - transferFrom(from: string, to: string, value: BigNumberish, overrides?: CallOverrides): Promise; + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + value: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; - approve(spender: string, value: BigNumberish, overrides?: CallOverrides): Promise; + approve(spender: PromiseOrValue, value: PromiseOrValue, overrides?: CallOverrides): Promise; - nonces(owner: string, overrides?: CallOverrides): Promise; + nonces(owner: PromiseOrValue, overrides?: CallOverrides): Promise; permit( - owner: string, - spender: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, + owner: PromiseOrValue, + spender: PromiseOrValue, + amount: PromiseOrValue, + deadline: PromiseOrValue, + v: PromiseOrValue, + r: PromiseOrValue, + s: PromiseOrValue, overrides?: CallOverrides, ): Promise; }; filters: { - 'Approval(address,address,uint256)'(owner?: string | null, spender?: string | null, value?: null): ApprovalEventFilter; - Approval(owner?: string | null, spender?: string | null, value?: null): ApprovalEventFilter; + 'Approval(address,address,uint256)'( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null, + ): ApprovalEventFilter; + Approval(owner?: PromiseOrValue | null, spender?: PromiseOrValue | null, value?: null): ApprovalEventFilter; - 'Transfer(address,address,uint256)'(from?: string | null, to?: string | null, value?: null): TransferEventFilter; - Transfer(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + 'Transfer(address,address,uint256)'( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null, + ): TransferEventFilter; + Transfer(from?: PromiseOrValue | null, to?: PromiseOrValue | null, value?: null): TransferEventFilter; }; estimateGas: { @@ -243,36 +263,40 @@ export interface ERC20Abi extends BaseContract { _totalSupply(overrides?: CallOverrides): Promise; - balanceOf(who: string, overrides?: CallOverrides): Promise; + balanceOf(who: PromiseOrValue, overrides?: CallOverrides): Promise; - transfer(to: string, value: BigNumberish, overrides?: Overrides & { from?: string | Promise }): Promise; + transfer( + to: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; - allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + allowance(owner: PromiseOrValue, spender: PromiseOrValue, overrides?: CallOverrides): Promise; transferFrom( - from: string, - to: string, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + from: PromiseOrValue, + to: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; approve( - spender: string, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + spender: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - nonces(owner: string, overrides?: CallOverrides): Promise; + nonces(owner: PromiseOrValue, overrides?: CallOverrides): Promise; permit( - owner: string, - spender: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise }, + owner: PromiseOrValue, + spender: PromiseOrValue, + amount: PromiseOrValue, + deadline: PromiseOrValue, + v: PromiseOrValue, + r: PromiseOrValue, + s: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; }; @@ -281,40 +305,44 @@ export interface ERC20Abi extends BaseContract { _totalSupply(overrides?: CallOverrides): Promise; - balanceOf(who: string, overrides?: CallOverrides): Promise; + balanceOf(who: PromiseOrValue, overrides?: CallOverrides): Promise; transfer( - to: string, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + to: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; transferFrom( - from: string, - to: string, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + from: PromiseOrValue, + to: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; approve( - spender: string, - value: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + spender: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - nonces(owner: string, overrides?: CallOverrides): Promise; + nonces(owner: PromiseOrValue, overrides?: CallOverrides): Promise; permit( - owner: string, - spender: string, - amount: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - overrides?: Overrides & { from?: string | Promise }, + owner: PromiseOrValue, + spender: PromiseOrValue, + amount: PromiseOrValue, + deadline: PromiseOrValue, + v: PromiseOrValue, + r: PromiseOrValue, + s: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; }; } diff --git a/src/contracts/MulticallAbi.ts b/src/contracts/MulticallAbi.ts index 9cc9e69..a50de79 100644 --- a/src/contracts/MulticallAbi.ts +++ b/src/contracts/MulticallAbi.ts @@ -4,10 +4,13 @@ import type { BaseContract, BigNumber, BytesLike, CallOverrides, PopulatedTransaction, Signer, utils } from 'ethers'; import type { FunctionFragment, Result } from '@ethersproject/abi'; import type { Listener, Provider } from '@ethersproject/providers'; -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; export declare namespace MultiCall { - export type CallStruct = { to: string; data: BytesLike }; + export type CallStruct = { + to: PromiseOrValue; + data: PromiseOrValue; + }; export type CallStructOutput = [string, string] & { to: string; @@ -16,8 +19,6 @@ export declare namespace MultiCall { } export interface MulticallAbiInterface extends utils.Interface { - contractName: 'MulticallAbi'; - functions: { 'multicall((address,bytes)[])': FunctionFragment; }; @@ -32,8 +33,6 @@ export interface MulticallAbiInterface extends utils.Interface { } export interface MulticallAbi extends BaseContract { - contractName: 'MulticallAbi'; - connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; deployed(): Promise; diff --git a/src/contracts/OffchainOracleAbi.ts b/src/contracts/OffchainOracleAbi.ts index b26251b..6b37065 100644 --- a/src/contracts/OffchainOracleAbi.ts +++ b/src/contracts/OffchainOracleAbi.ts @@ -15,11 +15,9 @@ import type { } 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'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; export interface OffchainOracleAbiInterface extends utils.Interface { - contractName: 'OffchainOracleAbi'; - functions: { 'addConnector(address)': FunctionFragment; 'addOracle(address,uint8)': FunctionFragment; @@ -53,19 +51,22 @@ export interface OffchainOracleAbiInterface extends utils.Interface { | 'transferOwnership', ): FunctionFragment; - encodeFunctionData(functionFragment: 'addConnector', values: [string]): string; - encodeFunctionData(functionFragment: 'addOracle', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'addConnector', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'addOracle', values: [PromiseOrValue, PromiseOrValue]): string; encodeFunctionData(functionFragment: 'connectors', values?: undefined): string; - encodeFunctionData(functionFragment: 'getRate', values: [string, string, boolean]): string; - encodeFunctionData(functionFragment: 'getRateToEth', values: [string, boolean]): string; + encodeFunctionData( + functionFragment: 'getRate', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'getRateToEth', values: [PromiseOrValue, PromiseOrValue]): string; encodeFunctionData(functionFragment: 'multiWrapper', values?: undefined): string; encodeFunctionData(functionFragment: 'oracles', values?: undefined): string; encodeFunctionData(functionFragment: 'owner', values?: undefined): string; - encodeFunctionData(functionFragment: 'removeConnector', values: [string]): string; - encodeFunctionData(functionFragment: 'removeOracle', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'removeConnector', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'removeOracle', values: [PromiseOrValue, PromiseOrValue]): string; encodeFunctionData(functionFragment: 'renounceOwnership', values?: undefined): string; - encodeFunctionData(functionFragment: 'setMultiWrapper', values: [string]): string; - encodeFunctionData(functionFragment: 'transferOwnership', values: [string]): string; + encodeFunctionData(functionFragment: 'setMultiWrapper', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'transferOwnership', values: [PromiseOrValue]): string; decodeFunctionResult(functionFragment: 'addConnector', data: BytesLike): Result; decodeFunctionResult(functionFragment: 'addOracle', data: BytesLike): Result; @@ -144,8 +145,6 @@ export type OwnershipTransferredEvent = TypedEvent<[string, string], OwnershipTr export type OwnershipTransferredEventFilter = TypedEventFilter; export interface OffchainOracleAbi extends BaseContract { - contractName: 'OffchainOracleAbi'; - connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; deployed(): Promise; @@ -168,26 +167,29 @@ export interface OffchainOracleAbi extends BaseContract { removeListener: OnEvent; functions: { - addConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; + addConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; addOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; connectors(overrides?: CallOverrides): Promise<[string[]] & { allConnectors: string[] }>; getRate( - srcToken: string, - dstToken: string, - useWrappers: boolean, + srcToken: PromiseOrValue, + dstToken: PromiseOrValue, + useWrappers: PromiseOrValue, overrides?: CallOverrides, ): Promise<[BigNumber] & { weightedRate: BigNumber }>; getRateToEth( - srcToken: string, - useSrcWrappers: boolean, + srcToken: PromiseOrValue, + useSrcWrappers: PromiseOrValue, overrides?: CallOverrides, ): Promise<[BigNumber] & { weightedRate: BigNumber }>; @@ -197,40 +199,55 @@ export interface OffchainOracleAbi extends BaseContract { owner(overrides?: CallOverrides): Promise<[string]>; - removeConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; - - removeOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + removeConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + removeOracle( + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise; setMultiWrapper( - _multiWrapper: string, - overrides?: Overrides & { from?: string | Promise }, + _multiWrapper: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; transferOwnership( - newOwner: string, - overrides?: Overrides & { from?: string | Promise }, + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; }; - addConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; + addConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; addOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; connectors(overrides?: CallOverrides): Promise; - getRate(srcToken: string, dstToken: string, useWrappers: boolean, overrides?: CallOverrides): Promise; + getRate( + srcToken: PromiseOrValue, + dstToken: PromiseOrValue, + useWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; - getRateToEth(srcToken: string, useSrcWrappers: boolean, overrides?: CallOverrides): Promise; + getRateToEth( + srcToken: PromiseOrValue, + useSrcWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; multiWrapper(overrides?: CallOverrides): Promise; @@ -238,33 +255,48 @@ export interface OffchainOracleAbi extends BaseContract { owner(overrides?: CallOverrides): Promise; - removeConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; + removeConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; removeOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise; setMultiWrapper( - _multiWrapper: string, - overrides?: Overrides & { from?: string | Promise }, + _multiWrapper: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - transferOwnership(newOwner: string, overrides?: Overrides & { from?: string | Promise }): Promise; + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; callStatic: { - addConnector(connector: string, overrides?: CallOverrides): Promise; + addConnector(connector: PromiseOrValue, overrides?: CallOverrides): Promise; - addOracle(oracle: string, oracleKind: BigNumberish, overrides?: CallOverrides): Promise; + addOracle(oracle: PromiseOrValue, oracleKind: PromiseOrValue, overrides?: CallOverrides): Promise; connectors(overrides?: CallOverrides): Promise; - getRate(srcToken: string, dstToken: string, useWrappers: boolean, overrides?: CallOverrides): Promise; + getRate( + srcToken: PromiseOrValue, + dstToken: PromiseOrValue, + useWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; - getRateToEth(srcToken: string, useSrcWrappers: boolean, overrides?: CallOverrides): Promise; + getRateToEth( + srcToken: PromiseOrValue, + useSrcWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; multiWrapper(overrides?: CallOverrides): Promise; @@ -272,15 +304,19 @@ export interface OffchainOracleAbi extends BaseContract { owner(overrides?: CallOverrides): Promise; - removeConnector(connector: string, overrides?: CallOverrides): Promise; + removeConnector(connector: PromiseOrValue, overrides?: CallOverrides): Promise; - removeOracle(oracle: string, oracleKind: BigNumberish, overrides?: CallOverrides): Promise; + removeOracle( + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; renounceOwnership(overrides?: CallOverrides): Promise; - setMultiWrapper(_multiWrapper: string, overrides?: CallOverrides): Promise; + setMultiWrapper(_multiWrapper: PromiseOrValue, overrides?: CallOverrides): Promise; - transferOwnership(newOwner: string, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise; }; filters: { @@ -300,26 +336,41 @@ export interface OffchainOracleAbi extends BaseContract { OracleRemoved(oracle?: null, oracleType?: null): OracleRemovedEventFilter; 'OwnershipTransferred(address,address)'( - previousOwner?: string | null, - newOwner?: string | null, + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter; + OwnershipTransferred( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, ): OwnershipTransferredEventFilter; - OwnershipTransferred(previousOwner?: string | null, newOwner?: string | null): OwnershipTransferredEventFilter; }; estimateGas: { - addConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; + addConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; addOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; connectors(overrides?: CallOverrides): Promise; - getRate(srcToken: string, dstToken: string, useWrappers: boolean, overrides?: CallOverrides): Promise; + getRate( + srcToken: PromiseOrValue, + dstToken: PromiseOrValue, + useWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; - getRateToEth(srcToken: string, useSrcWrappers: boolean, overrides?: CallOverrides): Promise; + getRateToEth( + srcToken: PromiseOrValue, + useSrcWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; multiWrapper(overrides?: CallOverrides): Promise; @@ -327,35 +378,56 @@ export interface OffchainOracleAbi extends BaseContract { owner(overrides?: CallOverrides): Promise; - removeConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; - - removeOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + removeConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + removeOracle( + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; - setMultiWrapper(_multiWrapper: string, overrides?: Overrides & { from?: string | Promise }): Promise; + renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise; - transferOwnership(newOwner: string, overrides?: Overrides & { from?: string | Promise }): Promise; + setMultiWrapper( + _multiWrapper: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; }; populateTransaction: { - addConnector(connector: string, overrides?: Overrides & { from?: string | Promise }): Promise; + addConnector( + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; addOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; connectors(overrides?: CallOverrides): Promise; - getRate(srcToken: string, dstToken: string, useWrappers: boolean, overrides?: CallOverrides): Promise; + getRate( + srcToken: PromiseOrValue, + dstToken: PromiseOrValue, + useWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; - getRateToEth(srcToken: string, useSrcWrappers: boolean, overrides?: CallOverrides): Promise; + getRateToEth( + srcToken: PromiseOrValue, + useSrcWrappers: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; multiWrapper(overrides?: CallOverrides): Promise; @@ -364,26 +436,26 @@ export interface OffchainOracleAbi extends BaseContract { owner(overrides?: CallOverrides): Promise; removeConnector( - connector: string, - overrides?: Overrides & { from?: string | Promise }, + connector: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; removeOracle( - oracle: string, - oracleKind: BigNumberish, - overrides?: Overrides & { from?: string | Promise }, + oracle: PromiseOrValue, + oracleKind: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - renounceOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise; setMultiWrapper( - _multiWrapper: string, - overrides?: Overrides & { from?: string | Promise }, + _multiWrapper: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; transferOwnership( - newOwner: string, - overrides?: Overrides & { from?: string | Promise }, + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; }; } diff --git a/src/contracts/OvmGasPriceOracleABI.ts b/src/contracts/OvmGasPriceOracleABI.ts new file mode 100644 index 0000000..c50e2df --- /dev/null +++ b/src/contracts/OvmGasPriceOracleABI.ts @@ -0,0 +1,427 @@ +/* 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 interface OvmGasPriceOracleABIInterface extends utils.Interface { + functions: { + 'decimals()': FunctionFragment; + 'gasPrice()': FunctionFragment; + 'getL1Fee(bytes)': FunctionFragment; + 'getL1GasUsed(bytes)': FunctionFragment; + 'l1BaseFee()': FunctionFragment; + 'overhead()': FunctionFragment; + 'owner()': FunctionFragment; + 'renounceOwnership()': FunctionFragment; + 'scalar()': FunctionFragment; + 'setDecimals(uint256)': FunctionFragment; + 'setGasPrice(uint256)': FunctionFragment; + 'setL1BaseFee(uint256)': FunctionFragment; + 'setOverhead(uint256)': FunctionFragment; + 'setScalar(uint256)': FunctionFragment; + 'transferOwnership(address)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'decimals' + | 'gasPrice' + | 'getL1Fee' + | 'getL1GasUsed' + | 'l1BaseFee' + | 'overhead' + | 'owner' + | 'renounceOwnership' + | 'scalar' + | 'setDecimals' + | 'setGasPrice' + | 'setL1BaseFee' + | 'setOverhead' + | 'setScalar' + | 'transferOwnership', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'decimals', values?: undefined): string; + encodeFunctionData(functionFragment: 'gasPrice', values?: undefined): string; + encodeFunctionData(functionFragment: 'getL1Fee', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'getL1GasUsed', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'l1BaseFee', values?: undefined): string; + encodeFunctionData(functionFragment: 'overhead', values?: undefined): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'renounceOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'scalar', values?: undefined): string; + encodeFunctionData(functionFragment: 'setDecimals', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setGasPrice', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setL1BaseFee', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setOverhead', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setScalar', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'transferOwnership', values: [PromiseOrValue]): string; + + decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gasPrice', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getL1Fee', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getL1GasUsed', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'l1BaseFee', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'overhead', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renounceOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'scalar', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setDecimals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setGasPrice', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setL1BaseFee', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setOverhead', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setScalar', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result; + + events: { + 'DecimalsUpdated(uint256)': EventFragment; + 'GasPriceUpdated(uint256)': EventFragment; + 'L1BaseFeeUpdated(uint256)': EventFragment; + 'OverheadUpdated(uint256)': EventFragment; + 'OwnershipTransferred(address,address)': EventFragment; + 'ScalarUpdated(uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'DecimalsUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'GasPriceUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'L1BaseFeeUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OverheadUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ScalarUpdated'): EventFragment; +} + +export interface DecimalsUpdatedEventObject { + arg0: BigNumber; +} +export type DecimalsUpdatedEvent = TypedEvent<[BigNumber], DecimalsUpdatedEventObject>; + +export type DecimalsUpdatedEventFilter = TypedEventFilter; + +export interface GasPriceUpdatedEventObject { + arg0: BigNumber; +} +export type GasPriceUpdatedEvent = TypedEvent<[BigNumber], GasPriceUpdatedEventObject>; + +export type GasPriceUpdatedEventFilter = TypedEventFilter; + +export interface L1BaseFeeUpdatedEventObject { + arg0: BigNumber; +} +export type L1BaseFeeUpdatedEvent = TypedEvent<[BigNumber], L1BaseFeeUpdatedEventObject>; + +export type L1BaseFeeUpdatedEventFilter = TypedEventFilter; + +export interface OverheadUpdatedEventObject { + arg0: BigNumber; +} +export type OverheadUpdatedEvent = TypedEvent<[BigNumber], OverheadUpdatedEventObject>; + +export type OverheadUpdatedEventFilter = TypedEventFilter; + +export interface OwnershipTransferredEventObject { + previousOwner: string; + newOwner: string; +} +export type OwnershipTransferredEvent = TypedEvent<[string, string], OwnershipTransferredEventObject>; + +export type OwnershipTransferredEventFilter = TypedEventFilter; + +export interface ScalarUpdatedEventObject { + arg0: BigNumber; +} +export type ScalarUpdatedEvent = TypedEvent<[BigNumber], ScalarUpdatedEventObject>; + +export type ScalarUpdatedEventFilter = TypedEventFilter; + +export interface OvmGasPriceOracleABI extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: OvmGasPriceOracleABIInterface; + + 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: { + decimals(overrides?: CallOverrides): Promise<[BigNumber]>; + + gasPrice(overrides?: CallOverrides): Promise<[BigNumber]>; + + getL1Fee(_data: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + + getL1GasUsed(_data: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + + l1BaseFee(overrides?: CallOverrides): Promise<[BigNumber]>; + + overhead(overrides?: CallOverrides): Promise<[BigNumber]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + scalar(overrides?: CallOverrides): Promise<[BigNumber]>; + + setDecimals( + _decimals: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setGasPrice( + _gasPrice: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setL1BaseFee( + _baseFee: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setOverhead( + _overhead: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setScalar( + _scalar: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + }; + + decimals(overrides?: CallOverrides): Promise; + + gasPrice(overrides?: CallOverrides): Promise; + + getL1Fee(_data: PromiseOrValue, overrides?: CallOverrides): Promise; + + getL1GasUsed(_data: PromiseOrValue, overrides?: CallOverrides): Promise; + + l1BaseFee(overrides?: CallOverrides): Promise; + + overhead(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + scalar(overrides?: CallOverrides): Promise; + + setDecimals( + _decimals: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setGasPrice( + _gasPrice: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setL1BaseFee( + _baseFee: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setOverhead( + _overhead: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setScalar( + _scalar: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + callStatic: { + decimals(overrides?: CallOverrides): Promise; + + gasPrice(overrides?: CallOverrides): Promise; + + getL1Fee(_data: PromiseOrValue, overrides?: CallOverrides): Promise; + + getL1GasUsed(_data: PromiseOrValue, overrides?: CallOverrides): Promise; + + l1BaseFee(overrides?: CallOverrides): Promise; + + overhead(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + renounceOwnership(overrides?: CallOverrides): Promise; + + scalar(overrides?: CallOverrides): Promise; + + setDecimals(_decimals: PromiseOrValue, overrides?: CallOverrides): Promise; + + setGasPrice(_gasPrice: PromiseOrValue, overrides?: CallOverrides): Promise; + + setL1BaseFee(_baseFee: PromiseOrValue, overrides?: CallOverrides): Promise; + + setOverhead(_overhead: PromiseOrValue, overrides?: CallOverrides): Promise; + + setScalar(_scalar: PromiseOrValue, overrides?: CallOverrides): Promise; + + transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + + filters: { + 'DecimalsUpdated(uint256)'(arg0?: null): DecimalsUpdatedEventFilter; + DecimalsUpdated(arg0?: null): DecimalsUpdatedEventFilter; + + 'GasPriceUpdated(uint256)'(arg0?: null): GasPriceUpdatedEventFilter; + GasPriceUpdated(arg0?: null): GasPriceUpdatedEventFilter; + + 'L1BaseFeeUpdated(uint256)'(arg0?: null): L1BaseFeeUpdatedEventFilter; + L1BaseFeeUpdated(arg0?: null): L1BaseFeeUpdatedEventFilter; + + 'OverheadUpdated(uint256)'(arg0?: null): OverheadUpdatedEventFilter; + OverheadUpdated(arg0?: null): OverheadUpdatedEventFilter; + + 'OwnershipTransferred(address,address)'( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter; + OwnershipTransferred( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter; + + 'ScalarUpdated(uint256)'(arg0?: null): ScalarUpdatedEventFilter; + ScalarUpdated(arg0?: null): ScalarUpdatedEventFilter; + }; + + estimateGas: { + decimals(overrides?: CallOverrides): Promise; + + gasPrice(overrides?: CallOverrides): Promise; + + getL1Fee(_data: PromiseOrValue, overrides?: CallOverrides): Promise; + + getL1GasUsed(_data: PromiseOrValue, overrides?: CallOverrides): Promise; + + l1BaseFee(overrides?: CallOverrides): Promise; + + overhead(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + scalar(overrides?: CallOverrides): Promise; + + setDecimals( + _decimals: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setGasPrice( + _gasPrice: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setL1BaseFee( + _baseFee: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setOverhead( + _overhead: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setScalar( + _scalar: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + }; + + populateTransaction: { + decimals(overrides?: CallOverrides): Promise; + + gasPrice(overrides?: CallOverrides): Promise; + + getL1Fee(_data: PromiseOrValue, overrides?: CallOverrides): Promise; + + getL1GasUsed(_data: PromiseOrValue, overrides?: CallOverrides): Promise; + + l1BaseFee(overrides?: CallOverrides): Promise; + + overhead(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + renounceOwnership(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + scalar(overrides?: CallOverrides): Promise; + + setDecimals( + _decimals: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setGasPrice( + _gasPrice: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setL1BaseFee( + _baseFee: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setOverhead( + _overhead: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setScalar( + _scalar: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + }; +} diff --git a/src/contracts/ProxyLightABI.ts b/src/contracts/ProxyLightABI.ts index d8be59b..a7195df 100644 --- a/src/contracts/ProxyLightABI.ts +++ b/src/contracts/ProxyLightABI.ts @@ -16,11 +16,9 @@ import type { } 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'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; export interface ProxyLightABIInterface extends utils.Interface { - contractName: 'ProxyLightABI'; - functions: { 'backupNotes(bytes[])': FunctionFragment; 'deposit(address,bytes32,bytes)': FunctionFragment; @@ -29,11 +27,23 @@ export interface ProxyLightABIInterface extends utils.Interface { getFunction(nameOrSignatureOrTopic: 'backupNotes' | 'deposit' | 'withdraw'): FunctionFragment; - encodeFunctionData(functionFragment: 'backupNotes', values: [BytesLike[]]): string; - encodeFunctionData(functionFragment: 'deposit', values: [string, BytesLike, BytesLike]): string; + encodeFunctionData(functionFragment: 'backupNotes', values: [PromiseOrValue[]]): string; + encodeFunctionData( + functionFragment: 'deposit', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; encodeFunctionData( functionFragment: 'withdraw', - values: [string, BytesLike, BytesLike, BytesLike, string, string, BigNumberish, BigNumberish], + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], ): string; decodeFunctionResult(functionFragment: 'backupNotes', data: BytesLike): Result; @@ -56,8 +66,6 @@ export type EncryptedNoteEvent = TypedEvent<[string, string], EncryptedNoteEvent export type EncryptedNoteEventFilter = TypedEventFilter; export interface ProxyLightABI extends BaseContract { - contractName: 'ProxyLightABI'; - connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; deployed(): Promise; @@ -81,123 +89,131 @@ export interface ProxyLightABI extends BaseContract { functions: { backupNotes( - _encryptedNotes: BytesLike[], - overrides?: Overrides & { from?: string | Promise }, + _encryptedNotes: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; deposit( - _tornado: string, - _commitment: BytesLike, - _encryptedNote: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise }, + _tornado: PromiseOrValue, + _commitment: PromiseOrValue, + _encryptedNote: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; withdraw( - _tornado: string, - _proof: BytesLike, - _root: BytesLike, - _nullifierHash: BytesLike, - _recipient: string, - _relayer: string, - _fee: BigNumberish, - _refund: BigNumberish, - overrides?: PayableOverrides & { from?: string | Promise }, + _tornado: PromiseOrValue, + _proof: PromiseOrValue, + _root: PromiseOrValue, + _nullifierHash: PromiseOrValue, + _recipient: PromiseOrValue, + _relayer: PromiseOrValue, + _fee: PromiseOrValue, + _refund: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; }; backupNotes( - _encryptedNotes: BytesLike[], - overrides?: Overrides & { from?: string | Promise }, + _encryptedNotes: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; deposit( - _tornado: string, - _commitment: BytesLike, - _encryptedNote: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise }, + _tornado: PromiseOrValue, + _commitment: PromiseOrValue, + _encryptedNote: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; withdraw( - _tornado: string, - _proof: BytesLike, - _root: BytesLike, - _nullifierHash: BytesLike, - _recipient: string, - _relayer: string, - _fee: BigNumberish, - _refund: BigNumberish, - overrides?: PayableOverrides & { from?: string | Promise }, + _tornado: PromiseOrValue, + _proof: PromiseOrValue, + _root: PromiseOrValue, + _nullifierHash: PromiseOrValue, + _recipient: PromiseOrValue, + _relayer: PromiseOrValue, + _fee: PromiseOrValue, + _refund: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; callStatic: { - backupNotes(_encryptedNotes: BytesLike[], overrides?: CallOverrides): Promise; + backupNotes(_encryptedNotes: PromiseOrValue[], overrides?: CallOverrides): Promise; - deposit(_tornado: string, _commitment: BytesLike, _encryptedNote: BytesLike, overrides?: CallOverrides): Promise; + deposit( + _tornado: PromiseOrValue, + _commitment: PromiseOrValue, + _encryptedNote: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; withdraw( - _tornado: string, - _proof: BytesLike, - _root: BytesLike, - _nullifierHash: BytesLike, - _recipient: string, - _relayer: string, - _fee: BigNumberish, - _refund: BigNumberish, + _tornado: PromiseOrValue, + _proof: PromiseOrValue, + _root: PromiseOrValue, + _nullifierHash: PromiseOrValue, + _recipient: PromiseOrValue, + _relayer: PromiseOrValue, + _fee: PromiseOrValue, + _refund: PromiseOrValue, overrides?: CallOverrides, ): Promise; }; filters: { - 'EncryptedNote(address,bytes)'(sender?: string | null, encryptedNote?: null): EncryptedNoteEventFilter; - EncryptedNote(sender?: string | null, encryptedNote?: null): EncryptedNoteEventFilter; + 'EncryptedNote(address,bytes)'(sender?: PromiseOrValue | null, encryptedNote?: null): EncryptedNoteEventFilter; + EncryptedNote(sender?: PromiseOrValue | null, encryptedNote?: null): EncryptedNoteEventFilter; }; estimateGas: { - backupNotes(_encryptedNotes: BytesLike[], overrides?: Overrides & { from?: string | Promise }): Promise; + backupNotes( + _encryptedNotes: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; deposit( - _tornado: string, - _commitment: BytesLike, - _encryptedNote: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise }, + _tornado: PromiseOrValue, + _commitment: PromiseOrValue, + _encryptedNote: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; withdraw( - _tornado: string, - _proof: BytesLike, - _root: BytesLike, - _nullifierHash: BytesLike, - _recipient: string, - _relayer: string, - _fee: BigNumberish, - _refund: BigNumberish, - overrides?: PayableOverrides & { from?: string | Promise }, + _tornado: PromiseOrValue, + _proof: PromiseOrValue, + _root: PromiseOrValue, + _nullifierHash: PromiseOrValue, + _recipient: PromiseOrValue, + _relayer: PromiseOrValue, + _fee: PromiseOrValue, + _refund: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; }; populateTransaction: { backupNotes( - _encryptedNotes: BytesLike[], - overrides?: Overrides & { from?: string | Promise }, + _encryptedNotes: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; deposit( - _tornado: string, - _commitment: BytesLike, - _encryptedNote: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise }, + _tornado: PromiseOrValue, + _commitment: PromiseOrValue, + _encryptedNote: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; withdraw( - _tornado: string, - _proof: BytesLike, - _root: BytesLike, - _nullifierHash: BytesLike, - _recipient: string, - _relayer: string, - _fee: BigNumberish, - _refund: BigNumberish, - overrides?: PayableOverrides & { from?: string | Promise }, + _tornado: PromiseOrValue, + _proof: PromiseOrValue, + _root: PromiseOrValue, + _nullifierHash: PromiseOrValue, + _recipient: PromiseOrValue, + _relayer: PromiseOrValue, + _fee: PromiseOrValue, + _refund: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; }; } diff --git a/src/contracts/TornadoABI.ts b/src/contracts/TornadoABI.ts index c8ad8b4..0f106a2 100644 --- a/src/contracts/TornadoABI.ts +++ b/src/contracts/TornadoABI.ts @@ -16,11 +16,9 @@ import type { } 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'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; export interface TornadoABIInterface extends utils.Interface { - contractName: 'TornadoABI'; - functions: { 'changeOperator(address)': FunctionFragment; 'nullifierHashes(bytes32)': FunctionFragment; @@ -72,30 +70,38 @@ export interface TornadoABIInterface extends utils.Interface { | 'nextIndex', ): FunctionFragment; - encodeFunctionData(functionFragment: 'changeOperator', values: [string]): string; - encodeFunctionData(functionFragment: 'nullifierHashes', values: [BytesLike]): string; + encodeFunctionData(functionFragment: 'changeOperator', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'nullifierHashes', values: [PromiseOrValue]): string; encodeFunctionData( functionFragment: 'withdraw', - values: [BytesLike, BytesLike, BytesLike, string, string, BigNumberish, BigNumberish], + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], ): string; encodeFunctionData(functionFragment: 'verifier', values?: undefined): string; - encodeFunctionData(functionFragment: 'hashLeftRight', values: [BytesLike, BytesLike]): string; + encodeFunctionData(functionFragment: 'hashLeftRight', values: [PromiseOrValue, PromiseOrValue]): string; encodeFunctionData(functionFragment: 'FIELD_SIZE', values?: undefined): string; encodeFunctionData(functionFragment: 'levels', values?: undefined): string; encodeFunctionData(functionFragment: 'operator', values?: undefined): string; - encodeFunctionData(functionFragment: 'isKnownRoot', values: [BytesLike]): string; - encodeFunctionData(functionFragment: 'commitments', values: [BytesLike]): string; + encodeFunctionData(functionFragment: 'isKnownRoot', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'commitments', values: [PromiseOrValue]): string; encodeFunctionData(functionFragment: 'denomination', values?: undefined): string; encodeFunctionData(functionFragment: 'currentRootIndex', values?: undefined): string; - encodeFunctionData(functionFragment: 'updateVerifier', values: [string]): string; - encodeFunctionData(functionFragment: 'deposit', values: [BytesLike]): string; + encodeFunctionData(functionFragment: 'updateVerifier', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'deposit', values: [PromiseOrValue]): string; encodeFunctionData(functionFragment: 'getLastRoot', values?: undefined): string; - encodeFunctionData(functionFragment: 'roots', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'roots', values: [PromiseOrValue]): string; encodeFunctionData(functionFragment: 'ROOT_HISTORY_SIZE', values?: undefined): string; - encodeFunctionData(functionFragment: 'isSpent', values: [BytesLike]): string; - encodeFunctionData(functionFragment: 'zeros', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'isSpent', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'zeros', values: [PromiseOrValue]): string; encodeFunctionData(functionFragment: 'ZERO_VALUE', values?: undefined): string; - encodeFunctionData(functionFragment: 'filledSubtrees', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'filledSubtrees', values: [PromiseOrValue]): string; encodeFunctionData(functionFragment: 'nextIndex', values?: undefined): string; decodeFunctionResult(functionFragment: 'changeOperator', data: BytesLike): Result; @@ -150,8 +156,6 @@ export type WithdrawalEvent = TypedEvent<[string, string, string, BigNumber], Wi export type WithdrawalEventFilter = TypedEventFilter; export interface TornadoABI extends BaseContract { - contractName: 'TornadoABI'; - connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; deployed(): Promise; @@ -175,26 +179,30 @@ export interface TornadoABI extends BaseContract { functions: { changeOperator( - _newOperator: string, - overrides?: Overrides & { from?: string | Promise }, + _newOperator: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - nullifierHashes(arg0: BytesLike, overrides?: CallOverrides): Promise<[boolean]>; + nullifierHashes(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; withdraw( - _proof: BytesLike, - _root: BytesLike, - _nullifierHash: BytesLike, - _recipient: string, - _relayer: string, - _fee: BigNumberish, - _refund: BigNumberish, - overrides?: PayableOverrides & { from?: string | Promise }, + _proof: PromiseOrValue, + _root: PromiseOrValue, + _nullifierHash: PromiseOrValue, + _recipient: PromiseOrValue, + _relayer: PromiseOrValue, + _fee: PromiseOrValue, + _refund: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; verifier(overrides?: CallOverrides): Promise<[string]>; - hashLeftRight(_left: BytesLike, _right: BytesLike, overrides?: CallOverrides): Promise<[string]>; + hashLeftRight( + _left: PromiseOrValue, + _right: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]>; FIELD_SIZE(overrides?: CallOverrides): Promise<[BigNumber]>; @@ -202,59 +210,62 @@ export interface TornadoABI extends BaseContract { operator(overrides?: CallOverrides): Promise<[string]>; - isKnownRoot(_root: BytesLike, overrides?: CallOverrides): Promise<[boolean]>; + isKnownRoot(_root: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; - commitments(arg0: BytesLike, overrides?: CallOverrides): Promise<[boolean]>; + commitments(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; denomination(overrides?: CallOverrides): Promise<[BigNumber]>; currentRootIndex(overrides?: CallOverrides): Promise<[number]>; updateVerifier( - _newVerifier: string, - overrides?: Overrides & { from?: string | Promise }, + _newVerifier: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; deposit( - _commitment: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise }, + _commitment: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; getLastRoot(overrides?: CallOverrides): Promise<[string]>; - roots(arg0: BigNumberish, overrides?: CallOverrides): Promise<[string]>; + roots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<[number]>; - isSpent(_nullifierHash: BytesLike, overrides?: CallOverrides): Promise<[boolean]>; + isSpent(_nullifierHash: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; - zeros(arg0: BigNumberish, overrides?: CallOverrides): Promise<[string]>; + zeros(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; ZERO_VALUE(overrides?: CallOverrides): Promise<[BigNumber]>; - filledSubtrees(arg0: BigNumberish, overrides?: CallOverrides): Promise<[string]>; + filledSubtrees(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; nextIndex(overrides?: CallOverrides): Promise<[number]>; }; - changeOperator(_newOperator: string, overrides?: Overrides & { from?: string | Promise }): Promise; + changeOperator( + _newOperator: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; - nullifierHashes(arg0: BytesLike, overrides?: CallOverrides): Promise; + nullifierHashes(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; withdraw( - _proof: BytesLike, - _root: BytesLike, - _nullifierHash: BytesLike, - _recipient: string, - _relayer: string, - _fee: BigNumberish, - _refund: BigNumberish, - overrides?: PayableOverrides & { from?: string | Promise }, + _proof: PromiseOrValue, + _root: PromiseOrValue, + _nullifierHash: PromiseOrValue, + _recipient: PromiseOrValue, + _relayer: PromiseOrValue, + _fee: PromiseOrValue, + _refund: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; verifier(overrides?: CallOverrides): Promise; - hashLeftRight(_left: BytesLike, _right: BytesLike, overrides?: CallOverrides): Promise; + hashLeftRight(_left: PromiseOrValue, _right: PromiseOrValue, overrides?: CallOverrides): Promise; FIELD_SIZE(overrides?: CallOverrides): Promise; @@ -262,56 +273,63 @@ export interface TornadoABI extends BaseContract { operator(overrides?: CallOverrides): Promise; - isKnownRoot(_root: BytesLike, overrides?: CallOverrides): Promise; + isKnownRoot(_root: PromiseOrValue, overrides?: CallOverrides): Promise; - commitments(arg0: BytesLike, overrides?: CallOverrides): Promise; + commitments(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; denomination(overrides?: CallOverrides): Promise; currentRootIndex(overrides?: CallOverrides): Promise; - updateVerifier(_newVerifier: string, overrides?: Overrides & { from?: string | Promise }): Promise; + updateVerifier( + _newVerifier: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; deposit( - _commitment: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise }, + _commitment: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; getLastRoot(overrides?: CallOverrides): Promise; - roots(arg0: BigNumberish, overrides?: CallOverrides): Promise; + roots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise; - isSpent(_nullifierHash: BytesLike, overrides?: CallOverrides): Promise; + isSpent(_nullifierHash: PromiseOrValue, overrides?: CallOverrides): Promise; - zeros(arg0: BigNumberish, overrides?: CallOverrides): Promise; + zeros(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; ZERO_VALUE(overrides?: CallOverrides): Promise; - filledSubtrees(arg0: BigNumberish, overrides?: CallOverrides): Promise; + filledSubtrees(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; nextIndex(overrides?: CallOverrides): Promise; callStatic: { - changeOperator(_newOperator: string, overrides?: CallOverrides): Promise; + changeOperator(_newOperator: PromiseOrValue, overrides?: CallOverrides): Promise; - nullifierHashes(arg0: BytesLike, overrides?: CallOverrides): Promise; + nullifierHashes(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; withdraw( - _proof: BytesLike, - _root: BytesLike, - _nullifierHash: BytesLike, - _recipient: string, - _relayer: string, - _fee: BigNumberish, - _refund: BigNumberish, + _proof: PromiseOrValue, + _root: PromiseOrValue, + _nullifierHash: PromiseOrValue, + _recipient: PromiseOrValue, + _relayer: PromiseOrValue, + _fee: PromiseOrValue, + _refund: PromiseOrValue, overrides?: CallOverrides, ): Promise; verifier(overrides?: CallOverrides): Promise; - hashLeftRight(_left: BytesLike, _right: BytesLike, overrides?: CallOverrides): Promise; + hashLeftRight( + _left: PromiseOrValue, + _right: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; FIELD_SIZE(overrides?: CallOverrides): Promise; @@ -319,67 +337,78 @@ export interface TornadoABI extends BaseContract { operator(overrides?: CallOverrides): Promise; - isKnownRoot(_root: BytesLike, overrides?: CallOverrides): Promise; + isKnownRoot(_root: PromiseOrValue, overrides?: CallOverrides): Promise; - commitments(arg0: BytesLike, overrides?: CallOverrides): Promise; + commitments(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; denomination(overrides?: CallOverrides): Promise; currentRootIndex(overrides?: CallOverrides): Promise; - updateVerifier(_newVerifier: string, overrides?: CallOverrides): Promise; + updateVerifier(_newVerifier: PromiseOrValue, overrides?: CallOverrides): Promise; - deposit(_commitment: BytesLike, overrides?: CallOverrides): Promise; + deposit(_commitment: PromiseOrValue, overrides?: CallOverrides): Promise; getLastRoot(overrides?: CallOverrides): Promise; - roots(arg0: BigNumberish, overrides?: CallOverrides): Promise; + roots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise; - isSpent(_nullifierHash: BytesLike, overrides?: CallOverrides): Promise; + isSpent(_nullifierHash: PromiseOrValue, overrides?: CallOverrides): Promise; - zeros(arg0: BigNumberish, overrides?: CallOverrides): Promise; + zeros(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; ZERO_VALUE(overrides?: CallOverrides): Promise; - filledSubtrees(arg0: BigNumberish, overrides?: CallOverrides): Promise; + filledSubtrees(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; nextIndex(overrides?: CallOverrides): Promise; }; filters: { - 'Deposit(bytes32,uint32,uint256)'(commitment?: BytesLike | null, leafIndex?: null, timestamp?: null): DepositEventFilter; - Deposit(commitment?: BytesLike | null, leafIndex?: null, timestamp?: null): DepositEventFilter; + 'Deposit(bytes32,uint32,uint256)'( + commitment?: PromiseOrValue | null, + leafIndex?: null, + timestamp?: null, + ): DepositEventFilter; + Deposit(commitment?: PromiseOrValue | null, leafIndex?: null, timestamp?: null): DepositEventFilter; 'Withdrawal(address,bytes32,address,uint256)'( to?: null, nullifierHash?: null, - relayer?: string | null, + relayer?: PromiseOrValue | null, fee?: null, ): WithdrawalEventFilter; - Withdrawal(to?: null, nullifierHash?: null, relayer?: string | null, fee?: null): WithdrawalEventFilter; + Withdrawal(to?: null, nullifierHash?: null, relayer?: PromiseOrValue | null, fee?: null): WithdrawalEventFilter; }; estimateGas: { - changeOperator(_newOperator: string, overrides?: Overrides & { from?: string | Promise }): Promise; + changeOperator( + _newOperator: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; - nullifierHashes(arg0: BytesLike, overrides?: CallOverrides): Promise; + nullifierHashes(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; withdraw( - _proof: BytesLike, - _root: BytesLike, - _nullifierHash: BytesLike, - _recipient: string, - _relayer: string, - _fee: BigNumberish, - _refund: BigNumberish, - overrides?: PayableOverrides & { from?: string | Promise }, + _proof: PromiseOrValue, + _root: PromiseOrValue, + _nullifierHash: PromiseOrValue, + _recipient: PromiseOrValue, + _relayer: PromiseOrValue, + _fee: PromiseOrValue, + _refund: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; verifier(overrides?: CallOverrides): Promise; - hashLeftRight(_left: BytesLike, _right: BytesLike, overrides?: CallOverrides): Promise; + hashLeftRight( + _left: PromiseOrValue, + _right: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; FIELD_SIZE(overrides?: CallOverrides): Promise; @@ -387,57 +416,67 @@ export interface TornadoABI extends BaseContract { operator(overrides?: CallOverrides): Promise; - isKnownRoot(_root: BytesLike, overrides?: CallOverrides): Promise; + isKnownRoot(_root: PromiseOrValue, overrides?: CallOverrides): Promise; - commitments(arg0: BytesLike, overrides?: CallOverrides): Promise; + commitments(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; denomination(overrides?: CallOverrides): Promise; currentRootIndex(overrides?: CallOverrides): Promise; - updateVerifier(_newVerifier: string, overrides?: Overrides & { from?: string | Promise }): Promise; + updateVerifier( + _newVerifier: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; - deposit(_commitment: BytesLike, overrides?: PayableOverrides & { from?: string | Promise }): Promise; + deposit( + _commitment: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise; getLastRoot(overrides?: CallOverrides): Promise; - roots(arg0: BigNumberish, overrides?: CallOverrides): Promise; + roots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise; - isSpent(_nullifierHash: BytesLike, overrides?: CallOverrides): Promise; + isSpent(_nullifierHash: PromiseOrValue, overrides?: CallOverrides): Promise; - zeros(arg0: BigNumberish, overrides?: CallOverrides): Promise; + zeros(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; ZERO_VALUE(overrides?: CallOverrides): Promise; - filledSubtrees(arg0: BigNumberish, overrides?: CallOverrides): Promise; + filledSubtrees(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; nextIndex(overrides?: CallOverrides): Promise; }; populateTransaction: { changeOperator( - _newOperator: string, - overrides?: Overrides & { from?: string | Promise }, + _newOperator: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; - nullifierHashes(arg0: BytesLike, overrides?: CallOverrides): Promise; + nullifierHashes(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; withdraw( - _proof: BytesLike, - _root: BytesLike, - _nullifierHash: BytesLike, - _recipient: string, - _relayer: string, - _fee: BigNumberish, - _refund: BigNumberish, - overrides?: PayableOverrides & { from?: string | Promise }, + _proof: PromiseOrValue, + _root: PromiseOrValue, + _nullifierHash: PromiseOrValue, + _recipient: PromiseOrValue, + _relayer: PromiseOrValue, + _fee: PromiseOrValue, + _refund: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; verifier(overrides?: CallOverrides): Promise; - hashLeftRight(_left: BytesLike, _right: BytesLike, overrides?: CallOverrides): Promise; + hashLeftRight( + _left: PromiseOrValue, + _right: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; FIELD_SIZE(overrides?: CallOverrides): Promise; @@ -445,37 +484,37 @@ export interface TornadoABI extends BaseContract { operator(overrides?: CallOverrides): Promise; - isKnownRoot(_root: BytesLike, overrides?: CallOverrides): Promise; + isKnownRoot(_root: PromiseOrValue, overrides?: CallOverrides): Promise; - commitments(arg0: BytesLike, overrides?: CallOverrides): Promise; + commitments(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; denomination(overrides?: CallOverrides): Promise; currentRootIndex(overrides?: CallOverrides): Promise; updateVerifier( - _newVerifier: string, - overrides?: Overrides & { from?: string | Promise }, + _newVerifier: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; deposit( - _commitment: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise }, + _commitment: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; getLastRoot(overrides?: CallOverrides): Promise; - roots(arg0: BigNumberish, overrides?: CallOverrides): Promise; + roots(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise; - isSpent(_nullifierHash: BytesLike, overrides?: CallOverrides): Promise; + isSpent(_nullifierHash: PromiseOrValue, overrides?: CallOverrides): Promise; - zeros(arg0: BigNumberish, overrides?: CallOverrides): Promise; + zeros(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; ZERO_VALUE(overrides?: CallOverrides): Promise; - filledSubtrees(arg0: BigNumberish, overrides?: CallOverrides): Promise; + filledSubtrees(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; nextIndex(overrides?: CallOverrides): Promise; }; diff --git a/src/contracts/TornadoProxyABI.ts b/src/contracts/TornadoProxyABI.ts index 2275303..391e744 100644 --- a/src/contracts/TornadoProxyABI.ts +++ b/src/contracts/TornadoProxyABI.ts @@ -16,11 +16,9 @@ import type { } from 'ethers'; import type { FunctionFragment, Result } from '@ethersproject/abi'; import type { Listener, Provider } from '@ethersproject/providers'; -import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; export interface TornadoProxyABIInterface extends utils.Interface { - contractName: 'TornadoProxyABI'; - functions: { 'governance()': FunctionFragment; 'instances(address)': FunctionFragment; @@ -36,14 +34,23 @@ export interface TornadoProxyABIInterface extends utils.Interface { ): FunctionFragment; encodeFunctionData(functionFragment: 'governance', values?: undefined): string; - encodeFunctionData(functionFragment: 'instances', values: [string]): string; - encodeFunctionData(functionFragment: 'resolve', values: [BytesLike]): string; + encodeFunctionData(functionFragment: 'instances', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'resolve', values: [PromiseOrValue]): string; encodeFunctionData(functionFragment: 'tornadoTrees', values?: undefined): string; - encodeFunctionData(functionFragment: 'deposit', values: [string, BytesLike]): string; - encodeFunctionData(functionFragment: 'updateInstances', values: [string, boolean]): string; + encodeFunctionData(functionFragment: 'deposit', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'updateInstances', values: [PromiseOrValue, PromiseOrValue]): string; encodeFunctionData( functionFragment: 'withdraw', - values: [string, BytesLike, BytesLike, BytesLike, string, string, BigNumberish, BigNumberish], + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], ): string; decodeFunctionResult(functionFragment: 'governance', data: BytesLike): Result; @@ -58,8 +65,6 @@ export interface TornadoProxyABIInterface extends utils.Interface { } export interface TornadoProxyABI extends BaseContract { - contractName: 'TornadoProxyABI'; - connect(signerOrProvider: Signer | Provider | string): this; attach(addressOrName: string): this; deployed(): Promise; @@ -84,91 +89,91 @@ export interface TornadoProxyABI extends BaseContract { functions: { governance(overrides?: CallOverrides): Promise<[string]>; - instances(arg0: string, overrides?: CallOverrides): Promise<[boolean]>; + instances(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; - resolve(node: BytesLike, overrides?: CallOverrides): Promise<[string]>; + resolve(node: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; tornadoTrees(overrides?: CallOverrides): Promise<[string]>; deposit( - tornado: string, - commitment: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise }, + tornado: PromiseOrValue, + commitment: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; updateInstances( - instance: string, - update: boolean, - overrides?: Overrides & { from?: string | Promise }, + instance: PromiseOrValue, + update: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; withdraw( - tornado: string, - proof: BytesLike, - root: BytesLike, - nullifierHash: BytesLike, - recipient: string, - relayer: string, - fee: BigNumberish, - refund: BigNumberish, - overrides?: PayableOverrides & { from?: string | Promise }, + tornado: PromiseOrValue, + proof: PromiseOrValue, + root: PromiseOrValue, + nullifierHash: PromiseOrValue, + recipient: PromiseOrValue, + relayer: PromiseOrValue, + fee: PromiseOrValue, + refund: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; }; governance(overrides?: CallOverrides): Promise; - instances(arg0: string, overrides?: CallOverrides): Promise; + instances(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - resolve(node: BytesLike, overrides?: CallOverrides): Promise; + resolve(node: PromiseOrValue, overrides?: CallOverrides): Promise; tornadoTrees(overrides?: CallOverrides): Promise; deposit( - tornado: string, - commitment: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise }, + tornado: PromiseOrValue, + commitment: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; updateInstances( - instance: string, - update: boolean, - overrides?: Overrides & { from?: string | Promise }, + instance: PromiseOrValue, + update: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; withdraw( - tornado: string, - proof: BytesLike, - root: BytesLike, - nullifierHash: BytesLike, - recipient: string, - relayer: string, - fee: BigNumberish, - refund: BigNumberish, - overrides?: PayableOverrides & { from?: string | Promise }, + tornado: PromiseOrValue, + proof: PromiseOrValue, + root: PromiseOrValue, + nullifierHash: PromiseOrValue, + recipient: PromiseOrValue, + relayer: PromiseOrValue, + fee: PromiseOrValue, + refund: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; callStatic: { governance(overrides?: CallOverrides): Promise; - instances(arg0: string, overrides?: CallOverrides): Promise; + instances(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - resolve(node: BytesLike, overrides?: CallOverrides): Promise; + resolve(node: PromiseOrValue, overrides?: CallOverrides): Promise; tornadoTrees(overrides?: CallOverrides): Promise; - deposit(tornado: string, commitment: BytesLike, overrides?: CallOverrides): Promise; + deposit(tornado: PromiseOrValue, commitment: PromiseOrValue, overrides?: CallOverrides): Promise; - updateInstances(instance: string, update: boolean, overrides?: CallOverrides): Promise; + updateInstances(instance: PromiseOrValue, update: PromiseOrValue, overrides?: CallOverrides): Promise; withdraw( - tornado: string, - proof: BytesLike, - root: BytesLike, - nullifierHash: BytesLike, - recipient: string, - relayer: string, - fee: BigNumberish, - refund: BigNumberish, + tornado: PromiseOrValue, + proof: PromiseOrValue, + root: PromiseOrValue, + nullifierHash: PromiseOrValue, + recipient: PromiseOrValue, + relayer: PromiseOrValue, + fee: PromiseOrValue, + refund: PromiseOrValue, overrides?: CallOverrides, ): Promise; }; @@ -178,68 +183,68 @@ export interface TornadoProxyABI extends BaseContract { estimateGas: { governance(overrides?: CallOverrides): Promise; - instances(arg0: string, overrides?: CallOverrides): Promise; + instances(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - resolve(node: BytesLike, overrides?: CallOverrides): Promise; + resolve(node: PromiseOrValue, overrides?: CallOverrides): Promise; tornadoTrees(overrides?: CallOverrides): Promise; deposit( - tornado: string, - commitment: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise }, + tornado: PromiseOrValue, + commitment: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; updateInstances( - instance: string, - update: boolean, - overrides?: Overrides & { from?: string | Promise }, + instance: PromiseOrValue, + update: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; withdraw( - tornado: string, - proof: BytesLike, - root: BytesLike, - nullifierHash: BytesLike, - recipient: string, - relayer: string, - fee: BigNumberish, - refund: BigNumberish, - overrides?: PayableOverrides & { from?: string | Promise }, + tornado: PromiseOrValue, + proof: PromiseOrValue, + root: PromiseOrValue, + nullifierHash: PromiseOrValue, + recipient: PromiseOrValue, + relayer: PromiseOrValue, + fee: PromiseOrValue, + refund: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; }; populateTransaction: { governance(overrides?: CallOverrides): Promise; - instances(arg0: string, overrides?: CallOverrides): Promise; + instances(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; - resolve(node: BytesLike, overrides?: CallOverrides): Promise; + resolve(node: PromiseOrValue, overrides?: CallOverrides): Promise; tornadoTrees(overrides?: CallOverrides): Promise; deposit( - tornado: string, - commitment: BytesLike, - overrides?: PayableOverrides & { from?: string | Promise }, + tornado: PromiseOrValue, + commitment: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; updateInstances( - instance: string, - update: boolean, - overrides?: Overrides & { from?: string | Promise }, + instance: PromiseOrValue, + update: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, ): Promise; withdraw( - tornado: string, - proof: BytesLike, - root: BytesLike, - nullifierHash: BytesLike, - recipient: string, - relayer: string, - fee: BigNumberish, - refund: BigNumberish, - overrides?: PayableOverrides & { from?: string | Promise }, + tornado: PromiseOrValue, + proof: PromiseOrValue, + root: PromiseOrValue, + nullifierHash: PromiseOrValue, + recipient: PromiseOrValue, + relayer: PromiseOrValue, + fee: PromiseOrValue, + refund: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, ): Promise; }; } diff --git a/src/contracts/common.ts b/src/contracts/common.ts index 6cfb104..35f31be 100644 --- a/src/contracts/common.ts +++ b/src/contracts/common.ts @@ -28,3 +28,5 @@ export type MinEthersFactory = { export type GetContractTypeFromFactory = F extends MinEthersFactory ? C : never; export type GetARGsTypeFromFactory = F extends MinEthersFactory ? Parameters : never; + +export type PromiseOrValue = T | Promise; diff --git a/src/contracts/factories/OvmGasPriceOracleABI__factory.ts b/src/contracts/factories/OvmGasPriceOracleABI__factory.ts new file mode 100644 index 0000000..183a7e6 --- /dev/null +++ b/src/contracts/factories/OvmGasPriceOracleABI__factory.ts @@ -0,0 +1,316 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { OvmGasPriceOracleABI, OvmGasPriceOracleABIInterface } from '../OvmGasPriceOracleABI'; + +const _abi = [ + { + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'DecimalsUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'GasPriceUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'L1BaseFeeUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'OverheadUpdated', + 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: false, + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'ScalarUpdated', + type: 'event', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'gasPrice', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'getL1Fee', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'getL1GasUsed', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'l1BaseFee', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'overhead', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + 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: [], + name: 'scalar', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_decimals', + type: 'uint256', + }, + ], + name: 'setDecimals', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_gasPrice', + type: 'uint256', + }, + ], + name: 'setGasPrice', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_baseFee', + type: 'uint256', + }, + ], + name: 'setL1BaseFee', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_overhead', + type: 'uint256', + }, + ], + name: 'setOverhead', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_scalar', + type: 'uint256', + }, + ], + name: 'setScalar', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class OvmGasPriceOracleABI__factory { + static readonly abi = _abi; + static createInterface(): OvmGasPriceOracleABIInterface { + return new utils.Interface(_abi) as OvmGasPriceOracleABIInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): OvmGasPriceOracleABI { + return new Contract(address, _abi, signerOrProvider) as OvmGasPriceOracleABI; + } +} diff --git a/src/contracts/factories/index.ts b/src/contracts/factories/index.ts index a39e276..cce8806 100644 --- a/src/contracts/factories/index.ts +++ b/src/contracts/factories/index.ts @@ -5,6 +5,7 @@ export { AggregatorAbi__factory } from './AggregatorAbi__factory'; export { ERC20Abi__factory } from './ERC20Abi__factory'; export { MulticallAbi__factory } from './MulticallAbi__factory'; export { OffchainOracleAbi__factory } from './OffchainOracleAbi__factory'; +export { OvmGasPriceOracleABI__factory } from './OvmGasPriceOracleABI__factory'; export { ProxyLightABI__factory } from './ProxyLightABI__factory'; export { TornadoABI__factory } from './TornadoABI__factory'; export { TornadoProxyABI__factory } from './TornadoProxyABI__factory'; diff --git a/src/contracts/index.ts b/src/contracts/index.ts index d84fa77..518ebed 100644 --- a/src/contracts/index.ts +++ b/src/contracts/index.ts @@ -5,6 +5,7 @@ export type { AggregatorAbi } from './AggregatorAbi'; export type { ERC20Abi } from './ERC20Abi'; export type { MulticallAbi } from './MulticallAbi'; export type { OffchainOracleAbi } from './OffchainOracleAbi'; +export type { OvmGasPriceOracleABI } from './OvmGasPriceOracleABI'; export type { ProxyLightABI } from './ProxyLightABI'; export type { TornadoABI } from './TornadoABI'; export type { TornadoProxyABI } from './TornadoProxyABI'; @@ -13,6 +14,7 @@ export { AggregatorAbi__factory } from './factories/AggregatorAbi__factory'; export { ERC20Abi__factory } from './factories/ERC20Abi__factory'; export { MulticallAbi__factory } from './factories/MulticallAbi__factory'; export { OffchainOracleAbi__factory } from './factories/OffchainOracleAbi__factory'; +export { OvmGasPriceOracleABI__factory } from './factories/OvmGasPriceOracleABI__factory'; export { ProxyLightABI__factory } from './factories/ProxyLightABI__factory'; export { TornadoABI__factory } from './factories/TornadoABI__factory'; export { TornadoProxyABI__factory } from './factories/TornadoProxyABI__factory'; diff --git a/src/modules/contracts.ts b/src/modules/contracts.ts index 824461c..e4d3225 100644 --- a/src/modules/contracts.ts +++ b/src/modules/contracts.ts @@ -2,11 +2,20 @@ import { ERC20Abi__factory, MulticallAbi__factory, OffchainOracleAbi__factory, + OvmGasPriceOracleABI__factory, ProxyLightABI__factory, TornadoProxyABI__factory, } from '../contracts'; import { providers } from 'ethers'; -import { mainnetRpcUrl, multiCallAddress, netId, offchainOracleAddress, oracleRpcUrl, rpcUrl } from '../config'; +import { + mainnetRpcUrl, + multiCallAddress, + netId, + offchainOracleAddress, + oracleRpcUrl, + ovmGasPriceOracleContract, + rpcUrl, +} from '../config'; export function getProvider(isStatic = true, customRpcUrl?: string, chainId = netId) { const url = customRpcUrl || rpcUrl; @@ -32,3 +41,6 @@ export const getMultiCallContract = () => { export const getTornTokenContract = (tokenAddress: string) => { return ERC20Abi__factory.connect(tokenAddress, getProvider(true, mainnetRpcUrl)); }; +export const getOvmGasPriceOracle = () => { + return OvmGasPriceOracleABI__factory.connect(ovmGasPriceOracleContract, getProvider()); +};