WIP commit => work on adding registry stuff to SDK

Signed-off-by: AlienTornadosaurusHex <>
This commit is contained in:
AlienTornadosaurusHex 2023-05-30 20:48:18 +00:00
parent 28f4fffb53
commit 32595cb9a2
80 changed files with 24090 additions and 191 deletions

View File

@ -1,6 +1,6 @@
ISC License
Copyright 2023 T-Hax
Copyright 2023 AlienTornadosaurusHex
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

View File

@ -1,11 +1,11 @@
{
"name": "@tornado/sdk-chain",
"author": "T-Hax",
"author": "AlienTornadosaurusHex",
"license": "ISC",
"description": "Tornado SDK blockchain-ethers utilities.",
"repository": {
"type": "git",
"url": "https://development.tornadocash.community/T-Hax/sdk-monorepo"
"url": "https://development.tornadocash.community/AlienTornadosaurusHex/sdk-monorepo"
},
"homepage": "https://tornadocash.community",
"keywords": [

View File

@ -0,0 +1,875 @@
/* 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 RelayerRegistryInterface extends utils.Interface {
functions: {
'bulkResolve(bytes32[])': FunctionFragment
'burn(address,address,address)': FunctionFragment
'ens()': FunctionFragment
'feeManager()': FunctionFragment
'getRelayerBalance(address)': FunctionFragment
'getRelayerEnsHash(address)': FunctionFragment
'governance()': FunctionFragment
'initialize(bytes32)': FunctionFragment
'isRelayer(address)': FunctionFragment
'isRelayerRegistered(address,address)': FunctionFragment
'minStakeAmount()': FunctionFragment
'nullifyBalance(address)': FunctionFragment
'register(string,uint256,address[])': FunctionFragment
'registerPermit(string,uint256,address[],address,uint256,uint8,bytes32,bytes32)': FunctionFragment
'registerWorker(address,address)': FunctionFragment
'relayers(address)': FunctionFragment
'resolve(bytes32)': FunctionFragment
'setMinStakeAmount(uint256)': FunctionFragment
'setTornadoRouter(address)': FunctionFragment
'stakeToRelayer(address,uint256)': FunctionFragment
'stakeToRelayerPermit(address,uint256,address,uint256,uint8,bytes32,bytes32)': FunctionFragment
'staking()': FunctionFragment
'torn()': FunctionFragment
'tornadoRouter()': FunctionFragment
'unregisterWorker(address)': FunctionFragment
'workers(address)': FunctionFragment
}
getFunction(
nameOrSignatureOrTopic:
| 'bulkResolve'
| 'burn'
| 'ens'
| 'feeManager'
| 'getRelayerBalance'
| 'getRelayerEnsHash'
| 'governance'
| 'initialize'
| 'isRelayer'
| 'isRelayerRegistered'
| 'minStakeAmount'
| 'nullifyBalance'
| 'register'
| 'registerPermit'
| 'registerWorker'
| 'relayers'
| 'resolve'
| 'setMinStakeAmount'
| 'setTornadoRouter'
| 'stakeToRelayer'
| 'stakeToRelayerPermit'
| 'staking'
| 'torn'
| 'tornadoRouter'
| 'unregisterWorker'
| 'workers'
): FunctionFragment
encodeFunctionData(functionFragment: 'bulkResolve', values: [PromiseOrValue<BytesLike>[]]): string
encodeFunctionData(
functionFragment: 'burn',
values: [PromiseOrValue<string>, PromiseOrValue<string>, PromiseOrValue<string>]
): string
encodeFunctionData(functionFragment: 'ens', values?: undefined): string
encodeFunctionData(functionFragment: 'feeManager', values?: undefined): string
encodeFunctionData(functionFragment: 'getRelayerBalance', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'getRelayerEnsHash', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'governance', values?: undefined): string
encodeFunctionData(functionFragment: 'initialize', values: [PromiseOrValue<BytesLike>]): string
encodeFunctionData(functionFragment: 'isRelayer', values: [PromiseOrValue<string>]): string
encodeFunctionData(
functionFragment: 'isRelayerRegistered',
values: [PromiseOrValue<string>, PromiseOrValue<string>]
): string
encodeFunctionData(functionFragment: 'minStakeAmount', values?: undefined): string
encodeFunctionData(functionFragment: 'nullifyBalance', values: [PromiseOrValue<string>]): string
encodeFunctionData(
functionFragment: 'register',
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>, PromiseOrValue<string>[]]
): string
encodeFunctionData(
functionFragment: 'registerPermit',
values: [
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<string>[],
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>
]
): string
encodeFunctionData(
functionFragment: 'registerWorker',
values: [PromiseOrValue<string>, PromiseOrValue<string>]
): string
encodeFunctionData(functionFragment: 'relayers', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'resolve', values: [PromiseOrValue<BytesLike>]): string
encodeFunctionData(functionFragment: 'setMinStakeAmount', values: [PromiseOrValue<BigNumberish>]): string
encodeFunctionData(functionFragment: 'setTornadoRouter', values: [PromiseOrValue<string>]): string
encodeFunctionData(
functionFragment: 'stakeToRelayer',
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string
encodeFunctionData(
functionFragment: 'stakeToRelayerPermit',
values: [
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>
]
): string
encodeFunctionData(functionFragment: 'staking', values?: undefined): string
encodeFunctionData(functionFragment: 'torn', values?: undefined): string
encodeFunctionData(functionFragment: 'tornadoRouter', values?: undefined): string
encodeFunctionData(functionFragment: 'unregisterWorker', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'workers', values: [PromiseOrValue<string>]): string
decodeFunctionResult(functionFragment: 'bulkResolve', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'feeManager', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'getRelayerBalance', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'getRelayerEnsHash', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'governance', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'initialize', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'isRelayer', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'isRelayerRegistered', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'minStakeAmount', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'nullifyBalance', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'register', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'registerPermit', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'registerWorker', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'relayers', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'resolve', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'setMinStakeAmount', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'setTornadoRouter', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'stakeToRelayer', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'stakeToRelayerPermit', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'staking', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'torn', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'tornadoRouter', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'unregisterWorker', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'workers', data: BytesLike): Result
events: {
'MinimumStakeAmount(uint256)': EventFragment
'RelayerBalanceNullified(address)': EventFragment
'RelayerRegistered(bytes32,string,address,uint256)': EventFragment
'RouterRegistered(address)': EventFragment
'StakeAddedToRelayer(address,uint256)': EventFragment
'StakeBurned(address,uint256)': EventFragment
'WorkerRegistered(address,address)': EventFragment
'WorkerUnregistered(address,address)': EventFragment
}
getEvent(nameOrSignatureOrTopic: 'MinimumStakeAmount'): EventFragment
getEvent(nameOrSignatureOrTopic: 'RelayerBalanceNullified'): EventFragment
getEvent(nameOrSignatureOrTopic: 'RelayerRegistered'): EventFragment
getEvent(nameOrSignatureOrTopic: 'RouterRegistered'): EventFragment
getEvent(nameOrSignatureOrTopic: 'StakeAddedToRelayer'): EventFragment
getEvent(nameOrSignatureOrTopic: 'StakeBurned'): EventFragment
getEvent(nameOrSignatureOrTopic: 'WorkerRegistered'): EventFragment
getEvent(nameOrSignatureOrTopic: 'WorkerUnregistered'): EventFragment
}
export interface MinimumStakeAmountEventObject {
minStakeAmount: BigNumber
}
export type MinimumStakeAmountEvent = TypedEvent<[BigNumber], MinimumStakeAmountEventObject>
export type MinimumStakeAmountEventFilter = TypedEventFilter<MinimumStakeAmountEvent>
export interface RelayerBalanceNullifiedEventObject {
relayer: string
}
export type RelayerBalanceNullifiedEvent = TypedEvent<[string], RelayerBalanceNullifiedEventObject>
export type RelayerBalanceNullifiedEventFilter = TypedEventFilter<RelayerBalanceNullifiedEvent>
export interface RelayerRegisteredEventObject {
relayer: string
ensName: string
relayerAddress: string
stakedAmount: BigNumber
}
export type RelayerRegisteredEvent = TypedEvent<
[string, string, string, BigNumber],
RelayerRegisteredEventObject
>
export type RelayerRegisteredEventFilter = TypedEventFilter<RelayerRegisteredEvent>
export interface RouterRegisteredEventObject {
tornadoRouter: string
}
export type RouterRegisteredEvent = TypedEvent<[string], RouterRegisteredEventObject>
export type RouterRegisteredEventFilter = TypedEventFilter<RouterRegisteredEvent>
export interface StakeAddedToRelayerEventObject {
relayer: string
amountStakeAdded: BigNumber
}
export type StakeAddedToRelayerEvent = TypedEvent<[string, BigNumber], StakeAddedToRelayerEventObject>
export type StakeAddedToRelayerEventFilter = TypedEventFilter<StakeAddedToRelayerEvent>
export interface StakeBurnedEventObject {
relayer: string
amountBurned: BigNumber
}
export type StakeBurnedEvent = TypedEvent<[string, BigNumber], StakeBurnedEventObject>
export type StakeBurnedEventFilter = TypedEventFilter<StakeBurnedEvent>
export interface WorkerRegisteredEventObject {
relayer: string
worker: string
}
export type WorkerRegisteredEvent = TypedEvent<[string, string], WorkerRegisteredEventObject>
export type WorkerRegisteredEventFilter = TypedEventFilter<WorkerRegisteredEvent>
export interface WorkerUnregisteredEventObject {
relayer: string
worker: string
}
export type WorkerUnregisteredEvent = TypedEvent<[string, string], WorkerUnregisteredEventObject>
export type WorkerUnregisteredEventFilter = TypedEventFilter<WorkerUnregisteredEvent>
export interface RelayerRegistry extends BaseContract {
contractName: 'RelayerRegistry'
connect(signerOrProvider: Signer | Provider | string): this
attach(addressOrName: string): this
deployed(): Promise<this>
interface: RelayerRegistryInterface
queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>
listeners(eventName?: string): Array<Listener>
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this
removeAllListeners(eventName?: string): this
off: OnEvent<this>
on: OnEvent<this>
once: OnEvent<this>
removeListener: OnEvent<this>
functions: {
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<[string[]] & { result: string[] }>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
ens(overrides?: CallOverrides): Promise<[string]>
feeManager(overrides?: CallOverrides): Promise<[string]>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[BigNumber]>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[string]>
governance(overrides?: CallOverrides): Promise<[string]>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[boolean]>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[boolean]>
minStakeAmount(overrides?: CallOverrides): Promise<[BigNumber]>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
relayers(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber, string] & { balance: BigNumber; ensHash: string }>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<[string]>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
staking(overrides?: CallOverrides): Promise<[string]>
torn(overrides?: CallOverrides): Promise<[string]>
tornadoRouter(overrides?: CallOverrides): Promise<[string]>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[string]>
}
bulkResolve(domains: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<string[]>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
ens(overrides?: CallOverrides): Promise<string>
feeManager(overrides?: CallOverrides): Promise<string>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
governance(overrides?: CallOverrides): Promise<string>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<boolean>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<boolean>
minStakeAmount(overrides?: CallOverrides): Promise<BigNumber>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
relayers(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber, string] & { balance: BigNumber; ensHash: string }>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<string>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
staking(overrides?: CallOverrides): Promise<string>
torn(overrides?: CallOverrides): Promise<string>
tornadoRouter(overrides?: CallOverrides): Promise<string>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
callStatic: {
bulkResolve(domains: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<string[]>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>
ens(overrides?: CallOverrides): Promise<string>
feeManager(overrides?: CallOverrides): Promise<string>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
governance(overrides?: CallOverrides): Promise<string>
initialize(_tornadoRouter: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<void>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<boolean>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<boolean>
minStakeAmount(overrides?: CallOverrides): Promise<BigNumber>
nullifyBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<void>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: CallOverrides
): Promise<void>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<void>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>
relayers(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber, string] & { balance: BigNumber; ensHash: string }>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<string>
setMinStakeAmount(minAmount: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<void>
setTornadoRouter(tornadoRouterAddress: PromiseOrValue<string>, overrides?: CallOverrides): Promise<void>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<void>
staking(overrides?: CallOverrides): Promise<string>
torn(overrides?: CallOverrides): Promise<string>
tornadoRouter(overrides?: CallOverrides): Promise<string>
unregisterWorker(worker: PromiseOrValue<string>, overrides?: CallOverrides): Promise<void>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
}
filters: {
'MinimumStakeAmount(uint256)'(minStakeAmount?: null): MinimumStakeAmountEventFilter
MinimumStakeAmount(minStakeAmount?: null): MinimumStakeAmountEventFilter
'RelayerBalanceNullified(address)'(relayer?: null): RelayerBalanceNullifiedEventFilter
RelayerBalanceNullified(relayer?: null): RelayerBalanceNullifiedEventFilter
'RelayerRegistered(bytes32,string,address,uint256)'(
relayer?: null,
ensName?: null,
relayerAddress?: null,
stakedAmount?: null
): RelayerRegisteredEventFilter
RelayerRegistered(
relayer?: null,
ensName?: null,
relayerAddress?: null,
stakedAmount?: null
): RelayerRegisteredEventFilter
'RouterRegistered(address)'(tornadoRouter?: null): RouterRegisteredEventFilter
RouterRegistered(tornadoRouter?: null): RouterRegisteredEventFilter
'StakeAddedToRelayer(address,uint256)'(
relayer?: null,
amountStakeAdded?: null
): StakeAddedToRelayerEventFilter
StakeAddedToRelayer(relayer?: null, amountStakeAdded?: null): StakeAddedToRelayerEventFilter
'StakeBurned(address,uint256)'(relayer?: null, amountBurned?: null): StakeBurnedEventFilter
StakeBurned(relayer?: null, amountBurned?: null): StakeBurnedEventFilter
'WorkerRegistered(address,address)'(relayer?: null, worker?: null): WorkerRegisteredEventFilter
WorkerRegistered(relayer?: null, worker?: null): WorkerRegisteredEventFilter
'WorkerUnregistered(address,address)'(relayer?: null, worker?: null): WorkerUnregisteredEventFilter
WorkerUnregistered(relayer?: null, worker?: null): WorkerUnregisteredEventFilter
}
estimateGas: {
bulkResolve(domains: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<BigNumber>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
ens(overrides?: CallOverrides): Promise<BigNumber>
feeManager(overrides?: CallOverrides): Promise<BigNumber>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
governance(overrides?: CallOverrides): Promise<BigNumber>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>
minStakeAmount(overrides?: CallOverrides): Promise<BigNumber>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
relayers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<BigNumber>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
staking(overrides?: CallOverrides): Promise<BigNumber>
torn(overrides?: CallOverrides): Promise<BigNumber>
tornadoRouter(overrides?: CallOverrides): Promise<BigNumber>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
}
populateTransaction: {
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<PopulatedTransaction>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
ens(overrides?: CallOverrides): Promise<PopulatedTransaction>
feeManager(overrides?: CallOverrides): Promise<PopulatedTransaction>
getRelayerBalance(
relayer: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>
getRelayerEnsHash(
relayer: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>
governance(overrides?: CallOverrides): Promise<PopulatedTransaction>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>
minStakeAmount(overrides?: CallOverrides): Promise<PopulatedTransaction>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
relayers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<PopulatedTransaction>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
staking(overrides?: CallOverrides): Promise<PopulatedTransaction>
torn(overrides?: CallOverrides): Promise<PopulatedTransaction>
tornadoRouter(overrides?: CallOverrides): Promise<PopulatedTransaction>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>
}
}

View File

@ -0,0 +1,875 @@
/* 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 RelayerRegistryAbiInterface extends utils.Interface {
functions: {
'bulkResolve(bytes32[])': FunctionFragment
'burn(address,address,address)': FunctionFragment
'ens()': FunctionFragment
'feeManager()': FunctionFragment
'getRelayerBalance(address)': FunctionFragment
'getRelayerEnsHash(address)': FunctionFragment
'governance()': FunctionFragment
'initialize(bytes32)': FunctionFragment
'isRelayer(address)': FunctionFragment
'isRelayerRegistered(address,address)': FunctionFragment
'minStakeAmount()': FunctionFragment
'nullifyBalance(address)': FunctionFragment
'register(string,uint256,address[])': FunctionFragment
'registerPermit(string,uint256,address[],address,uint256,uint8,bytes32,bytes32)': FunctionFragment
'registerWorker(address,address)': FunctionFragment
'relayers(address)': FunctionFragment
'resolve(bytes32)': FunctionFragment
'setMinStakeAmount(uint256)': FunctionFragment
'setTornadoRouter(address)': FunctionFragment
'stakeToRelayer(address,uint256)': FunctionFragment
'stakeToRelayerPermit(address,uint256,address,uint256,uint8,bytes32,bytes32)': FunctionFragment
'staking()': FunctionFragment
'torn()': FunctionFragment
'tornadoRouter()': FunctionFragment
'unregisterWorker(address)': FunctionFragment
'workers(address)': FunctionFragment
}
getFunction(
nameOrSignatureOrTopic:
| 'bulkResolve'
| 'burn'
| 'ens'
| 'feeManager'
| 'getRelayerBalance'
| 'getRelayerEnsHash'
| 'governance'
| 'initialize'
| 'isRelayer'
| 'isRelayerRegistered'
| 'minStakeAmount'
| 'nullifyBalance'
| 'register'
| 'registerPermit'
| 'registerWorker'
| 'relayers'
| 'resolve'
| 'setMinStakeAmount'
| 'setTornadoRouter'
| 'stakeToRelayer'
| 'stakeToRelayerPermit'
| 'staking'
| 'torn'
| 'tornadoRouter'
| 'unregisterWorker'
| 'workers'
): FunctionFragment
encodeFunctionData(functionFragment: 'bulkResolve', values: [PromiseOrValue<BytesLike>[]]): string
encodeFunctionData(
functionFragment: 'burn',
values: [PromiseOrValue<string>, PromiseOrValue<string>, PromiseOrValue<string>]
): string
encodeFunctionData(functionFragment: 'ens', values?: undefined): string
encodeFunctionData(functionFragment: 'feeManager', values?: undefined): string
encodeFunctionData(functionFragment: 'getRelayerBalance', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'getRelayerEnsHash', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'governance', values?: undefined): string
encodeFunctionData(functionFragment: 'initialize', values: [PromiseOrValue<BytesLike>]): string
encodeFunctionData(functionFragment: 'isRelayer', values: [PromiseOrValue<string>]): string
encodeFunctionData(
functionFragment: 'isRelayerRegistered',
values: [PromiseOrValue<string>, PromiseOrValue<string>]
): string
encodeFunctionData(functionFragment: 'minStakeAmount', values?: undefined): string
encodeFunctionData(functionFragment: 'nullifyBalance', values: [PromiseOrValue<string>]): string
encodeFunctionData(
functionFragment: 'register',
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>, PromiseOrValue<string>[]]
): string
encodeFunctionData(
functionFragment: 'registerPermit',
values: [
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<string>[],
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>
]
): string
encodeFunctionData(
functionFragment: 'registerWorker',
values: [PromiseOrValue<string>, PromiseOrValue<string>]
): string
encodeFunctionData(functionFragment: 'relayers', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'resolve', values: [PromiseOrValue<BytesLike>]): string
encodeFunctionData(functionFragment: 'setMinStakeAmount', values: [PromiseOrValue<BigNumberish>]): string
encodeFunctionData(functionFragment: 'setTornadoRouter', values: [PromiseOrValue<string>]): string
encodeFunctionData(
functionFragment: 'stakeToRelayer',
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string
encodeFunctionData(
functionFragment: 'stakeToRelayerPermit',
values: [
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>
]
): string
encodeFunctionData(functionFragment: 'staking', values?: undefined): string
encodeFunctionData(functionFragment: 'torn', values?: undefined): string
encodeFunctionData(functionFragment: 'tornadoRouter', values?: undefined): string
encodeFunctionData(functionFragment: 'unregisterWorker', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'workers', values: [PromiseOrValue<string>]): string
decodeFunctionResult(functionFragment: 'bulkResolve', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'feeManager', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'getRelayerBalance', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'getRelayerEnsHash', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'governance', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'initialize', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'isRelayer', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'isRelayerRegistered', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'minStakeAmount', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'nullifyBalance', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'register', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'registerPermit', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'registerWorker', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'relayers', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'resolve', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'setMinStakeAmount', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'setTornadoRouter', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'stakeToRelayer', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'stakeToRelayerPermit', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'staking', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'torn', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'tornadoRouter', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'unregisterWorker', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'workers', data: BytesLike): Result
events: {
'MinimumStakeAmount(uint256)': EventFragment
'RelayerBalanceNullified(address)': EventFragment
'RelayerRegistered(bytes32,string,address,uint256)': EventFragment
'RouterRegistered(address)': EventFragment
'StakeAddedToRelayer(address,uint256)': EventFragment
'StakeBurned(address,uint256)': EventFragment
'WorkerRegistered(address,address)': EventFragment
'WorkerUnregistered(address,address)': EventFragment
}
getEvent(nameOrSignatureOrTopic: 'MinimumStakeAmount'): EventFragment
getEvent(nameOrSignatureOrTopic: 'RelayerBalanceNullified'): EventFragment
getEvent(nameOrSignatureOrTopic: 'RelayerRegistered'): EventFragment
getEvent(nameOrSignatureOrTopic: 'RouterRegistered'): EventFragment
getEvent(nameOrSignatureOrTopic: 'StakeAddedToRelayer'): EventFragment
getEvent(nameOrSignatureOrTopic: 'StakeBurned'): EventFragment
getEvent(nameOrSignatureOrTopic: 'WorkerRegistered'): EventFragment
getEvent(nameOrSignatureOrTopic: 'WorkerUnregistered'): EventFragment
}
export interface MinimumStakeAmountEventObject {
minStakeAmount: BigNumber
}
export type MinimumStakeAmountEvent = TypedEvent<[BigNumber], MinimumStakeAmountEventObject>
export type MinimumStakeAmountEventFilter = TypedEventFilter<MinimumStakeAmountEvent>
export interface RelayerBalanceNullifiedEventObject {
relayer: string
}
export type RelayerBalanceNullifiedEvent = TypedEvent<[string], RelayerBalanceNullifiedEventObject>
export type RelayerBalanceNullifiedEventFilter = TypedEventFilter<RelayerBalanceNullifiedEvent>
export interface RelayerRegisteredEventObject {
relayer: string
ensName: string
relayerAddress: string
stakedAmount: BigNumber
}
export type RelayerRegisteredEvent = TypedEvent<
[string, string, string, BigNumber],
RelayerRegisteredEventObject
>
export type RelayerRegisteredEventFilter = TypedEventFilter<RelayerRegisteredEvent>
export interface RouterRegisteredEventObject {
tornadoRouter: string
}
export type RouterRegisteredEvent = TypedEvent<[string], RouterRegisteredEventObject>
export type RouterRegisteredEventFilter = TypedEventFilter<RouterRegisteredEvent>
export interface StakeAddedToRelayerEventObject {
relayer: string
amountStakeAdded: BigNumber
}
export type StakeAddedToRelayerEvent = TypedEvent<[string, BigNumber], StakeAddedToRelayerEventObject>
export type StakeAddedToRelayerEventFilter = TypedEventFilter<StakeAddedToRelayerEvent>
export interface StakeBurnedEventObject {
relayer: string
amountBurned: BigNumber
}
export type StakeBurnedEvent = TypedEvent<[string, BigNumber], StakeBurnedEventObject>
export type StakeBurnedEventFilter = TypedEventFilter<StakeBurnedEvent>
export interface WorkerRegisteredEventObject {
relayer: string
worker: string
}
export type WorkerRegisteredEvent = TypedEvent<[string, string], WorkerRegisteredEventObject>
export type WorkerRegisteredEventFilter = TypedEventFilter<WorkerRegisteredEvent>
export interface WorkerUnregisteredEventObject {
relayer: string
worker: string
}
export type WorkerUnregisteredEvent = TypedEvent<[string, string], WorkerUnregisteredEventObject>
export type WorkerUnregisteredEventFilter = TypedEventFilter<WorkerUnregisteredEvent>
export interface RelayerRegistryAbi extends BaseContract {
contractName: 'RelayerRegistryAbi'
connect(signerOrProvider: Signer | Provider | string): this
attach(addressOrName: string): this
deployed(): Promise<this>
interface: RelayerRegistryAbiInterface
queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>
listeners(eventName?: string): Array<Listener>
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this
removeAllListeners(eventName?: string): this
off: OnEvent<this>
on: OnEvent<this>
once: OnEvent<this>
removeListener: OnEvent<this>
functions: {
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<[string[]] & { result: string[] }>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
ens(overrides?: CallOverrides): Promise<[string]>
feeManager(overrides?: CallOverrides): Promise<[string]>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[BigNumber]>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[string]>
governance(overrides?: CallOverrides): Promise<[string]>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[boolean]>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[boolean]>
minStakeAmount(overrides?: CallOverrides): Promise<[BigNumber]>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
relayers(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber, string] & { balance: BigNumber; ensHash: string }>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<[string]>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
staking(overrides?: CallOverrides): Promise<[string]>
torn(overrides?: CallOverrides): Promise<[string]>
tornadoRouter(overrides?: CallOverrides): Promise<[string]>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[string]>
}
bulkResolve(domains: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<string[]>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
ens(overrides?: CallOverrides): Promise<string>
feeManager(overrides?: CallOverrides): Promise<string>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
governance(overrides?: CallOverrides): Promise<string>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<boolean>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<boolean>
minStakeAmount(overrides?: CallOverrides): Promise<BigNumber>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
relayers(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber, string] & { balance: BigNumber; ensHash: string }>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<string>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
staking(overrides?: CallOverrides): Promise<string>
torn(overrides?: CallOverrides): Promise<string>
tornadoRouter(overrides?: CallOverrides): Promise<string>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
callStatic: {
bulkResolve(domains: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<string[]>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>
ens(overrides?: CallOverrides): Promise<string>
feeManager(overrides?: CallOverrides): Promise<string>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
governance(overrides?: CallOverrides): Promise<string>
initialize(_tornadoRouter: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<void>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<boolean>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<boolean>
minStakeAmount(overrides?: CallOverrides): Promise<BigNumber>
nullifyBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<void>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: CallOverrides
): Promise<void>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<void>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>
relayers(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber, string] & { balance: BigNumber; ensHash: string }>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<string>
setMinStakeAmount(minAmount: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<void>
setTornadoRouter(tornadoRouterAddress: PromiseOrValue<string>, overrides?: CallOverrides): Promise<void>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<void>
staking(overrides?: CallOverrides): Promise<string>
torn(overrides?: CallOverrides): Promise<string>
tornadoRouter(overrides?: CallOverrides): Promise<string>
unregisterWorker(worker: PromiseOrValue<string>, overrides?: CallOverrides): Promise<void>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
}
filters: {
'MinimumStakeAmount(uint256)'(minStakeAmount?: null): MinimumStakeAmountEventFilter
MinimumStakeAmount(minStakeAmount?: null): MinimumStakeAmountEventFilter
'RelayerBalanceNullified(address)'(relayer?: null): RelayerBalanceNullifiedEventFilter
RelayerBalanceNullified(relayer?: null): RelayerBalanceNullifiedEventFilter
'RelayerRegistered(bytes32,string,address,uint256)'(
relayer?: null,
ensName?: null,
relayerAddress?: null,
stakedAmount?: null
): RelayerRegisteredEventFilter
RelayerRegistered(
relayer?: null,
ensName?: null,
relayerAddress?: null,
stakedAmount?: null
): RelayerRegisteredEventFilter
'RouterRegistered(address)'(tornadoRouter?: null): RouterRegisteredEventFilter
RouterRegistered(tornadoRouter?: null): RouterRegisteredEventFilter
'StakeAddedToRelayer(address,uint256)'(
relayer?: null,
amountStakeAdded?: null
): StakeAddedToRelayerEventFilter
StakeAddedToRelayer(relayer?: null, amountStakeAdded?: null): StakeAddedToRelayerEventFilter
'StakeBurned(address,uint256)'(relayer?: null, amountBurned?: null): StakeBurnedEventFilter
StakeBurned(relayer?: null, amountBurned?: null): StakeBurnedEventFilter
'WorkerRegistered(address,address)'(relayer?: null, worker?: null): WorkerRegisteredEventFilter
WorkerRegistered(relayer?: null, worker?: null): WorkerRegisteredEventFilter
'WorkerUnregistered(address,address)'(relayer?: null, worker?: null): WorkerUnregisteredEventFilter
WorkerUnregistered(relayer?: null, worker?: null): WorkerUnregisteredEventFilter
}
estimateGas: {
bulkResolve(domains: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<BigNumber>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
ens(overrides?: CallOverrides): Promise<BigNumber>
feeManager(overrides?: CallOverrides): Promise<BigNumber>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
governance(overrides?: CallOverrides): Promise<BigNumber>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>
minStakeAmount(overrides?: CallOverrides): Promise<BigNumber>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
relayers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<BigNumber>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
staking(overrides?: CallOverrides): Promise<BigNumber>
torn(overrides?: CallOverrides): Promise<BigNumber>
tornadoRouter(overrides?: CallOverrides): Promise<BigNumber>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
}
populateTransaction: {
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<PopulatedTransaction>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
ens(overrides?: CallOverrides): Promise<PopulatedTransaction>
feeManager(overrides?: CallOverrides): Promise<PopulatedTransaction>
getRelayerBalance(
relayer: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>
getRelayerEnsHash(
relayer: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>
governance(overrides?: CallOverrides): Promise<PopulatedTransaction>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>
minStakeAmount(overrides?: CallOverrides): Promise<PopulatedTransaction>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
relayers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<PopulatedTransaction>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
staking(overrides?: CallOverrides): Promise<PopulatedTransaction>
torn(overrides?: CallOverrides): Promise<PopulatedTransaction>
tornadoRouter(overrides?: CallOverrides): Promise<PopulatedTransaction>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>
}
}

View File

@ -0,0 +1,688 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from 'ethers'
import type { Provider } from '@ethersproject/providers'
import type { RelayerRegistryAbi, RelayerRegistryAbiInterface } from '../RelayerRegistryAbi'
const _abi = [
{
inputs: [
{
internalType: 'address',
name: '_torn',
type: 'address'
},
{
internalType: 'address',
name: '_governance',
type: 'address'
},
{
internalType: 'address',
name: '_ens',
type: 'address'
},
{
internalType: 'bytes32',
name: '_staking',
type: 'bytes32'
},
{
internalType: 'bytes32',
name: '_feeManager',
type: 'bytes32'
}
],
stateMutability: 'nonpayable',
type: 'constructor'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'uint256',
name: 'minStakeAmount',
type: 'uint256'
}
],
name: 'MinimumStakeAmount',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'address',
name: 'relayer',
type: 'address'
}
],
name: 'RelayerBalanceNullified',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'bytes32',
name: 'relayer',
type: 'bytes32'
},
{
indexed: false,
internalType: 'string',
name: 'ensName',
type: 'string'
},
{
indexed: false,
internalType: 'address',
name: 'relayerAddress',
type: 'address'
},
{
indexed: false,
internalType: 'uint256',
name: 'stakedAmount',
type: 'uint256'
}
],
name: 'RelayerRegistered',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'address',
name: 'tornadoRouter',
type: 'address'
}
],
name: 'RouterRegistered',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
indexed: false,
internalType: 'uint256',
name: 'amountStakeAdded',
type: 'uint256'
}
],
name: 'StakeAddedToRelayer',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
indexed: false,
internalType: 'uint256',
name: 'amountBurned',
type: 'uint256'
}
],
name: 'StakeBurned',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
indexed: false,
internalType: 'address',
name: 'worker',
type: 'address'
}
],
name: 'WorkerRegistered',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
indexed: false,
internalType: 'address',
name: 'worker',
type: 'address'
}
],
name: 'WorkerUnregistered',
type: 'event'
},
{
inputs: [
{
internalType: 'bytes32[]',
name: 'domains',
type: 'bytes32[]'
}
],
name: 'bulkResolve',
outputs: [
{
internalType: 'address[]',
name: 'result',
type: 'address[]'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'sender',
type: 'address'
},
{
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
internalType: 'contract ITornadoInstance',
name: 'pool',
type: 'address'
}
],
name: 'burn',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [],
name: 'ens',
outputs: [
{
internalType: 'contract IENS',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [],
name: 'feeManager',
outputs: [
{
internalType: 'contract FeeManager',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
}
],
name: 'getRelayerBalance',
outputs: [
{
internalType: 'uint256',
name: '',
type: 'uint256'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
}
],
name: 'getRelayerEnsHash',
outputs: [
{
internalType: 'bytes32',
name: '',
type: 'bytes32'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [],
name: 'governance',
outputs: [
{
internalType: 'address',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'bytes32',
name: '_tornadoRouter',
type: 'bytes32'
}
],
name: 'initialize',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'toResolve',
type: 'address'
}
],
name: 'isRelayer',
outputs: [
{
internalType: 'bool',
name: '',
type: 'bool'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
internalType: 'address',
name: 'toResolve',
type: 'address'
}
],
name: 'isRelayerRegistered',
outputs: [
{
internalType: 'bool',
name: '',
type: 'bool'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [],
name: 'minStakeAmount',
outputs: [
{
internalType: 'uint256',
name: '',
type: 'uint256'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
}
],
name: 'nullifyBalance',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'string',
name: 'ensName',
type: 'string'
},
{
internalType: 'uint256',
name: 'stake',
type: 'uint256'
},
{
internalType: 'address[]',
name: 'workersToRegister',
type: 'address[]'
}
],
name: 'register',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'string',
name: 'ensName',
type: 'string'
},
{
internalType: 'uint256',
name: 'stake',
type: 'uint256'
},
{
internalType: 'address[]',
name: 'workersToRegister',
type: 'address[]'
},
{
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
internalType: 'uint256',
name: 'deadline',
type: 'uint256'
},
{
internalType: 'uint8',
name: 'v',
type: 'uint8'
},
{
internalType: 'bytes32',
name: 'r',
type: 'bytes32'
},
{
internalType: 'bytes32',
name: 's',
type: 'bytes32'
}
],
name: 'registerPermit',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
internalType: 'address',
name: 'worker',
type: 'address'
}
],
name: 'registerWorker',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: '',
type: 'address'
}
],
name: 'relayers',
outputs: [
{
internalType: 'uint256',
name: 'balance',
type: 'uint256'
},
{
internalType: 'bytes32',
name: 'ensHash',
type: 'bytes32'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'bytes32',
name: 'node',
type: 'bytes32'
}
],
name: 'resolve',
outputs: [
{
internalType: 'address',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'uint256',
name: 'minAmount',
type: 'uint256'
}
],
name: 'setMinStakeAmount',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'tornadoRouterAddress',
type: 'address'
}
],
name: 'setTornadoRouter',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
internalType: 'uint256',
name: 'stake',
type: 'uint256'
}
],
name: 'stakeToRelayer',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
internalType: 'uint256',
name: 'stake',
type: 'uint256'
},
{
internalType: 'address',
name: 'staker',
type: 'address'
},
{
internalType: 'uint256',
name: 'deadline',
type: 'uint256'
},
{
internalType: 'uint8',
name: 'v',
type: 'uint8'
},
{
internalType: 'bytes32',
name: 'r',
type: 'bytes32'
},
{
internalType: 'bytes32',
name: 's',
type: 'bytes32'
}
],
name: 'stakeToRelayerPermit',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [],
name: 'staking',
outputs: [
{
internalType: 'contract ITornadoStakingRewards',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [],
name: 'torn',
outputs: [
{
internalType: 'contract TORN',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [],
name: 'tornadoRouter',
outputs: [
{
internalType: 'address',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'worker',
type: 'address'
}
],
name: 'unregisterWorker',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: '',
type: 'address'
}
],
name: 'workers',
outputs: [
{
internalType: 'address',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
}
] as const
export class RelayerRegistryAbi__factory {
static readonly abi = _abi
static createInterface(): RelayerRegistryAbiInterface {
return new utils.Interface(_abi) as RelayerRegistryAbiInterface
}
static connect(address: string, signerOrProvider: Signer | Provider): RelayerRegistryAbi {
return new Contract(address, _abi, signerOrProvider) as RelayerRegistryAbi
}
}

File diff suppressed because one or more lines are too long

View File

@ -7,5 +7,6 @@ export { ERC20Tornado__factory } from './ERC20Tornado__factory'
export { ETHTornado__factory } from './ETHTornado__factory'
export { Multicall3Contract__factory } from './Multicall3Contract__factory'
export { MulticallContract__factory } from './MulticallContract__factory'
export { RelayerRegistry__factory } from './RelayerRegistry__factory'
export { TornadoInstance__factory } from './TornadoInstance__factory'
export { TornadoProxy__factory } from './TornadoProxy__factory'

View File

@ -7,6 +7,7 @@ export type { ERC20Tornado } from './ERC20Tornado'
export type { ETHTornado } from './ETHTornado'
export type { Multicall3Contract } from './Multicall3Contract'
export type { MulticallContract } from './MulticallContract'
export type { RelayerRegistry } from './RelayerRegistry'
export type { TornadoInstance } from './TornadoInstance'
export type { TornadoProxy } from './TornadoProxy'
export * as factories from './factories'
@ -16,5 +17,6 @@ export { ERC20Tornado__factory } from './factories/ERC20Tornado__factory'
export { ETHTornado__factory } from './factories/ETHTornado__factory'
export { Multicall3Contract__factory } from './factories/Multicall3Contract__factory'
export { MulticallContract__factory } from './factories/MulticallContract__factory'
export { RelayerRegistry__factory } from './factories/RelayerRegistry__factory'
export { TornadoInstance__factory } from './factories/TornadoInstance__factory'
export { TornadoProxy__factory } from './factories/TornadoProxy__factory'

View File

@ -3,7 +3,7 @@ import { MarkOptional, DeepRequired } from 'ts-essentials'
// External modules
import EventEmitter from 'events'
import { randomBytes } from 'crypto'
import { randomBytes, sign } from 'crypto'
import { TransactionRequest } from '@ethersproject/abstract-provider'
import {
EventFilter,
@ -27,12 +27,14 @@ import {
TornadoProxy,
ERC20,
ERC20__factory,
RelayerRegistry,
RelayerRegistry__factory,
Multicall3Contract__factory
} from './deth'
import { Multicall3 } from './deth/Multicall3Contract'
// Local modules
import { Onchain, Cache, Docs } from '@tornado/sdk-data'
import { Onchain, Cache, Docs, Options as DataOptions } from '@tornado/sdk-data'
import { ErrorUtils, HexUtils, AsyncUtils } from '@tornado/sdk-utils'
// @ts-ignore
@ -40,7 +42,13 @@ import { parseIndexableString } from 'pouchdb-collate'
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECLARATIONS (MUST BE INLINED) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export type TornadoContracts = TornadoInstance | TornadoProxy | ETHTornado | ERC20Tornado | ERC20
export type TornadoContracts =
| TornadoInstance
| TornadoProxy
| ETHTornado
| ERC20Tornado
| ERC20
| RelayerRegistry
export namespace Options {
export interface Sync {
@ -51,9 +59,9 @@ export namespace Options {
concurrencyLimit?: number
msTimeout?: number
listenForEvents?: boolean
persistentCache?: true
cacheAdapter?: string
}
export type Cache = DataOptions.Cache
}
// We use a vanilla provider here, but in reality we will probably
@ -201,6 +209,8 @@ export namespace Contracts {
return ETHTornado__factory.connect(address, signerOrProvider) as C
} else if (name == 'ERC20Tornado') {
return ERC20Tornado__factory.connect(address, signerOrProvider) as C
} else if (name == 'RelayerRegistry') {
return RelayerRegistry__factory.connect(address, signerOrProvider) as C
} else {
return ERC20__factory.connect(address, signerOrProvider) as C
}
@ -220,6 +230,20 @@ export namespace Contracts {
return contractMap.get(`TornadoProxy${network}`) as TornadoProxy
}
export function getRegistry(signerOrProvider: Signer | Provider, network?: string): RelayerRegistry {
const key = `RelayerRegistry${network}`
if (!contractMap.has(key))
contractMap.set(
key,
_getContract<RelayerRegistry>(
'RelayerRegistry',
Onchain.getRegistryAddressSync(network),
signerOrProvider
)
)
return contractMap.get(key) as RelayerRegistry
}
export function getInstance(
network: string,
token: string,
@ -259,6 +283,13 @@ export namespace Contracts {
}
export abstract class Synchronizer extends EventEmitter {
caches: Map<string, Cache.Syncable<Docs.Base>>
constructor() {
super()
this.caches = new Map<string, Cache.Syncable<Docs.Base>>()
}
async sync(
eventName: string,
filter: EventFilter,
@ -266,7 +297,7 @@ export abstract class Synchronizer extends EventEmitter {
cache: Cache.Syncable<Docs.Base>,
options?: Options.Sync
): Promise<void> {
const _options = await this._populateSyncOptions(options)
const _options = await this._populateSyncOptions(options ?? {})
// Assign pooler
cache.initializePooler(cache.getCallbacks(contract), cache.getErrorHandlers(), _options.concurrencyLimit)
@ -284,6 +315,9 @@ export abstract class Synchronizer extends EventEmitter {
_options.blockDelta = _options.blockDivisor
? Math.floor((_options.targetBlock - _options.startBlock) / _options.blockDivisor)
: _options.blockDelta
if (10_000 < _options.blockDelta)
throw ErrorUtils.getError('Synchronizer.sync: blockDelta must not be above 10,000!')
}
// Start synchronizing
@ -348,6 +382,13 @@ export abstract class Synchronizer extends EventEmitter {
await cache.db.bulkDocs(results).catch((err) => {
throw ErrorUtils.ensureError(err)
})
// Add cache if not present
if (!this.caches.has(cache.name)) this.caches.set(cache.name, cache)
}
loadCache<D extends Docs.Base, C extends Cache.Syncable<D> = Cache.Syncable<D>>(name: string): C {
return this.caches.get(name) as C
}
listenForEvents(
@ -366,5 +407,53 @@ export abstract class Synchronizer extends EventEmitter {
contract.off(event, listeners[listenerIndex])
}
protected abstract _populateSyncOptions(options?: Options.Sync): Promise<DeepRequired<Options.Sync>>
protected async _populateSyncOptions(options: Options.Sync): Promise<DeepRequired<Options.Sync>> {
if (!options.targetBlock)
throw ErrorUtils.getError('Synchronizer._populateSyncOptions: targetBlock not set.')
if (!options.startBlock)
throw ErrorUtils.getError('Synchronizer._populateSyncOptions: startBlock not set.')
options.blockDelta =
options.blockDelta ??
(options.blockDivisor
? Math.floor((options.targetBlock - options.startBlock) / options.blockDivisor)
: 10000)
if (10_000 < options.blockDelta)
throw ErrorUtils.getError('Synchronizer._populateSyncOptions: blockDelta must not be above 10,000!')
options.concurrencyLimit = options.concurrencyLimit ?? 8
options.msTimeout = options.msTimeout ?? 200 // 5 requests per second
options.listenForEvents = options.listenForEvents ?? false
return options as DeepRequired<Options.Sync>
}
}
export function syncErrorHandler(
err: Error,
numResolvedPromises: number,
callbackIndex: number,
orderIndex: number,
...args: any[]
): void {
err = ErrorUtils.ensureError<Error>(err)
if (err.message.match('context deadline exceeded'))
console.error(
ErrorUtils.getError(
`Context deadline exceeded, stop if more promises do not resolve. Resolved: ${numResolvedPromises}`
)
)
else if (err.message.match('Invalid JSON RPC'))
console.error(
ErrorUtils.getError(`Endpoint returned invalid value (we might be rate limited), retrying.`)
)
else {
err.message += `\nCallback args supplied: [${args.join(', ')}]\n`
throw err
}
}

View File

@ -1,6 +1,6 @@
ISC License
Copyright 2023 T-Hax
Copyright 2023 AlienTornadosaurusHex
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

View File

@ -1,11 +1,11 @@
{
"name": "@tornado/sdk-core",
"author": "T-Hax",
"author": "AlienTornadosaurusHex",
"license": "ISC",
"description": "Tornado SDK core modules.",
"repository": {
"type": "git",
"url": "https://development.tornadocash.community/T-Hax/sdk-monorepo"
"url": "https://development.tornadocash.community/AlienTornadosaurusHex/sdk-monorepo"
},
"homepage": "https://tornadocash.community",
"keywords": [

View File

@ -0,0 +1,875 @@
/* 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 RelayerRegistryInterface extends utils.Interface {
functions: {
'bulkResolve(bytes32[])': FunctionFragment
'burn(address,address,address)': FunctionFragment
'ens()': FunctionFragment
'feeManager()': FunctionFragment
'getRelayerBalance(address)': FunctionFragment
'getRelayerEnsHash(address)': FunctionFragment
'governance()': FunctionFragment
'initialize(bytes32)': FunctionFragment
'isRelayer(address)': FunctionFragment
'isRelayerRegistered(address,address)': FunctionFragment
'minStakeAmount()': FunctionFragment
'nullifyBalance(address)': FunctionFragment
'register(string,uint256,address[])': FunctionFragment
'registerPermit(string,uint256,address[],address,uint256,uint8,bytes32,bytes32)': FunctionFragment
'registerWorker(address,address)': FunctionFragment
'relayers(address)': FunctionFragment
'resolve(bytes32)': FunctionFragment
'setMinStakeAmount(uint256)': FunctionFragment
'setTornadoRouter(address)': FunctionFragment
'stakeToRelayer(address,uint256)': FunctionFragment
'stakeToRelayerPermit(address,uint256,address,uint256,uint8,bytes32,bytes32)': FunctionFragment
'staking()': FunctionFragment
'torn()': FunctionFragment
'tornadoRouter()': FunctionFragment
'unregisterWorker(address)': FunctionFragment
'workers(address)': FunctionFragment
}
getFunction(
nameOrSignatureOrTopic:
| 'bulkResolve'
| 'burn'
| 'ens'
| 'feeManager'
| 'getRelayerBalance'
| 'getRelayerEnsHash'
| 'governance'
| 'initialize'
| 'isRelayer'
| 'isRelayerRegistered'
| 'minStakeAmount'
| 'nullifyBalance'
| 'register'
| 'registerPermit'
| 'registerWorker'
| 'relayers'
| 'resolve'
| 'setMinStakeAmount'
| 'setTornadoRouter'
| 'stakeToRelayer'
| 'stakeToRelayerPermit'
| 'staking'
| 'torn'
| 'tornadoRouter'
| 'unregisterWorker'
| 'workers'
): FunctionFragment
encodeFunctionData(functionFragment: 'bulkResolve', values: [PromiseOrValue<BytesLike>[]]): string
encodeFunctionData(
functionFragment: 'burn',
values: [PromiseOrValue<string>, PromiseOrValue<string>, PromiseOrValue<string>]
): string
encodeFunctionData(functionFragment: 'ens', values?: undefined): string
encodeFunctionData(functionFragment: 'feeManager', values?: undefined): string
encodeFunctionData(functionFragment: 'getRelayerBalance', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'getRelayerEnsHash', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'governance', values?: undefined): string
encodeFunctionData(functionFragment: 'initialize', values: [PromiseOrValue<BytesLike>]): string
encodeFunctionData(functionFragment: 'isRelayer', values: [PromiseOrValue<string>]): string
encodeFunctionData(
functionFragment: 'isRelayerRegistered',
values: [PromiseOrValue<string>, PromiseOrValue<string>]
): string
encodeFunctionData(functionFragment: 'minStakeAmount', values?: undefined): string
encodeFunctionData(functionFragment: 'nullifyBalance', values: [PromiseOrValue<string>]): string
encodeFunctionData(
functionFragment: 'register',
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>, PromiseOrValue<string>[]]
): string
encodeFunctionData(
functionFragment: 'registerPermit',
values: [
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<string>[],
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>
]
): string
encodeFunctionData(
functionFragment: 'registerWorker',
values: [PromiseOrValue<string>, PromiseOrValue<string>]
): string
encodeFunctionData(functionFragment: 'relayers', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'resolve', values: [PromiseOrValue<BytesLike>]): string
encodeFunctionData(functionFragment: 'setMinStakeAmount', values: [PromiseOrValue<BigNumberish>]): string
encodeFunctionData(functionFragment: 'setTornadoRouter', values: [PromiseOrValue<string>]): string
encodeFunctionData(
functionFragment: 'stakeToRelayer',
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string
encodeFunctionData(
functionFragment: 'stakeToRelayerPermit',
values: [
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>
]
): string
encodeFunctionData(functionFragment: 'staking', values?: undefined): string
encodeFunctionData(functionFragment: 'torn', values?: undefined): string
encodeFunctionData(functionFragment: 'tornadoRouter', values?: undefined): string
encodeFunctionData(functionFragment: 'unregisterWorker', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'workers', values: [PromiseOrValue<string>]): string
decodeFunctionResult(functionFragment: 'bulkResolve', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'feeManager', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'getRelayerBalance', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'getRelayerEnsHash', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'governance', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'initialize', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'isRelayer', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'isRelayerRegistered', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'minStakeAmount', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'nullifyBalance', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'register', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'registerPermit', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'registerWorker', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'relayers', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'resolve', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'setMinStakeAmount', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'setTornadoRouter', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'stakeToRelayer', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'stakeToRelayerPermit', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'staking', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'torn', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'tornadoRouter', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'unregisterWorker', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'workers', data: BytesLike): Result
events: {
'MinimumStakeAmount(uint256)': EventFragment
'RelayerBalanceNullified(address)': EventFragment
'RelayerRegistered(bytes32,string,address,uint256)': EventFragment
'RouterRegistered(address)': EventFragment
'StakeAddedToRelayer(address,uint256)': EventFragment
'StakeBurned(address,uint256)': EventFragment
'WorkerRegistered(address,address)': EventFragment
'WorkerUnregistered(address,address)': EventFragment
}
getEvent(nameOrSignatureOrTopic: 'MinimumStakeAmount'): EventFragment
getEvent(nameOrSignatureOrTopic: 'RelayerBalanceNullified'): EventFragment
getEvent(nameOrSignatureOrTopic: 'RelayerRegistered'): EventFragment
getEvent(nameOrSignatureOrTopic: 'RouterRegistered'): EventFragment
getEvent(nameOrSignatureOrTopic: 'StakeAddedToRelayer'): EventFragment
getEvent(nameOrSignatureOrTopic: 'StakeBurned'): EventFragment
getEvent(nameOrSignatureOrTopic: 'WorkerRegistered'): EventFragment
getEvent(nameOrSignatureOrTopic: 'WorkerUnregistered'): EventFragment
}
export interface MinimumStakeAmountEventObject {
minStakeAmount: BigNumber
}
export type MinimumStakeAmountEvent = TypedEvent<[BigNumber], MinimumStakeAmountEventObject>
export type MinimumStakeAmountEventFilter = TypedEventFilter<MinimumStakeAmountEvent>
export interface RelayerBalanceNullifiedEventObject {
relayer: string
}
export type RelayerBalanceNullifiedEvent = TypedEvent<[string], RelayerBalanceNullifiedEventObject>
export type RelayerBalanceNullifiedEventFilter = TypedEventFilter<RelayerBalanceNullifiedEvent>
export interface RelayerRegisteredEventObject {
relayer: string
ensName: string
relayerAddress: string
stakedAmount: BigNumber
}
export type RelayerRegisteredEvent = TypedEvent<
[string, string, string, BigNumber],
RelayerRegisteredEventObject
>
export type RelayerRegisteredEventFilter = TypedEventFilter<RelayerRegisteredEvent>
export interface RouterRegisteredEventObject {
tornadoRouter: string
}
export type RouterRegisteredEvent = TypedEvent<[string], RouterRegisteredEventObject>
export type RouterRegisteredEventFilter = TypedEventFilter<RouterRegisteredEvent>
export interface StakeAddedToRelayerEventObject {
relayer: string
amountStakeAdded: BigNumber
}
export type StakeAddedToRelayerEvent = TypedEvent<[string, BigNumber], StakeAddedToRelayerEventObject>
export type StakeAddedToRelayerEventFilter = TypedEventFilter<StakeAddedToRelayerEvent>
export interface StakeBurnedEventObject {
relayer: string
amountBurned: BigNumber
}
export type StakeBurnedEvent = TypedEvent<[string, BigNumber], StakeBurnedEventObject>
export type StakeBurnedEventFilter = TypedEventFilter<StakeBurnedEvent>
export interface WorkerRegisteredEventObject {
relayer: string
worker: string
}
export type WorkerRegisteredEvent = TypedEvent<[string, string], WorkerRegisteredEventObject>
export type WorkerRegisteredEventFilter = TypedEventFilter<WorkerRegisteredEvent>
export interface WorkerUnregisteredEventObject {
relayer: string
worker: string
}
export type WorkerUnregisteredEvent = TypedEvent<[string, string], WorkerUnregisteredEventObject>
export type WorkerUnregisteredEventFilter = TypedEventFilter<WorkerUnregisteredEvent>
export interface RelayerRegistry extends BaseContract {
contractName: 'RelayerRegistry'
connect(signerOrProvider: Signer | Provider | string): this
attach(addressOrName: string): this
deployed(): Promise<this>
interface: RelayerRegistryInterface
queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>
listeners(eventName?: string): Array<Listener>
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this
removeAllListeners(eventName?: string): this
off: OnEvent<this>
on: OnEvent<this>
once: OnEvent<this>
removeListener: OnEvent<this>
functions: {
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<[string[]] & { result: string[] }>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
ens(overrides?: CallOverrides): Promise<[string]>
feeManager(overrides?: CallOverrides): Promise<[string]>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[BigNumber]>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[string]>
governance(overrides?: CallOverrides): Promise<[string]>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[boolean]>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[boolean]>
minStakeAmount(overrides?: CallOverrides): Promise<[BigNumber]>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
relayers(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber, string] & { balance: BigNumber; ensHash: string }>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<[string]>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
staking(overrides?: CallOverrides): Promise<[string]>
torn(overrides?: CallOverrides): Promise<[string]>
tornadoRouter(overrides?: CallOverrides): Promise<[string]>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[string]>
}
bulkResolve(domains: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<string[]>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
ens(overrides?: CallOverrides): Promise<string>
feeManager(overrides?: CallOverrides): Promise<string>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
governance(overrides?: CallOverrides): Promise<string>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<boolean>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<boolean>
minStakeAmount(overrides?: CallOverrides): Promise<BigNumber>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
relayers(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber, string] & { balance: BigNumber; ensHash: string }>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<string>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
staking(overrides?: CallOverrides): Promise<string>
torn(overrides?: CallOverrides): Promise<string>
tornadoRouter(overrides?: CallOverrides): Promise<string>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
callStatic: {
bulkResolve(domains: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<string[]>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>
ens(overrides?: CallOverrides): Promise<string>
feeManager(overrides?: CallOverrides): Promise<string>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
governance(overrides?: CallOverrides): Promise<string>
initialize(_tornadoRouter: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<void>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<boolean>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<boolean>
minStakeAmount(overrides?: CallOverrides): Promise<BigNumber>
nullifyBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<void>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: CallOverrides
): Promise<void>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<void>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>
relayers(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber, string] & { balance: BigNumber; ensHash: string }>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<string>
setMinStakeAmount(minAmount: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<void>
setTornadoRouter(tornadoRouterAddress: PromiseOrValue<string>, overrides?: CallOverrides): Promise<void>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<void>
staking(overrides?: CallOverrides): Promise<string>
torn(overrides?: CallOverrides): Promise<string>
tornadoRouter(overrides?: CallOverrides): Promise<string>
unregisterWorker(worker: PromiseOrValue<string>, overrides?: CallOverrides): Promise<void>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
}
filters: {
'MinimumStakeAmount(uint256)'(minStakeAmount?: null): MinimumStakeAmountEventFilter
MinimumStakeAmount(minStakeAmount?: null): MinimumStakeAmountEventFilter
'RelayerBalanceNullified(address)'(relayer?: null): RelayerBalanceNullifiedEventFilter
RelayerBalanceNullified(relayer?: null): RelayerBalanceNullifiedEventFilter
'RelayerRegistered(bytes32,string,address,uint256)'(
relayer?: null,
ensName?: null,
relayerAddress?: null,
stakedAmount?: null
): RelayerRegisteredEventFilter
RelayerRegistered(
relayer?: null,
ensName?: null,
relayerAddress?: null,
stakedAmount?: null
): RelayerRegisteredEventFilter
'RouterRegistered(address)'(tornadoRouter?: null): RouterRegisteredEventFilter
RouterRegistered(tornadoRouter?: null): RouterRegisteredEventFilter
'StakeAddedToRelayer(address,uint256)'(
relayer?: null,
amountStakeAdded?: null
): StakeAddedToRelayerEventFilter
StakeAddedToRelayer(relayer?: null, amountStakeAdded?: null): StakeAddedToRelayerEventFilter
'StakeBurned(address,uint256)'(relayer?: null, amountBurned?: null): StakeBurnedEventFilter
StakeBurned(relayer?: null, amountBurned?: null): StakeBurnedEventFilter
'WorkerRegistered(address,address)'(relayer?: null, worker?: null): WorkerRegisteredEventFilter
WorkerRegistered(relayer?: null, worker?: null): WorkerRegisteredEventFilter
'WorkerUnregistered(address,address)'(relayer?: null, worker?: null): WorkerUnregisteredEventFilter
WorkerUnregistered(relayer?: null, worker?: null): WorkerUnregisteredEventFilter
}
estimateGas: {
bulkResolve(domains: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<BigNumber>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
ens(overrides?: CallOverrides): Promise<BigNumber>
feeManager(overrides?: CallOverrides): Promise<BigNumber>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
governance(overrides?: CallOverrides): Promise<BigNumber>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>
minStakeAmount(overrides?: CallOverrides): Promise<BigNumber>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
relayers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<BigNumber>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
staking(overrides?: CallOverrides): Promise<BigNumber>
torn(overrides?: CallOverrides): Promise<BigNumber>
tornadoRouter(overrides?: CallOverrides): Promise<BigNumber>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
}
populateTransaction: {
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<PopulatedTransaction>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
ens(overrides?: CallOverrides): Promise<PopulatedTransaction>
feeManager(overrides?: CallOverrides): Promise<PopulatedTransaction>
getRelayerBalance(
relayer: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>
getRelayerEnsHash(
relayer: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>
governance(overrides?: CallOverrides): Promise<PopulatedTransaction>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>
minStakeAmount(overrides?: CallOverrides): Promise<PopulatedTransaction>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
relayers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<PopulatedTransaction>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
staking(overrides?: CallOverrides): Promise<PopulatedTransaction>
torn(overrides?: CallOverrides): Promise<PopulatedTransaction>
tornadoRouter(overrides?: CallOverrides): Promise<PopulatedTransaction>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>
}
}

View File

@ -0,0 +1,875 @@
/* 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 RelayerRegistryAbiInterface extends utils.Interface {
functions: {
'bulkResolve(bytes32[])': FunctionFragment
'burn(address,address,address)': FunctionFragment
'ens()': FunctionFragment
'feeManager()': FunctionFragment
'getRelayerBalance(address)': FunctionFragment
'getRelayerEnsHash(address)': FunctionFragment
'governance()': FunctionFragment
'initialize(bytes32)': FunctionFragment
'isRelayer(address)': FunctionFragment
'isRelayerRegistered(address,address)': FunctionFragment
'minStakeAmount()': FunctionFragment
'nullifyBalance(address)': FunctionFragment
'register(string,uint256,address[])': FunctionFragment
'registerPermit(string,uint256,address[],address,uint256,uint8,bytes32,bytes32)': FunctionFragment
'registerWorker(address,address)': FunctionFragment
'relayers(address)': FunctionFragment
'resolve(bytes32)': FunctionFragment
'setMinStakeAmount(uint256)': FunctionFragment
'setTornadoRouter(address)': FunctionFragment
'stakeToRelayer(address,uint256)': FunctionFragment
'stakeToRelayerPermit(address,uint256,address,uint256,uint8,bytes32,bytes32)': FunctionFragment
'staking()': FunctionFragment
'torn()': FunctionFragment
'tornadoRouter()': FunctionFragment
'unregisterWorker(address)': FunctionFragment
'workers(address)': FunctionFragment
}
getFunction(
nameOrSignatureOrTopic:
| 'bulkResolve'
| 'burn'
| 'ens'
| 'feeManager'
| 'getRelayerBalance'
| 'getRelayerEnsHash'
| 'governance'
| 'initialize'
| 'isRelayer'
| 'isRelayerRegistered'
| 'minStakeAmount'
| 'nullifyBalance'
| 'register'
| 'registerPermit'
| 'registerWorker'
| 'relayers'
| 'resolve'
| 'setMinStakeAmount'
| 'setTornadoRouter'
| 'stakeToRelayer'
| 'stakeToRelayerPermit'
| 'staking'
| 'torn'
| 'tornadoRouter'
| 'unregisterWorker'
| 'workers'
): FunctionFragment
encodeFunctionData(functionFragment: 'bulkResolve', values: [PromiseOrValue<BytesLike>[]]): string
encodeFunctionData(
functionFragment: 'burn',
values: [PromiseOrValue<string>, PromiseOrValue<string>, PromiseOrValue<string>]
): string
encodeFunctionData(functionFragment: 'ens', values?: undefined): string
encodeFunctionData(functionFragment: 'feeManager', values?: undefined): string
encodeFunctionData(functionFragment: 'getRelayerBalance', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'getRelayerEnsHash', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'governance', values?: undefined): string
encodeFunctionData(functionFragment: 'initialize', values: [PromiseOrValue<BytesLike>]): string
encodeFunctionData(functionFragment: 'isRelayer', values: [PromiseOrValue<string>]): string
encodeFunctionData(
functionFragment: 'isRelayerRegistered',
values: [PromiseOrValue<string>, PromiseOrValue<string>]
): string
encodeFunctionData(functionFragment: 'minStakeAmount', values?: undefined): string
encodeFunctionData(functionFragment: 'nullifyBalance', values: [PromiseOrValue<string>]): string
encodeFunctionData(
functionFragment: 'register',
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>, PromiseOrValue<string>[]]
): string
encodeFunctionData(
functionFragment: 'registerPermit',
values: [
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<string>[],
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>
]
): string
encodeFunctionData(
functionFragment: 'registerWorker',
values: [PromiseOrValue<string>, PromiseOrValue<string>]
): string
encodeFunctionData(functionFragment: 'relayers', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'resolve', values: [PromiseOrValue<BytesLike>]): string
encodeFunctionData(functionFragment: 'setMinStakeAmount', values: [PromiseOrValue<BigNumberish>]): string
encodeFunctionData(functionFragment: 'setTornadoRouter', values: [PromiseOrValue<string>]): string
encodeFunctionData(
functionFragment: 'stakeToRelayer',
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string
encodeFunctionData(
functionFragment: 'stakeToRelayerPermit',
values: [
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>
]
): string
encodeFunctionData(functionFragment: 'staking', values?: undefined): string
encodeFunctionData(functionFragment: 'torn', values?: undefined): string
encodeFunctionData(functionFragment: 'tornadoRouter', values?: undefined): string
encodeFunctionData(functionFragment: 'unregisterWorker', values: [PromiseOrValue<string>]): string
encodeFunctionData(functionFragment: 'workers', values: [PromiseOrValue<string>]): string
decodeFunctionResult(functionFragment: 'bulkResolve', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'feeManager', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'getRelayerBalance', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'getRelayerEnsHash', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'governance', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'initialize', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'isRelayer', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'isRelayerRegistered', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'minStakeAmount', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'nullifyBalance', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'register', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'registerPermit', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'registerWorker', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'relayers', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'resolve', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'setMinStakeAmount', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'setTornadoRouter', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'stakeToRelayer', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'stakeToRelayerPermit', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'staking', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'torn', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'tornadoRouter', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'unregisterWorker', data: BytesLike): Result
decodeFunctionResult(functionFragment: 'workers', data: BytesLike): Result
events: {
'MinimumStakeAmount(uint256)': EventFragment
'RelayerBalanceNullified(address)': EventFragment
'RelayerRegistered(bytes32,string,address,uint256)': EventFragment
'RouterRegistered(address)': EventFragment
'StakeAddedToRelayer(address,uint256)': EventFragment
'StakeBurned(address,uint256)': EventFragment
'WorkerRegistered(address,address)': EventFragment
'WorkerUnregistered(address,address)': EventFragment
}
getEvent(nameOrSignatureOrTopic: 'MinimumStakeAmount'): EventFragment
getEvent(nameOrSignatureOrTopic: 'RelayerBalanceNullified'): EventFragment
getEvent(nameOrSignatureOrTopic: 'RelayerRegistered'): EventFragment
getEvent(nameOrSignatureOrTopic: 'RouterRegistered'): EventFragment
getEvent(nameOrSignatureOrTopic: 'StakeAddedToRelayer'): EventFragment
getEvent(nameOrSignatureOrTopic: 'StakeBurned'): EventFragment
getEvent(nameOrSignatureOrTopic: 'WorkerRegistered'): EventFragment
getEvent(nameOrSignatureOrTopic: 'WorkerUnregistered'): EventFragment
}
export interface MinimumStakeAmountEventObject {
minStakeAmount: BigNumber
}
export type MinimumStakeAmountEvent = TypedEvent<[BigNumber], MinimumStakeAmountEventObject>
export type MinimumStakeAmountEventFilter = TypedEventFilter<MinimumStakeAmountEvent>
export interface RelayerBalanceNullifiedEventObject {
relayer: string
}
export type RelayerBalanceNullifiedEvent = TypedEvent<[string], RelayerBalanceNullifiedEventObject>
export type RelayerBalanceNullifiedEventFilter = TypedEventFilter<RelayerBalanceNullifiedEvent>
export interface RelayerRegisteredEventObject {
relayer: string
ensName: string
relayerAddress: string
stakedAmount: BigNumber
}
export type RelayerRegisteredEvent = TypedEvent<
[string, string, string, BigNumber],
RelayerRegisteredEventObject
>
export type RelayerRegisteredEventFilter = TypedEventFilter<RelayerRegisteredEvent>
export interface RouterRegisteredEventObject {
tornadoRouter: string
}
export type RouterRegisteredEvent = TypedEvent<[string], RouterRegisteredEventObject>
export type RouterRegisteredEventFilter = TypedEventFilter<RouterRegisteredEvent>
export interface StakeAddedToRelayerEventObject {
relayer: string
amountStakeAdded: BigNumber
}
export type StakeAddedToRelayerEvent = TypedEvent<[string, BigNumber], StakeAddedToRelayerEventObject>
export type StakeAddedToRelayerEventFilter = TypedEventFilter<StakeAddedToRelayerEvent>
export interface StakeBurnedEventObject {
relayer: string
amountBurned: BigNumber
}
export type StakeBurnedEvent = TypedEvent<[string, BigNumber], StakeBurnedEventObject>
export type StakeBurnedEventFilter = TypedEventFilter<StakeBurnedEvent>
export interface WorkerRegisteredEventObject {
relayer: string
worker: string
}
export type WorkerRegisteredEvent = TypedEvent<[string, string], WorkerRegisteredEventObject>
export type WorkerRegisteredEventFilter = TypedEventFilter<WorkerRegisteredEvent>
export interface WorkerUnregisteredEventObject {
relayer: string
worker: string
}
export type WorkerUnregisteredEvent = TypedEvent<[string, string], WorkerUnregisteredEventObject>
export type WorkerUnregisteredEventFilter = TypedEventFilter<WorkerUnregisteredEvent>
export interface RelayerRegistryAbi extends BaseContract {
contractName: 'RelayerRegistryAbi'
connect(signerOrProvider: Signer | Provider | string): this
attach(addressOrName: string): this
deployed(): Promise<this>
interface: RelayerRegistryAbiInterface
queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>
listeners(eventName?: string): Array<Listener>
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this
removeAllListeners(eventName?: string): this
off: OnEvent<this>
on: OnEvent<this>
once: OnEvent<this>
removeListener: OnEvent<this>
functions: {
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<[string[]] & { result: string[] }>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
ens(overrides?: CallOverrides): Promise<[string]>
feeManager(overrides?: CallOverrides): Promise<[string]>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[BigNumber]>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[string]>
governance(overrides?: CallOverrides): Promise<[string]>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[boolean]>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[boolean]>
minStakeAmount(overrides?: CallOverrides): Promise<[BigNumber]>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
relayers(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber, string] & { balance: BigNumber; ensHash: string }>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<[string]>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
staking(overrides?: CallOverrides): Promise<[string]>
torn(overrides?: CallOverrides): Promise<[string]>
tornadoRouter(overrides?: CallOverrides): Promise<[string]>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<[string]>
}
bulkResolve(domains: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<string[]>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
ens(overrides?: CallOverrides): Promise<string>
feeManager(overrides?: CallOverrides): Promise<string>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
governance(overrides?: CallOverrides): Promise<string>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<boolean>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<boolean>
minStakeAmount(overrides?: CallOverrides): Promise<BigNumber>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
relayers(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber, string] & { balance: BigNumber; ensHash: string }>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<string>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
staking(overrides?: CallOverrides): Promise<string>
torn(overrides?: CallOverrides): Promise<string>
tornadoRouter(overrides?: CallOverrides): Promise<string>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
callStatic: {
bulkResolve(domains: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<string[]>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>
ens(overrides?: CallOverrides): Promise<string>
feeManager(overrides?: CallOverrides): Promise<string>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
governance(overrides?: CallOverrides): Promise<string>
initialize(_tornadoRouter: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<void>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<boolean>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<boolean>
minStakeAmount(overrides?: CallOverrides): Promise<BigNumber>
nullifyBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<void>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: CallOverrides
): Promise<void>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<void>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>
relayers(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber, string] & { balance: BigNumber; ensHash: string }>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<string>
setMinStakeAmount(minAmount: PromiseOrValue<BigNumberish>, overrides?: CallOverrides): Promise<void>
setTornadoRouter(tornadoRouterAddress: PromiseOrValue<string>, overrides?: CallOverrides): Promise<void>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<void>
staking(overrides?: CallOverrides): Promise<string>
torn(overrides?: CallOverrides): Promise<string>
tornadoRouter(overrides?: CallOverrides): Promise<string>
unregisterWorker(worker: PromiseOrValue<string>, overrides?: CallOverrides): Promise<void>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<string>
}
filters: {
'MinimumStakeAmount(uint256)'(minStakeAmount?: null): MinimumStakeAmountEventFilter
MinimumStakeAmount(minStakeAmount?: null): MinimumStakeAmountEventFilter
'RelayerBalanceNullified(address)'(relayer?: null): RelayerBalanceNullifiedEventFilter
RelayerBalanceNullified(relayer?: null): RelayerBalanceNullifiedEventFilter
'RelayerRegistered(bytes32,string,address,uint256)'(
relayer?: null,
ensName?: null,
relayerAddress?: null,
stakedAmount?: null
): RelayerRegisteredEventFilter
RelayerRegistered(
relayer?: null,
ensName?: null,
relayerAddress?: null,
stakedAmount?: null
): RelayerRegisteredEventFilter
'RouterRegistered(address)'(tornadoRouter?: null): RouterRegisteredEventFilter
RouterRegistered(tornadoRouter?: null): RouterRegisteredEventFilter
'StakeAddedToRelayer(address,uint256)'(
relayer?: null,
amountStakeAdded?: null
): StakeAddedToRelayerEventFilter
StakeAddedToRelayer(relayer?: null, amountStakeAdded?: null): StakeAddedToRelayerEventFilter
'StakeBurned(address,uint256)'(relayer?: null, amountBurned?: null): StakeBurnedEventFilter
StakeBurned(relayer?: null, amountBurned?: null): StakeBurnedEventFilter
'WorkerRegistered(address,address)'(relayer?: null, worker?: null): WorkerRegisteredEventFilter
WorkerRegistered(relayer?: null, worker?: null): WorkerRegisteredEventFilter
'WorkerUnregistered(address,address)'(relayer?: null, worker?: null): WorkerUnregisteredEventFilter
WorkerUnregistered(relayer?: null, worker?: null): WorkerUnregisteredEventFilter
}
estimateGas: {
bulkResolve(domains: PromiseOrValue<BytesLike>[], overrides?: CallOverrides): Promise<BigNumber>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
ens(overrides?: CallOverrides): Promise<BigNumber>
feeManager(overrides?: CallOverrides): Promise<BigNumber>
getRelayerBalance(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
getRelayerEnsHash(relayer: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
governance(overrides?: CallOverrides): Promise<BigNumber>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>
minStakeAmount(overrides?: CallOverrides): Promise<BigNumber>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
relayers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<BigNumber>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
staking(overrides?: CallOverrides): Promise<BigNumber>
torn(overrides?: CallOverrides): Promise<BigNumber>
tornadoRouter(overrides?: CallOverrides): Promise<BigNumber>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<BigNumber>
}
populateTransaction: {
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<PopulatedTransaction>
burn(
sender: PromiseOrValue<string>,
relayer: PromiseOrValue<string>,
pool: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
ens(overrides?: CallOverrides): Promise<PopulatedTransaction>
feeManager(overrides?: CallOverrides): Promise<PopulatedTransaction>
getRelayerBalance(
relayer: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>
getRelayerEnsHash(
relayer: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>
governance(overrides?: CallOverrides): Promise<PopulatedTransaction>
initialize(
_tornadoRouter: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
isRelayer(toResolve: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>
isRelayerRegistered(
relayer: PromiseOrValue<string>,
toResolve: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>
minStakeAmount(overrides?: CallOverrides): Promise<PopulatedTransaction>
nullifyBalance(
relayer: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
register(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
registerPermit(
ensName: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
workersToRegister: PromiseOrValue<string>[],
relayer: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
registerWorker(
relayer: PromiseOrValue<string>,
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
relayers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>
resolve(node: PromiseOrValue<BytesLike>, overrides?: CallOverrides): Promise<PopulatedTransaction>
setMinStakeAmount(
minAmount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
setTornadoRouter(
tornadoRouterAddress: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
stakeToRelayer(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
stakeToRelayerPermit(
relayer: PromiseOrValue<string>,
stake: PromiseOrValue<BigNumberish>,
staker: PromiseOrValue<string>,
deadline: PromiseOrValue<BigNumberish>,
v: PromiseOrValue<BigNumberish>,
r: PromiseOrValue<BytesLike>,
s: PromiseOrValue<BytesLike>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
staking(overrides?: CallOverrides): Promise<PopulatedTransaction>
torn(overrides?: CallOverrides): Promise<PopulatedTransaction>
tornadoRouter(overrides?: CallOverrides): Promise<PopulatedTransaction>
unregisterWorker(
worker: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>
workers(arg0: PromiseOrValue<string>, overrides?: CallOverrides): Promise<PopulatedTransaction>
}
}

View File

@ -0,0 +1,688 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from 'ethers'
import type { Provider } from '@ethersproject/providers'
import type { RelayerRegistryAbi, RelayerRegistryAbiInterface } from '../RelayerRegistryAbi'
const _abi = [
{
inputs: [
{
internalType: 'address',
name: '_torn',
type: 'address'
},
{
internalType: 'address',
name: '_governance',
type: 'address'
},
{
internalType: 'address',
name: '_ens',
type: 'address'
},
{
internalType: 'bytes32',
name: '_staking',
type: 'bytes32'
},
{
internalType: 'bytes32',
name: '_feeManager',
type: 'bytes32'
}
],
stateMutability: 'nonpayable',
type: 'constructor'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'uint256',
name: 'minStakeAmount',
type: 'uint256'
}
],
name: 'MinimumStakeAmount',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'address',
name: 'relayer',
type: 'address'
}
],
name: 'RelayerBalanceNullified',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'bytes32',
name: 'relayer',
type: 'bytes32'
},
{
indexed: false,
internalType: 'string',
name: 'ensName',
type: 'string'
},
{
indexed: false,
internalType: 'address',
name: 'relayerAddress',
type: 'address'
},
{
indexed: false,
internalType: 'uint256',
name: 'stakedAmount',
type: 'uint256'
}
],
name: 'RelayerRegistered',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'address',
name: 'tornadoRouter',
type: 'address'
}
],
name: 'RouterRegistered',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
indexed: false,
internalType: 'uint256',
name: 'amountStakeAdded',
type: 'uint256'
}
],
name: 'StakeAddedToRelayer',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
indexed: false,
internalType: 'uint256',
name: 'amountBurned',
type: 'uint256'
}
],
name: 'StakeBurned',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
indexed: false,
internalType: 'address',
name: 'worker',
type: 'address'
}
],
name: 'WorkerRegistered',
type: 'event'
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
indexed: false,
internalType: 'address',
name: 'worker',
type: 'address'
}
],
name: 'WorkerUnregistered',
type: 'event'
},
{
inputs: [
{
internalType: 'bytes32[]',
name: 'domains',
type: 'bytes32[]'
}
],
name: 'bulkResolve',
outputs: [
{
internalType: 'address[]',
name: 'result',
type: 'address[]'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'sender',
type: 'address'
},
{
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
internalType: 'contract ITornadoInstance',
name: 'pool',
type: 'address'
}
],
name: 'burn',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [],
name: 'ens',
outputs: [
{
internalType: 'contract IENS',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [],
name: 'feeManager',
outputs: [
{
internalType: 'contract FeeManager',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
}
],
name: 'getRelayerBalance',
outputs: [
{
internalType: 'uint256',
name: '',
type: 'uint256'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
}
],
name: 'getRelayerEnsHash',
outputs: [
{
internalType: 'bytes32',
name: '',
type: 'bytes32'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [],
name: 'governance',
outputs: [
{
internalType: 'address',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'bytes32',
name: '_tornadoRouter',
type: 'bytes32'
}
],
name: 'initialize',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'toResolve',
type: 'address'
}
],
name: 'isRelayer',
outputs: [
{
internalType: 'bool',
name: '',
type: 'bool'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
internalType: 'address',
name: 'toResolve',
type: 'address'
}
],
name: 'isRelayerRegistered',
outputs: [
{
internalType: 'bool',
name: '',
type: 'bool'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [],
name: 'minStakeAmount',
outputs: [
{
internalType: 'uint256',
name: '',
type: 'uint256'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
}
],
name: 'nullifyBalance',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'string',
name: 'ensName',
type: 'string'
},
{
internalType: 'uint256',
name: 'stake',
type: 'uint256'
},
{
internalType: 'address[]',
name: 'workersToRegister',
type: 'address[]'
}
],
name: 'register',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'string',
name: 'ensName',
type: 'string'
},
{
internalType: 'uint256',
name: 'stake',
type: 'uint256'
},
{
internalType: 'address[]',
name: 'workersToRegister',
type: 'address[]'
},
{
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
internalType: 'uint256',
name: 'deadline',
type: 'uint256'
},
{
internalType: 'uint8',
name: 'v',
type: 'uint8'
},
{
internalType: 'bytes32',
name: 'r',
type: 'bytes32'
},
{
internalType: 'bytes32',
name: 's',
type: 'bytes32'
}
],
name: 'registerPermit',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
internalType: 'address',
name: 'worker',
type: 'address'
}
],
name: 'registerWorker',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: '',
type: 'address'
}
],
name: 'relayers',
outputs: [
{
internalType: 'uint256',
name: 'balance',
type: 'uint256'
},
{
internalType: 'bytes32',
name: 'ensHash',
type: 'bytes32'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'bytes32',
name: 'node',
type: 'bytes32'
}
],
name: 'resolve',
outputs: [
{
internalType: 'address',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'uint256',
name: 'minAmount',
type: 'uint256'
}
],
name: 'setMinStakeAmount',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'tornadoRouterAddress',
type: 'address'
}
],
name: 'setTornadoRouter',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
internalType: 'uint256',
name: 'stake',
type: 'uint256'
}
],
name: 'stakeToRelayer',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'relayer',
type: 'address'
},
{
internalType: 'uint256',
name: 'stake',
type: 'uint256'
},
{
internalType: 'address',
name: 'staker',
type: 'address'
},
{
internalType: 'uint256',
name: 'deadline',
type: 'uint256'
},
{
internalType: 'uint8',
name: 'v',
type: 'uint8'
},
{
internalType: 'bytes32',
name: 'r',
type: 'bytes32'
},
{
internalType: 'bytes32',
name: 's',
type: 'bytes32'
}
],
name: 'stakeToRelayerPermit',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [],
name: 'staking',
outputs: [
{
internalType: 'contract ITornadoStakingRewards',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [],
name: 'torn',
outputs: [
{
internalType: 'contract TORN',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [],
name: 'tornadoRouter',
outputs: [
{
internalType: 'address',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: 'worker',
type: 'address'
}
],
name: 'unregisterWorker',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'address',
name: '',
type: 'address'
}
],
name: 'workers',
outputs: [
{
internalType: 'address',
name: '',
type: 'address'
}
],
stateMutability: 'view',
type: 'function'
}
] as const
export class RelayerRegistryAbi__factory {
static readonly abi = _abi
static createInterface(): RelayerRegistryAbiInterface {
return new utils.Interface(_abi) as RelayerRegistryAbiInterface
}
static connect(address: string, signerOrProvider: Signer | Provider): RelayerRegistryAbi {
return new Contract(address, _abi, signerOrProvider) as RelayerRegistryAbi
}
}

File diff suppressed because one or more lines are too long

View File

@ -7,5 +7,6 @@ export { ERC20Tornado__factory } from './ERC20Tornado__factory'
export { ETHTornado__factory } from './ETHTornado__factory'
export { Multicall3Contract__factory } from './Multicall3Contract__factory'
export { MulticallContract__factory } from './MulticallContract__factory'
export { RelayerRegistry__factory } from './RelayerRegistry__factory'
export { TornadoInstance__factory } from './TornadoInstance__factory'
export { TornadoProxy__factory } from './TornadoProxy__factory'

View File

@ -7,6 +7,7 @@ export type { ERC20Tornado } from './ERC20Tornado'
export type { ETHTornado } from './ETHTornado'
export type { Multicall3Contract } from './Multicall3Contract'
export type { MulticallContract } from './MulticallContract'
export type { RelayerRegistry } from './RelayerRegistry'
export type { TornadoInstance } from './TornadoInstance'
export type { TornadoProxy } from './TornadoProxy'
export * as factories from './factories'
@ -16,5 +17,6 @@ export { ERC20Tornado__factory } from './factories/ERC20Tornado__factory'
export { ETHTornado__factory } from './factories/ETHTornado__factory'
export { Multicall3Contract__factory } from './factories/Multicall3Contract__factory'
export { MulticallContract__factory } from './factories/MulticallContract__factory'
export { RelayerRegistry__factory } from './factories/RelayerRegistry__factory'
export { TornadoInstance__factory } from './factories/TornadoInstance__factory'
export { TornadoProxy__factory } from './factories/TornadoProxy__factory'

View File

@ -1,5 +1,5 @@
// ts-essentials
import { DeepRequired, MarkOptional } from 'ts-essentials'
import { DeepRequired, MarkOptional, Merge } from 'ts-essentials'
// Local types
import { TornadoInstance, TornadoProxy } from './deth'
@ -20,10 +20,10 @@ import { parseIndexableString } from 'pouchdb-collate'
// Local imports
import { Primitives } from '@tornado/sdk-crypto'
import { ErrorUtils, ObjectUtils, AsyncUtils } from '@tornado/sdk-utils'
import { Docs, Cache, Keys, Constants, Onchain } from '@tornado/sdk-data'
import { Contracts, Chain, Synchronizer, Options as ChainOptions } from '@tornado/sdk-chain'
import { Docs, Cache, Keys, Constants, Onchain, Options as DataOptions } from '@tornado/sdk-data'
import { Contracts, Chain, Synchronizer, Options as ChainOptions, syncErrorHandler } from '@tornado/sdk-chain'
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECLARATIONS (MUST BE INLINED) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECLARATIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export namespace Options {
export namespace Core {
@ -46,6 +46,7 @@ export namespace Options {
}
export type Sync = ChainOptions.Sync
export type Cache = DataOptions.Cache
}
export namespace Transactions {
@ -59,38 +60,13 @@ export namespace Transactions {
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOR SYNCHRONIZATION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function tornadoSyncErrorHandler(
err: Error,
numResolvedPromises: number,
callbackIndex: number,
orderIndex: number,
...args: any[]
): void {
err = ErrorUtils.ensureError<Error>(err)
if (err.message.match('context deadline exceeded'))
console.error(
ErrorUtils.getError(
`Context deadline exceeded, stop if more promises do not resolve. Resolved: ${numResolvedPromises}`
)
)
else if (err.message.match('Invalid JSON RPC'))
console.error(
ErrorUtils.getError(`Endpoint returned invalid value (we might be rate limited), retrying.`)
)
else {
err.message += `\nCallback args supplied: [${args.join(', ')}]\n`
throw err
}
}
export class DepositCache extends Cache.Syncable<Docs.Deposit> {
buildDoc(response: any): Docs.Deposit {
return new Docs.Deposit(response)
}
getErrorHandlers(): Array<AsyncUtils.ErrorHandler> {
return [tornadoSyncErrorHandler]
return [syncErrorHandler]
}
getCallbacks(instance: TornadoInstance): Array<AsyncUtils.Callback> {
@ -108,7 +84,7 @@ export class WithdrawalCache extends Cache.Syncable<Docs.Withdrawal> {
}
getErrorHandlers(): Array<AsyncUtils.ErrorHandler> {
return [tornadoSyncErrorHandler]
return [syncErrorHandler]
}
getCallbacks(instance: TornadoInstance): Array<AsyncUtils.Callback> {
@ -133,8 +109,6 @@ export class Core extends Synchronizer {
private _mutex: AsyncUtils.SimpleMutex
private _chain?: Chain
caches: Map<string, Cache.Base<Docs.Base>>
get chain(): Chain {
this._checkProvider('chain')
return this._chain!
@ -142,7 +116,6 @@ export class Core extends Synchronizer {
constructor() {
super()
this.caches = new Map<string, Cache.Syncable<Docs.Base>>()
this._mutex = new AsyncUtils.SimpleMutex()
}
@ -643,34 +616,24 @@ export class Core extends Synchronizer {
}
async backupNotes(instance: TornadoInstance, transactions: Array<Transactions.Deposit>): Promise<void> {
const { network, token, denomination } = await Onchain.getInstanceLookupKeys(instance.address)
await this._backupDepositData(
network,
token,
denomination,
transactions,
this.loadCache<Docs.Note>('DepositNotes')
)
await this._backupDepositData(instance.address, transactions, this.loadCache<Docs.Note>('DepositNotes'))
}
async backupInvoices(instance: TornadoInstance, transactions: Array<Transactions.Deposit>): Promise<void> {
const { network, token, denomination } = await Onchain.getInstanceLookupKeys(instance.address)
await this._backupDepositData(
network,
token,
denomination,
instance.address,
transactions,
this.loadCache<Docs.Invoice>('DepositInvoices')
)
}
private async _backupDepositData<T extends Docs.Note | Docs.Invoice>(
network: string,
token: string,
denomination: string,
address: string,
transactions: Array<Transactions.Deposit>,
cache: Cache.Base<T>
): Promise<void> {
const { network, token, denomination } = await Onchain.getInstanceLookupKeys(address)
const notes = cache.name.length === 12 ? true : false
const name = notes ? 'notes' : 'invoices'
@ -700,46 +663,38 @@ export class Core extends Synchronizer {
if (close) this.caches.delete(cacheName)
}
loadDepositCache(name: string, options?: Options.Sync): DepositCache {
if (!this.caches.has(name)) {
this.caches.set(
name,
new DepositCache(
name,
options ? { adapter: options?.cacheAdapter, persistent: options?.persistentCache } : undefined
)
)
}
return this.caches.get(name) as DepositCache
loadDepositCache(name: string, options?: Options.Cache): DepositCache {
return this.loadCache<Docs.Deposit, DepositCache>(name, options)
}
loadWithdrawalCache(name: string, options?: Options.Sync): WithdrawalCache {
if (!this.caches.has(name)) {
this.caches.set(
name,
new WithdrawalCache(
name,
options ? { adapter: options?.cacheAdapter, persistent: options?.persistentCache } : undefined
)
)
}
return this.caches.get(name) as WithdrawalCache
loadWithdrawalCache(name: string, options?: Options.Cache): WithdrawalCache {
return this.loadCache<Docs.Withdrawal, WithdrawalCache>(name, options)
}
loadCache<D extends Docs.Base, C extends Cache.Base<D> = Cache.Base<D>>(
loadCache<D extends Docs.Base, C extends Cache.Syncable<D> = Cache.Syncable<D>>(
name: string,
options?: Options.Sync
options?: Options.Cache
): C {
if (!this.caches.has(name)) {
this.caches.set(
name,
new Cache.Base(
name,
options ? { adapter: options?.cacheAdapter, persistent: options?.persistentCache } : undefined
)
)
let constructor,
cache = super.loadCache(name)
if (!cache) {
const regexp = /([0-9]+)([A-Za-z]+)([0-9.]+)/
const matches = name.match(regexp)
if (!matches || matches.length !== 4)
throw ErrorUtils.getError(`Core.loadCache: name ${name} has wrong format for cache`)
if (matches[2] === 'Deposits') {
constructor = (name: string, options?: Options.Cache) => new DepositCache(name, options)
} else if (matches[2] === 'Withdrawals') {
constructor = (name: string, options?: Options.Cache) => new WithdrawalCache(name, options)
} else throw ErrorUtils.getError(`Core.loadCache: there exists no such event ${matches[2]}`)
cache = constructor(name, options)
this.caches.set(name, cache)
}
return this.caches.get(name) as C
return cache as C
}
loadInstance(chainId: number | string, token: string, denomination: number | string): TornadoInstance {
@ -747,69 +702,47 @@ export class Core extends Synchronizer {
return Contracts.getInstance('' + chainId, token, '' + denomination, this.chain.provider)
}
async syncDeposits(instance: TornadoInstance, options?: Options.Sync): Promise<void> {
this._checkProvider('syncDeposits')
async syncDeposits(instance: TornadoInstance, options?: Merge<Options.Sync, Options.Cache>): Promise<void> {
const { network, token, denomination } = await Onchain.getInstanceLookupKeys(instance.address)
const pathstring = network + token + denomination
options = options ?? {}
options.startBlock = await Onchain.getInstanceDeployBlockNum(network, token, denomination)
const populatedOptions = await this._populateSyncOptions(options)
const cache = this.loadDepositCache('Deposits' + pathstring.toUpperCase(), populatedOptions)
const cache = this.loadDepositCache('Deposits' + pathstring.toUpperCase(), {
cacheDirPath: options.cacheDirPath,
adapter: options.adapter,
persistent: options.persistent
})
await this.sync('deposit', instance.filters.Deposit(null, null, null), instance, cache, populatedOptions)
if (!this.caches.has(cache.name)) this.caches.set(cache.name, cache)
await this.sync('deposit', instance.filters.Deposit(null, null, null), instance, cache, options)
}
async syncWithdrawals(instance: TornadoInstance, options?: Options.Sync): Promise<void> {
this._checkProvider('syncWithdrawals')
async syncWithdrawals(
instance: TornadoInstance,
options?: Merge<Options.Sync, Options.Cache>
): Promise<void> {
const { network, token, denomination } = await Onchain.getInstanceLookupKeys(instance.address)
const pathstring = network + token + denomination
options = options ?? {}
options.startBlock = await Onchain.getInstanceDeployBlockNum(network, token, denomination)
const populatedOptions = await this._populateSyncOptions(options)
const cache = this.loadWithdrawalCache('Withdrawals' + pathstring.toUpperCase(), populatedOptions)
const cache = this.loadWithdrawalCache('Withdrawals' + pathstring.toUpperCase(), {
cacheDirPath: options.cacheDirPath,
adapter: options.adapter,
persistent: options.persistent
})
await this.sync(
'withdrawal',
instance.filters.Withdrawal(null, null, null),
instance,
cache,
populatedOptions
)
if (!this.caches.has(cache.name)) this.caches.set(cache.name, cache)
await this.sync('withdrawal', instance.filters.Withdrawal(null, null, null), instance, cache, options)
}
protected async _populateSyncOptions(options: Options.Sync): Promise<DeepRequired<Options.Sync>> {
if (!options.startBlock) throw ErrorUtils.getError('Core._populateSyncOptions: startBlock not set.')
options.targetBlock = options.targetBlock ?? (await this.chain.latestBlockNum())
options.blockDelta =
options.blockDelta ??
(options.blockDivisor
? Math.floor((options.targetBlock - options.startBlock) / options.blockDivisor)
: 10000)
options.concurrencyLimit = options.concurrencyLimit ?? 8
options.msTimeout = options.msTimeout ?? 200 // 5 requests per second
options.persistentCache = options.persistentCache ?? true
options.cacheAdapter = options.cacheAdapter ?? 'leveldb'
options.listenForEvents = options.listenForEvents ?? false
return options as DeepRequired<Options.Sync>
return super._populateSyncOptions(options)
}
}

View File

@ -1,6 +1,6 @@
ISC License
Copyright 2023 T-Hax
Copyright 2023 AlienTornadosaurusHex
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

View File

@ -1,11 +1,11 @@
{
"name": "@tornado/sdk-crypto",
"author": "T-Hax",
"author": "AlienTornadosaurusHex",
"license": "ISC",
"description": "Tornado SDK cryptographic primitives.",
"repository": {
"type": "git",
"url": "https://development.tornadocash.community/T-Hax/sdk-monorepo"
"url": "https://development.tornadocash.community/AlienTornadosaurusHex/sdk-monorepo"
},
"homepage": "https://tornadocash.community",
"keywords": [

View File

@ -169,6 +169,10 @@ export namespace Setup {
}
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Primitives ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* These are the important cryptographic primitives Tornado Cash uses.
*/
export namespace Primitives {
export function calcPedersenHash(pedersenHashData: InputFor.PedersenHash): OutputOf.PedersenHash {
return circomlib.babyJub.unpackPoint(circomlib.pedersenHash.hash(pedersenHashData.msg))[0]

View File

@ -1,6 +1,6 @@
ISC License
Copyright 2023 T-Hax
Copyright 2023 AlienTornadosaurusHex
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

View File

@ -1,11 +1,11 @@
{
"name": "@tornado/sdk-data",
"author": "T-Hax",
"author": "AlienTornadosaurusHex",
"license": "ISC",
"description": "Tornado SDK data utilities.",
"repository": {
"type": "git",
"url": "https://development.tornadocash.community/T-Hax/sdk-monorepo"
"url": "https://development.tornadocash.community/AlienTornadosaurusHex/sdk-monorepo"
},
"homepage": "https://tornadocash.community",
"keywords": [

View File

@ -1,4 +1,5 @@
{
"1registry": 14173129,
"1eth0.1": 9116966,
"1eth1": 9117609,
"1eth10": 9117720,

View File

@ -1,6 +1,7 @@
{
"1": {
"proxy": "0xd90e2f925DA726b50C4Ed8D0Fb90Ad053324F31b",
"registry": "0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2",
"multicall": "0xeefBa1e63905eF1D7ACbA5a8513c70307C1cE441",
"multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11"
},

View File

@ -1,12 +0,0 @@
{
"1": {
"dai": {
"address": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"decimals": 18
},
"usdc": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"decimals": 6
}
}
}

View File

@ -2,8 +2,8 @@
import tar from 'tar'
// Fs
import { existsSync, mkdirSync, readFileSync } from 'fs'
import { opendir, readFile, rm } from 'fs/promises'
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs'
import { opendir, readFile, rm, writeFile } from 'fs/promises'
import { createInterface } from 'readline'
// Ethers
@ -100,6 +100,15 @@ export namespace Files {
export const loadRaw = (relative: string): Promise<Buffer> => readFile(getResourcePath(relative))
export const loadRawSync = (relative: string): Buffer => readFileSync(getResourcePath(relative))
export const writeRaw = (
relative: string,
data: string | NodeJS.ArrayBufferView,
flag: string
): Promise<void> => writeFile(getCachePath('', relative), data, { flag: flag })
export const writeRawSync = (relative: string, data: string | NodeJS.ArrayBufferView, flag: string): void =>
writeFileSync(getCachePath('', relative), data, { flag: flag })
export function gzipSync(fileOrDirPath: string, archivePath: string): void {
try {
const tokens = fileOrDirPath.split('/')
@ -371,6 +380,26 @@ export namespace Onchain {
return getInstanceAddressesSync([{ network: network, token: token, denomination: denomination }])[0]
}
export async function getRegistryAddress(network?: string): Promise<string> {
network = network ?? '1'
return Json.getValue(await Json.load('onchain/infrastructure.json'), [network, 'registry'])
}
export function getRegistryAddressSync(network?: string): string {
network = network ?? '1'
return Json.getValue(Json.loadSync('onchain/infrastructure.json'), [network, 'registry'])
}
export async function getRegistryDeployBlockNum(network?: string): Promise<number> {
network = network ?? '1'
return Json.getValue(await Json.load('onchain/deployedBlockNumbers.json'), [`${network}registry`])
}
export function getRegistryDeployBlockNumSync(network?: string): number {
network = network ?? '1'
return Json.getValue(Json.loadSync('onchain/deployedBlockNumbers.json'), [`${network}registry`])
}
export function getInstanceDeployBlockNums(
paths: Array<{
network: string
@ -433,24 +462,6 @@ export namespace Onchain {
return Json.getValue(Json.loadSync('onchain/infrastructure.json'), [network, 'multicall3'])
}
export async function getTokenData(network: string, token: string): Promise<TokenData> {
const data = Json.getValue(await Json.load('onchain/tokens.json'), [network, token])
return {
network: +network,
decimals: +data['decimals'],
address: data['address']
}
}
export function getTokenDataSync(network: string, token: string): TokenData {
const data = Json.getValue(Json.loadSync('onchain/tokens.json'), [network, token])
return {
network: +network,
decimals: +data['decimals'],
address: data['address']
}
}
export async function getTokenAddress(network: string, token: string): Promise<string> {
return (
await getPathstringBasedContent<string>('onchain/tokenAddresses.json', [
@ -709,6 +720,21 @@ export namespace Cache {
this.isOpen = !close
}
async jsonify(outDirPath?: string): Promise<void> {
const docs = (await this.getRows()).map((row) => {
row.doc!._rev = undefined
return row.doc
})
if (outDirPath) outDirPath = outDirPath[outDirPath.length - 1] !== '/' ? outDirPath + '/' : outDirPath
Files.writeRawSync(
(outDirPath ?? Files.parentPath(this._path)) + this.name,
JSON.stringify(docs, null, 2),
'w'
)
}
async get(keys: Array<any>): Promise<T> {
return await this.db.get(toIndexableString(keys)).catch((err) => {
throw ErrorUtils.ensureError(err)
@ -716,9 +742,7 @@ export namespace Cache {
}
async getRows(
emptyError: Error = ErrorUtils.getError(
`Core.loadCacheContents: there is no cache entry for ${this.name}`
),
emptyError: Error = ErrorUtils.getError(`Base.getRows: there is no cache entry for ${this.name}`),
options: RowsOptions = { include_docs: true, attachments: false }
): Promise<Rows<T>> {
const docs = await this.db.allDocs(options).catch((err) => {

View File

@ -0,0 +1,3 @@
dist
node_modules
package-log.json

View File

@ -0,0 +1,76 @@
{
"env": {
"es6": true,
"node": true,
"mocha": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier"
],
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module",
"project": "./tsconfig.json"
},
"ignorePatterns": [
".eslintrc.js",
"prettier.config.js"
],
"rules": {
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/type-annotation-spacing": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "none"
}
],
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/ban-types": "error",
"camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"no-array-constructor": "off",
"@typescript-eslint/no-array-constructor": "error",
"no-empty": "off",
"no-empty-function": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-this-alias": "error",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/no-floating-promises": [
"error"
],
"no-var": "error",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error"
},
"overrides": [
{
"files": [
"*.js"
],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
]
}

5
@tornado/sdk-registry/.gitattributes vendored Normal file
View File

@ -0,0 +1,5 @@
# Prevent eslintrc from appearing in GitHub language calculation
# (There seems to be no way to prevent language detection from
# falsely calling the CLI commands Javascript due to the shebang line)
.eslintrc.js linguist-documentation
prettier.config.js linguist-documentation

52
@tornado/sdk-registry/.gitignore vendored Normal file
View File

@ -0,0 +1,52 @@
# Custom
## Bash export gitea auth token
.gitea.env
## Personal project folders I'm using
cache
vanilla_cache
scripts
## We are NOT using Zero-Installs
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# Defaults
.env
## Logs
logs
*.log
npm-debug.log*
## Runtime data
pids
*.pid
*.seed
## Optional npm cache directory
.npm
## Optional REPL history
.node_repl_history
## Other defaults
typings/
node_modules
dist
sandbox
sand\ box
debug.log
yarn-error.log
*.map

View File

@ -0,0 +1,63 @@
# file handling
extension: [ "ts" ]
spec: ["src/**/*.test.ts"]
require: ["ts-node/register", "tsconfig-paths/register.js", "src/test/preload.ts"]
ignore: "src/test/utils.test.ts"
# # This is an example Mocha config containing every Mocha option plus others.
# allow-uncaught: false
# async-only: false
# bail: false
# check-leaks: false
# color: true
# delay: false
# diff: true
# exit: false # could be expressed as "no-exit: true"
# extension: ['js', 'cjs', 'mjs']
# fail-zero: true
# # fgrep and grep are mutually exclusive
# fgrep: 'something'
# file:
# - '/path/to/some/file'
# - '/path/to/some/other/file'
# forbid-only: false
# forbid-pending: false
# full-trace: false
# global:
# - 'jQuery'
# - '$'
# # fgrep and grep are mutually exclusive
# grep: '/something/i' # also 'something'
# growl: false
# ignore:
# - '/path/to/some/ignored/file'
# inline-diffs: false
# # needs to be used with grep or fgrep
# # invert: false
# jobs: 1
# node-option:
# - 'unhandled-rejections=strict' # without leading "--", also V8 flags
# package: './package.json'
# parallel: false
# recursive: false
# reporter: 'spec'
# reporter-option: # array, not object
# - 'foo=bar'
# - 'baz=quux'
# require: '@babel/register'
# retries: 1
# slow: '75'
# sort: false
# spec:
# - 'test/**/*.spec.js' # the positional arguments!
# timeout: '2000' # same as "timeout: '2s'"
# # timeout: false # same as "timeout: 0"
# trace-warnings: true # node flags ok
# ui: 'bdd'
# v8-stack-trace-limit: 100 # V8 flags are prepended with "v8-"
# watch: false
# watch-files:
# - 'lib/**/*.js'
# - 'test/**/*.js'
# watch-ignore:
# - 'lib/vendor'

View File

@ -0,0 +1,3 @@
dist
node_modules
package-log.json

View File

@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true,
"semi": false,
"printWidth": 110
}

View File

@ -0,0 +1,19 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
"recommendations": [
// For ESLint
"dbaeumer.vscode-eslint",
// For bleeding edge Typescript features
"ms-vscode.vscode-typescript-next",
// For better editing of the README and other markdown files
"yzhang.markdown-all-in-one",
// For auto-completes when typing out paths
"christian-kohler.path-intellisense",
// For auto-formatting
"esbenp.prettier-vscode",
// For support editing any YAML config or other files
"redhat.vscode-yaml",
"arcanis.vscode-zipfs"
],
"unwantedRecommendations": []
}

View File

@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Tests",
"preLaunchTask": "npm: build",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--require",
"source-map-support/register",
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/build/test/index.js"
],
"console": "internalConsole",
"internalConsoleOptions": "neverOpen",
"protocol": "inspector"
}
]
}

View File

@ -0,0 +1,32 @@
{
// Use the local version of Typescript
"typescript.tsdk": "../../.yarn/sdks/typescript/lib",
// ESM requires extensions on import paths to work,
// these options tell VSCode to prefer adding extensions
// on auto-import.
"typescript.preferences.importModuleSpecifierEnding": "js",
"javascript.preferences.importModuleSpecifierEnding": "js",
// Make sure ESLint runs on target files.
"eslint.validate": [
"javascript",
"typescript"
],
// Check JavaScript by default (using the Typescript engine)
"js/ts.implicitProjectConfig.checkJs": true,
// Auto-format an fix files
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
// Let VSCode auto-update import paths when you move files around
"typescript.updateImportsOnFileMove.enabled": "always",
"javascript.updateImportsOnFileMove.enabled": "always",
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": "../../.yarn/sdks",
"prettier.prettierPath": "../../.yarn/sdks/prettier/index.js",
"typescript.enablePromptUseWorkspaceTsdk": true
}

View File

@ -0,0 +1,7 @@
ISC License
Copyright 2023 AlienTornadosaurusHex
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -0,0 +1,74 @@
{
"name": "@tornado/sdk-registry",
"author": "AlienTornadosaurusHex",
"license": "ISC",
"description": "Tornado SDK general utilities.",
"repository": {
"type": "git",
"url": "https://development.tornadocash.community/AlienTornadosaurusHex/sdk-monorepo"
},
"homepage": "https://tornadocash.community",
"keywords": [
"ethereum",
"crypto",
"zk"
],
"version": "0.0.11-alpha",
"engines": {
"node": "^18"
},
"main": "./dist/index.js",
"files": [
"dist/**/*"
],
"dependencies": {
"@ethersproject/abi": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@tornado/sdk-chain": "workspace:*",
"@tornado/sdk-data": "workspace:*",
"@tornado/sdk-utils": "workspace:*",
"@tornado/sdk-web": "workspace:*",
"ethers": "^5",
"pouchdb-collate": "^8.0.1"
},
"devDependencies": {
"@types/big-integer": "^0.0.31",
"@types/chai": "^4.2.18",
"@types/fs-extra": "^11.0.1",
"@types/mocha": "^10.0.1",
"@types/node": "^18.15.0",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"chai": "^4.3.4",
"conventional-changelog-cli": "^2.1.1",
"dotenv": "^16.0.3",
"eslint": "^8.35.0",
"eslint-plugin-prettier": "^4.2.1",
"ethereum-waffle": "^4.0.10",
"fs-extra": "^11.1.0",
"mocha": "^10.2.0",
"prettier": "^2.3.0",
"rimraf": "^5.0.0",
"source-map-support": "^0.5.19",
"ts-essentials": "^9.3.1",
"ts-node": "^10.9.1",
"tsc-alias": "^1.2.11",
"tsconfig-paths": "^4.1.2",
"typescript": "^5.0.4"
},
"scripts": {
"build": "rimraf dist && tsc",
"format": "prettier src/*.ts -w",
"build-live": "rimraf dist && tsc -w",
"lint": "eslint --ext ts,js --fix src"
},
"publishConfig": {
"access": "public"
},
"dependenciesMeta": {
"tsconfig-paths@4.2.0": {
"unplugged": true
}
},
"stableVersion": "0.0.8-alpha"
}

View File

@ -0,0 +1,396 @@
/* 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 ERC20Interface extends utils.Interface {
functions: {
"totalSupply()": FunctionFragment;
"_totalSupply()": FunctionFragment;
"balanceOf(address)": FunctionFragment;
"transfer(address,uint256)": FunctionFragment;
"allowance(address,address)": FunctionFragment;
"transferFrom(address,address,uint256)": FunctionFragment;
"approve(address,uint256)": FunctionFragment;
"nonces(address)": FunctionFragment;
};
getFunction(
nameOrSignatureOrTopic:
| "totalSupply"
| "_totalSupply"
| "balanceOf"
| "transfer"
| "allowance"
| "transferFrom"
| "approve"
| "nonces"
): FunctionFragment;
encodeFunctionData(
functionFragment: "totalSupply",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "_totalSupply",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "balanceOf",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(
functionFragment: "transfer",
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "allowance",
values: [PromiseOrValue<string>, PromiseOrValue<string>]
): string;
encodeFunctionData(
functionFragment: "transferFrom",
values: [
PromiseOrValue<string>,
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>
]
): string;
encodeFunctionData(
functionFragment: "approve",
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "nonces",
values: [PromiseOrValue<string>]
): string;
decodeFunctionResult(
functionFragment: "totalSupply",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "_totalSupply",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "transferFrom",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result;
events: {
"Approval(address,address,uint256)": EventFragment;
"Transfer(address,address,uint256)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment;
}
export interface ApprovalEventObject {
owner: string;
spender: string;
value: BigNumber;
}
export type ApprovalEvent = TypedEvent<
[string, string, BigNumber],
ApprovalEventObject
>;
export type ApprovalEventFilter = TypedEventFilter<ApprovalEvent>;
export interface TransferEventObject {
from: string;
to: string;
value: BigNumber;
}
export type TransferEvent = TypedEvent<
[string, string, BigNumber],
TransferEventObject
>;
export type TransferEventFilter = TypedEventFilter<TransferEvent>;
export interface ERC20 extends BaseContract {
contractName: "ERC20";
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
interface: ERC20Interface;
queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>;
listeners<TEvent extends TypedEvent>(
eventFilter?: TypedEventFilter<TEvent>
): Array<TypedListener<TEvent>>;
listeners(eventName?: string): Array<Listener>;
removeAllListeners<TEvent extends TypedEvent>(
eventFilter: TypedEventFilter<TEvent>
): this;
removeAllListeners(eventName?: string): this;
off: OnEvent<this>;
on: OnEvent<this>;
once: OnEvent<this>;
removeListener: OnEvent<this>;
functions: {
totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>;
_totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>;
balanceOf(
who: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber]>;
transfer(
to: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
allowance(
owner: PromiseOrValue<string>,
spender: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber]>;
transferFrom(
from: PromiseOrValue<string>,
to: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
approve(
spender: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
nonces(
owner: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber]>;
};
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
_totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
balanceOf(
who: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
transfer(
to: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
allowance(
owner: PromiseOrValue<string>,
spender: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
transferFrom(
from: PromiseOrValue<string>,
to: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
approve(
spender: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
nonces(
owner: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
callStatic: {
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
_totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
balanceOf(
who: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
transfer(
to: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>;
allowance(
owner: PromiseOrValue<string>,
spender: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
transferFrom(
from: PromiseOrValue<string>,
to: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>;
approve(
spender: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>;
nonces(
owner: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
};
filters: {
"Approval(address,address,uint256)"(
owner?: PromiseOrValue<string> | null,
spender?: PromiseOrValue<string> | null,
value?: null
): ApprovalEventFilter;
Approval(
owner?: PromiseOrValue<string> | null,
spender?: PromiseOrValue<string> | null,
value?: null
): ApprovalEventFilter;
"Transfer(address,address,uint256)"(
from?: PromiseOrValue<string> | null,
to?: PromiseOrValue<string> | null,
value?: null
): TransferEventFilter;
Transfer(
from?: PromiseOrValue<string> | null,
to?: PromiseOrValue<string> | null,
value?: null
): TransferEventFilter;
};
estimateGas: {
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
_totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
balanceOf(
who: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
transfer(
to: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
allowance(
owner: PromiseOrValue<string>,
spender: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
transferFrom(
from: PromiseOrValue<string>,
to: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
approve(
spender: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
nonces(
owner: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
};
populateTransaction: {
totalSupply(overrides?: CallOverrides): Promise<PopulatedTransaction>;
_totalSupply(overrides?: CallOverrides): Promise<PopulatedTransaction>;
balanceOf(
who: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
transfer(
to: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
allowance(
owner: PromiseOrValue<string>,
spender: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
transferFrom(
from: PromiseOrValue<string>,
to: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
approve(
spender: PromiseOrValue<string>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
nonces(
owner: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
};
}

View File

@ -0,0 +1,807 @@
/* 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 ERC20MockInterface extends utils.Interface {
functions: {
"addMinter(address)": FunctionFragment;
"allowance(address,address)": FunctionFragment;
"approve(address,uint256)": FunctionFragment;
"balanceOf(address)": FunctionFragment;
"decimals()": FunctionFragment;
"decreaseAllowance(address,uint256)": FunctionFragment;
"increaseAllowance(address,uint256)": FunctionFragment;
"isMinter(address)": FunctionFragment;
"mint(address,uint256)": FunctionFragment;
"name()": FunctionFragment;
"renounceMinter()": FunctionFragment;
"symbol()": FunctionFragment;
"totalSupply()": FunctionFragment;
"transfer(address,uint256)": FunctionFragment;
"transferFrom(address,address,uint256)": FunctionFragment;
};
getFunction(
nameOrSignatureOrTopic:
| "addMinter"
| "allowance"
| "approve"
| "balanceOf"
| "decimals"
| "decreaseAllowance"
| "increaseAllowance"
| "isMinter"
| "mint"
| "name"
| "renounceMinter"
| "symbol"
| "totalSupply"
| "transfer"
| "transferFrom"
): FunctionFragment;
encodeFunctionData(
functionFragment: "addMinter",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(
functionFragment: "allowance",
values: [PromiseOrValue<string>, PromiseOrValue<string>]
): string;
encodeFunctionData(
functionFragment: "approve",
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "balanceOf",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(functionFragment: "decimals", values?: undefined): string;
encodeFunctionData(
functionFragment: "decreaseAllowance",
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "increaseAllowance",
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "isMinter",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(
functionFragment: "mint",
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(functionFragment: "name", values?: undefined): string;
encodeFunctionData(
functionFragment: "renounceMinter",
values?: undefined
): string;
encodeFunctionData(functionFragment: "symbol", values?: undefined): string;
encodeFunctionData(
functionFragment: "totalSupply",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "transfer",
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "transferFrom",
values: [
PromiseOrValue<string>,
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>
]
): string;
decodeFunctionResult(functionFragment: "addMinter", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "decreaseAllowance",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "increaseAllowance",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "isMinter", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "name", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "renounceMinter",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "totalSupply",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "transferFrom",
data: BytesLike
): Result;
events: {
"Approval(address,address,uint256)": EventFragment;
"MinterAdded(address)": EventFragment;
"MinterRemoved(address)": EventFragment;
"Transfer(address,address,uint256)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment;
getEvent(nameOrSignatureOrTopic: "MinterAdded"): EventFragment;
getEvent(nameOrSignatureOrTopic: "MinterRemoved"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment;
}
export interface ApprovalEventObject {
owner: string;
spender: string;
value: BigNumber;
}
export type ApprovalEvent = TypedEvent<
[string, string, BigNumber],
ApprovalEventObject
>;
export type ApprovalEventFilter = TypedEventFilter<ApprovalEvent>;
export interface MinterAddedEventObject {
account: string;
}
export type MinterAddedEvent = TypedEvent<[string], MinterAddedEventObject>;
export type MinterAddedEventFilter = TypedEventFilter<MinterAddedEvent>;
export interface MinterRemovedEventObject {
account: string;
}
export type MinterRemovedEvent = TypedEvent<[string], MinterRemovedEventObject>;
export type MinterRemovedEventFilter = TypedEventFilter<MinterRemovedEvent>;
export interface TransferEventObject {
from: string;
to: string;
value: BigNumber;
}
export type TransferEvent = TypedEvent<
[string, string, BigNumber],
TransferEventObject
>;
export type TransferEventFilter = TypedEventFilter<TransferEvent>;
export interface ERC20Mock extends BaseContract {
contractName: "ERC20Mock";
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
interface: ERC20MockInterface;
queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>;
listeners<TEvent extends TypedEvent>(
eventFilter?: TypedEventFilter<TEvent>
): Array<TypedListener<TEvent>>;
listeners(eventName?: string): Array<Listener>;
removeAllListeners<TEvent extends TypedEvent>(
eventFilter: TypedEventFilter<TEvent>
): this;
removeAllListeners(eventName?: string): this;
off: OnEvent<this>;
on: OnEvent<this>;
once: OnEvent<this>;
removeListener: OnEvent<this>;
functions: {
addMinter(
account: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
/**
* See {IERC20-allowance}.
*/
allowance(
owner: PromiseOrValue<string>,
spender: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber]>;
/**
* See {IERC20-approve}. * Requirements: * - `spender` cannot be the zero address.
*/
approve(
spender: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
/**
* See {IERC20-balanceOf}.
*/
balanceOf(
account: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber]>;
/**
* Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). * Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. * NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.
*/
decimals(overrides?: CallOverrides): Promise<[number]>;
/**
* Atomically decreases the allowance granted to `spender` by the caller. * This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. * Emits an {Approval} event indicating the updated allowance. * Requirements: * - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.
*/
decreaseAllowance(
spender: PromiseOrValue<string>,
subtractedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
/**
* Atomically increases the allowance granted to `spender` by the caller. * This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. * Emits an {Approval} event indicating the updated allowance. * Requirements: * - `spender` cannot be the zero address.
*/
increaseAllowance(
spender: PromiseOrValue<string>,
addedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
isMinter(
account: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[boolean]>;
/**
* See {ERC20-_mint}. * Requirements: * - the caller must have the {MinterRole}.
*/
mint(
account: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
/**
* Returns the name of the token.
*/
name(overrides?: CallOverrides): Promise<[string]>;
renounceMinter(
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
/**
* Returns the symbol of the token, usually a shorter version of the name.
*/
symbol(overrides?: CallOverrides): Promise<[string]>;
/**
* See {IERC20-totalSupply}.
*/
totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>;
/**
* See {IERC20-transfer}. * Requirements: * - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.
*/
transfer(
recipient: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
/**
* See {IERC20-transferFrom}. * Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; * Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for `sender`'s tokens of at least `amount`.
*/
transferFrom(
sender: PromiseOrValue<string>,
recipient: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
};
addMinter(
account: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
/**
* See {IERC20-allowance}.
*/
allowance(
owner: PromiseOrValue<string>,
spender: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* See {IERC20-approve}. * Requirements: * - `spender` cannot be the zero address.
*/
approve(
spender: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
/**
* See {IERC20-balanceOf}.
*/
balanceOf(
account: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). * Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. * NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.
*/
decimals(overrides?: CallOverrides): Promise<number>;
/**
* Atomically decreases the allowance granted to `spender` by the caller. * This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. * Emits an {Approval} event indicating the updated allowance. * Requirements: * - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.
*/
decreaseAllowance(
spender: PromiseOrValue<string>,
subtractedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
/**
* Atomically increases the allowance granted to `spender` by the caller. * This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. * Emits an {Approval} event indicating the updated allowance. * Requirements: * - `spender` cannot be the zero address.
*/
increaseAllowance(
spender: PromiseOrValue<string>,
addedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
isMinter(
account: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* See {ERC20-_mint}. * Requirements: * - the caller must have the {MinterRole}.
*/
mint(
account: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
/**
* Returns the name of the token.
*/
name(overrides?: CallOverrides): Promise<string>;
renounceMinter(
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
/**
* Returns the symbol of the token, usually a shorter version of the name.
*/
symbol(overrides?: CallOverrides): Promise<string>;
/**
* See {IERC20-totalSupply}.
*/
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
/**
* See {IERC20-transfer}. * Requirements: * - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.
*/
transfer(
recipient: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
/**
* See {IERC20-transferFrom}. * Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; * Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for `sender`'s tokens of at least `amount`.
*/
transferFrom(
sender: PromiseOrValue<string>,
recipient: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
callStatic: {
addMinter(
account: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>;
/**
* See {IERC20-allowance}.
*/
allowance(
owner: PromiseOrValue<string>,
spender: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* See {IERC20-approve}. * Requirements: * - `spender` cannot be the zero address.
*/
approve(
spender: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* See {IERC20-balanceOf}.
*/
balanceOf(
account: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). * Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. * NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.
*/
decimals(overrides?: CallOverrides): Promise<number>;
/**
* Atomically decreases the allowance granted to `spender` by the caller. * This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. * Emits an {Approval} event indicating the updated allowance. * Requirements: * - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.
*/
decreaseAllowance(
spender: PromiseOrValue<string>,
subtractedValue: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* Atomically increases the allowance granted to `spender` by the caller. * This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. * Emits an {Approval} event indicating the updated allowance. * Requirements: * - `spender` cannot be the zero address.
*/
increaseAllowance(
spender: PromiseOrValue<string>,
addedValue: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<boolean>;
isMinter(
account: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* See {ERC20-_mint}. * Requirements: * - the caller must have the {MinterRole}.
*/
mint(
account: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* Returns the name of the token.
*/
name(overrides?: CallOverrides): Promise<string>;
renounceMinter(overrides?: CallOverrides): Promise<void>;
/**
* Returns the symbol of the token, usually a shorter version of the name.
*/
symbol(overrides?: CallOverrides): Promise<string>;
/**
* See {IERC20-totalSupply}.
*/
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
/**
* See {IERC20-transfer}. * Requirements: * - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.
*/
transfer(
recipient: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* See {IERC20-transferFrom}. * Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; * Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for `sender`'s tokens of at least `amount`.
*/
transferFrom(
sender: PromiseOrValue<string>,
recipient: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<boolean>;
};
filters: {
"Approval(address,address,uint256)"(
owner?: PromiseOrValue<string> | null,
spender?: PromiseOrValue<string> | null,
value?: null
): ApprovalEventFilter;
Approval(
owner?: PromiseOrValue<string> | null,
spender?: PromiseOrValue<string> | null,
value?: null
): ApprovalEventFilter;
"MinterAdded(address)"(
account?: PromiseOrValue<string> | null
): MinterAddedEventFilter;
MinterAdded(
account?: PromiseOrValue<string> | null
): MinterAddedEventFilter;
"MinterRemoved(address)"(
account?: PromiseOrValue<string> | null
): MinterRemovedEventFilter;
MinterRemoved(
account?: PromiseOrValue<string> | null
): MinterRemovedEventFilter;
"Transfer(address,address,uint256)"(
from?: PromiseOrValue<string> | null,
to?: PromiseOrValue<string> | null,
value?: null
): TransferEventFilter;
Transfer(
from?: PromiseOrValue<string> | null,
to?: PromiseOrValue<string> | null,
value?: null
): TransferEventFilter;
};
estimateGas: {
addMinter(
account: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
/**
* See {IERC20-allowance}.
*/
allowance(
owner: PromiseOrValue<string>,
spender: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* See {IERC20-approve}. * Requirements: * - `spender` cannot be the zero address.
*/
approve(
spender: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
/**
* See {IERC20-balanceOf}.
*/
balanceOf(
account: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). * Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. * NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.
*/
decimals(overrides?: CallOverrides): Promise<BigNumber>;
/**
* Atomically decreases the allowance granted to `spender` by the caller. * This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. * Emits an {Approval} event indicating the updated allowance. * Requirements: * - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.
*/
decreaseAllowance(
spender: PromiseOrValue<string>,
subtractedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
/**
* Atomically increases the allowance granted to `spender` by the caller. * This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. * Emits an {Approval} event indicating the updated allowance. * Requirements: * - `spender` cannot be the zero address.
*/
increaseAllowance(
spender: PromiseOrValue<string>,
addedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
isMinter(
account: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* See {ERC20-_mint}. * Requirements: * - the caller must have the {MinterRole}.
*/
mint(
account: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
/**
* Returns the name of the token.
*/
name(overrides?: CallOverrides): Promise<BigNumber>;
renounceMinter(
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
/**
* Returns the symbol of the token, usually a shorter version of the name.
*/
symbol(overrides?: CallOverrides): Promise<BigNumber>;
/**
* See {IERC20-totalSupply}.
*/
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
/**
* See {IERC20-transfer}. * Requirements: * - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.
*/
transfer(
recipient: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
/**
* See {IERC20-transferFrom}. * Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; * Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for `sender`'s tokens of at least `amount`.
*/
transferFrom(
sender: PromiseOrValue<string>,
recipient: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
};
populateTransaction: {
addMinter(
account: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
/**
* See {IERC20-allowance}.
*/
allowance(
owner: PromiseOrValue<string>,
spender: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
/**
* See {IERC20-approve}. * Requirements: * - `spender` cannot be the zero address.
*/
approve(
spender: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
/**
* See {IERC20-balanceOf}.
*/
balanceOf(
account: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
/**
* Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). * Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. * NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.
*/
decimals(overrides?: CallOverrides): Promise<PopulatedTransaction>;
/**
* Atomically decreases the allowance granted to `spender` by the caller. * This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. * Emits an {Approval} event indicating the updated allowance. * Requirements: * - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.
*/
decreaseAllowance(
spender: PromiseOrValue<string>,
subtractedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
/**
* Atomically increases the allowance granted to `spender` by the caller. * This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. * Emits an {Approval} event indicating the updated allowance. * Requirements: * - `spender` cannot be the zero address.
*/
increaseAllowance(
spender: PromiseOrValue<string>,
addedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
isMinter(
account: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
/**
* See {ERC20-_mint}. * Requirements: * - the caller must have the {MinterRole}.
*/
mint(
account: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
/**
* Returns the name of the token.
*/
name(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceMinter(
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
/**
* Returns the symbol of the token, usually a shorter version of the name.
*/
symbol(overrides?: CallOverrides): Promise<PopulatedTransaction>;
/**
* See {IERC20-totalSupply}.
*/
totalSupply(overrides?: CallOverrides): Promise<PopulatedTransaction>;
/**
* See {IERC20-transfer}. * Requirements: * - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.
*/
transfer(
recipient: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
/**
* See {IERC20-transferFrom}. * Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; * Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for `sender`'s tokens of at least `amount`.
*/
transferFrom(
sender: PromiseOrValue<string>,
recipient: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
};
}

View File

@ -0,0 +1,943 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
BaseContract,
BigNumber,
BigNumberish,
BytesLike,
CallOverrides,
ContractTransaction,
Overrides,
PayableOverrides,
PopulatedTransaction,
Signer,
utils,
} from "ethers";
import type {
FunctionFragment,
Result,
EventFragment,
} from "@ethersproject/abi";
import type { Listener, Provider } from "@ethersproject/providers";
import type {
TypedEventFilter,
TypedEvent,
TypedListener,
OnEvent,
PromiseOrValue,
} from "./common";
export interface ERC20TornadoInterface extends utils.Interface {
functions: {
"FIELD_SIZE()": FunctionFragment;
"ROOT_HISTORY_SIZE()": FunctionFragment;
"ZERO_VALUE()": FunctionFragment;
"changeOperator(address)": FunctionFragment;
"commitments(bytes32)": FunctionFragment;
"currentRootIndex()": FunctionFragment;
"denomination()": FunctionFragment;
"deposit(bytes32)": FunctionFragment;
"filledSubtrees(uint256)": FunctionFragment;
"getLastRoot()": FunctionFragment;
"hashLeftRight(bytes32,bytes32)": FunctionFragment;
"isKnownRoot(bytes32)": FunctionFragment;
"isSpent(bytes32)": FunctionFragment;
"isSpentArray(bytes32[])": FunctionFragment;
"levels()": FunctionFragment;
"nextIndex()": FunctionFragment;
"nullifierHashes(bytes32)": FunctionFragment;
"operator()": FunctionFragment;
"roots(uint256)": FunctionFragment;
"token()": FunctionFragment;
"updateVerifier(address)": FunctionFragment;
"verifier()": FunctionFragment;
"withdraw(bytes,bytes32,bytes32,address,address,uint256,uint256)": FunctionFragment;
"zeros(uint256)": FunctionFragment;
};
getFunction(
nameOrSignatureOrTopic:
| "FIELD_SIZE"
| "ROOT_HISTORY_SIZE"
| "ZERO_VALUE"
| "changeOperator"
| "commitments"
| "currentRootIndex"
| "denomination"
| "deposit"
| "filledSubtrees"
| "getLastRoot"
| "hashLeftRight"
| "isKnownRoot"
| "isSpent"
| "isSpentArray"
| "levels"
| "nextIndex"
| "nullifierHashes"
| "operator"
| "roots"
| "token"
| "updateVerifier"
| "verifier"
| "withdraw"
| "zeros"
): FunctionFragment;
encodeFunctionData(
functionFragment: "FIELD_SIZE",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "ROOT_HISTORY_SIZE",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "ZERO_VALUE",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "changeOperator",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(
functionFragment: "commitments",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "currentRootIndex",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "denomination",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "deposit",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "filledSubtrees",
values: [PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "getLastRoot",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "hashLeftRight",
values: [PromiseOrValue<BytesLike>, PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "isKnownRoot",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "isSpent",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "isSpentArray",
values: [PromiseOrValue<BytesLike>[]]
): string;
encodeFunctionData(functionFragment: "levels", values?: undefined): string;
encodeFunctionData(functionFragment: "nextIndex", values?: undefined): string;
encodeFunctionData(
functionFragment: "nullifierHashes",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(functionFragment: "operator", values?: undefined): string;
encodeFunctionData(
functionFragment: "roots",
values: [PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(functionFragment: "token", values?: undefined): string;
encodeFunctionData(
functionFragment: "updateVerifier",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(functionFragment: "verifier", values?: undefined): string;
encodeFunctionData(
functionFragment: "withdraw",
values: [
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>,
PromiseOrValue<string>,
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BigNumberish>
]
): string;
encodeFunctionData(
functionFragment: "zeros",
values: [PromiseOrValue<BigNumberish>]
): string;
decodeFunctionResult(functionFragment: "FIELD_SIZE", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "ROOT_HISTORY_SIZE",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "ZERO_VALUE", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "changeOperator",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "commitments",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "currentRootIndex",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "denomination",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "deposit", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "filledSubtrees",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getLastRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "hashLeftRight",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "isKnownRoot",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "isSpent", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "isSpentArray",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "levels", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "nextIndex", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "nullifierHashes",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "operator", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "roots", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "token", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "updateVerifier",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "verifier", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "zeros", data: BytesLike): Result;
events: {
"Deposit(bytes32,uint32,uint256)": EventFragment;
"Withdrawal(address,bytes32,address,uint256)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "Deposit"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Withdrawal"): EventFragment;
}
export interface DepositEventObject {
commitment: string;
leafIndex: number;
timestamp: BigNumber;
}
export type DepositEvent = TypedEvent<
[string, number, BigNumber],
DepositEventObject
>;
export type DepositEventFilter = TypedEventFilter<DepositEvent>;
export interface WithdrawalEventObject {
to: string;
nullifierHash: string;
relayer: string;
fee: BigNumber;
}
export type WithdrawalEvent = TypedEvent<
[string, string, string, BigNumber],
WithdrawalEventObject
>;
export type WithdrawalEventFilter = TypedEventFilter<WithdrawalEvent>;
export interface ERC20Tornado extends BaseContract {
contractName: "ERC20Tornado";
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
interface: ERC20TornadoInterface;
queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>;
listeners<TEvent extends TypedEvent>(
eventFilter?: TypedEventFilter<TEvent>
): Array<TypedListener<TEvent>>;
listeners(eventName?: string): Array<Listener>;
removeAllListeners<TEvent extends TypedEvent>(
eventFilter: TypedEventFilter<TEvent>
): this;
removeAllListeners(eventName?: string): this;
off: OnEvent<this>;
on: OnEvent<this>;
once: OnEvent<this>;
removeListener: OnEvent<this>;
functions: {
FIELD_SIZE(overrides?: CallOverrides): Promise<[BigNumber]>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<[number]>;
ZERO_VALUE(overrides?: CallOverrides): Promise<[BigNumber]>;
/**
* operator can change his address
*/
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[boolean]>;
currentRootIndex(overrides?: CallOverrides): Promise<[number]>;
denomination(overrides?: CallOverrides): Promise<[BigNumber]>;
/**
* Deposit funds into the contract. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this instance.
* @param _commitment the note commitment, which is PedersenHash(nullifier + secret)
*/
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<[string]>;
/**
* Returns the last root
*/
getLastRoot(overrides?: CallOverrides): Promise<[string]>;
/**
* Hash 2 tree leaves, returns MiMC(_left, _right)
*/
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[string]>;
/**
* Whether the root is present in the root history
*/
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[boolean]>;
/**
* whether a note is already spent
*/
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[boolean]>;
/**
* whether an array of notes is already spent
*/
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<[boolean[]] & { spent: boolean[] }>;
levels(overrides?: CallOverrides): Promise<[number]>;
nextIndex(overrides?: CallOverrides): Promise<[number]>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[boolean]>;
operator(overrides?: CallOverrides): Promise<[string]>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<[string]>;
token(overrides?: CallOverrides): Promise<[string]>;
/**
* allow operator to update SNARK verification keys. This is needed to update keys after the final trusted setup ceremony is held. After that operator rights are supposed to be transferred to zero address
*/
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
verifier(overrides?: CallOverrides): Promise<[string]>;
/**
* Withdraw a deposit from the contract. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs `input` array consists of: - merkle root of all deposits in the contract - hash of unique deposit nullifier to prevent double spends - the recipient of funds - optional fee that goes to the transaction sender (usually a relay)
*/
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<[string]>;
};
FIELD_SIZE(overrides?: CallOverrides): Promise<BigNumber>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<number>;
ZERO_VALUE(overrides?: CallOverrides): Promise<BigNumber>;
/**
* operator can change his address
*/
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
currentRootIndex(overrides?: CallOverrides): Promise<number>;
denomination(overrides?: CallOverrides): Promise<BigNumber>;
/**
* Deposit funds into the contract. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this instance.
* @param _commitment the note commitment, which is PedersenHash(nullifier + secret)
*/
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
/**
* Returns the last root
*/
getLastRoot(overrides?: CallOverrides): Promise<string>;
/**
* Hash 2 tree leaves, returns MiMC(_left, _right)
*/
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<string>;
/**
* Whether the root is present in the root history
*/
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* whether a note is already spent
*/
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* whether an array of notes is already spent
*/
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<boolean[]>;
levels(overrides?: CallOverrides): Promise<number>;
nextIndex(overrides?: CallOverrides): Promise<number>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
operator(overrides?: CallOverrides): Promise<string>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
token(overrides?: CallOverrides): Promise<string>;
/**
* allow operator to update SNARK verification keys. This is needed to update keys after the final trusted setup ceremony is held. After that operator rights are supposed to be transferred to zero address
*/
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
verifier(overrides?: CallOverrides): Promise<string>;
/**
* Withdraw a deposit from the contract. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs `input` array consists of: - merkle root of all deposits in the contract - hash of unique deposit nullifier to prevent double spends - the recipient of funds - optional fee that goes to the transaction sender (usually a relay)
*/
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
callStatic: {
FIELD_SIZE(overrides?: CallOverrides): Promise<BigNumber>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<number>;
ZERO_VALUE(overrides?: CallOverrides): Promise<BigNumber>;
/**
* operator can change his address
*/
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
currentRootIndex(overrides?: CallOverrides): Promise<number>;
denomination(overrides?: CallOverrides): Promise<BigNumber>;
/**
* Deposit funds into the contract. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this instance.
* @param _commitment the note commitment, which is PedersenHash(nullifier + secret)
*/
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<void>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
/**
* Returns the last root
*/
getLastRoot(overrides?: CallOverrides): Promise<string>;
/**
* Hash 2 tree leaves, returns MiMC(_left, _right)
*/
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<string>;
/**
* Whether the root is present in the root history
*/
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* whether a note is already spent
*/
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* whether an array of notes is already spent
*/
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<boolean[]>;
levels(overrides?: CallOverrides): Promise<number>;
nextIndex(overrides?: CallOverrides): Promise<number>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
operator(overrides?: CallOverrides): Promise<string>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
token(overrides?: CallOverrides): Promise<string>;
/**
* allow operator to update SNARK verification keys. This is needed to update keys after the final trusted setup ceremony is held. After that operator rights are supposed to be transferred to zero address
*/
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>;
verifier(overrides?: CallOverrides): Promise<string>;
/**
* Withdraw a deposit from the contract. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs `input` array consists of: - merkle root of all deposits in the contract - hash of unique deposit nullifier to prevent double spends - the recipient of funds - optional fee that goes to the transaction sender (usually a relay)
*/
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
};
filters: {
"Deposit(bytes32,uint32,uint256)"(
commitment?: PromiseOrValue<BytesLike> | null,
leafIndex?: null,
timestamp?: null
): DepositEventFilter;
Deposit(
commitment?: PromiseOrValue<BytesLike> | null,
leafIndex?: null,
timestamp?: null
): DepositEventFilter;
"Withdrawal(address,bytes32,address,uint256)"(
to?: null,
nullifierHash?: null,
relayer?: PromiseOrValue<string> | null,
fee?: null
): WithdrawalEventFilter;
Withdrawal(
to?: null,
nullifierHash?: null,
relayer?: PromiseOrValue<string> | null,
fee?: null
): WithdrawalEventFilter;
};
estimateGas: {
FIELD_SIZE(overrides?: CallOverrides): Promise<BigNumber>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<BigNumber>;
ZERO_VALUE(overrides?: CallOverrides): Promise<BigNumber>;
/**
* operator can change his address
*/
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
currentRootIndex(overrides?: CallOverrides): Promise<BigNumber>;
denomination(overrides?: CallOverrides): Promise<BigNumber>;
/**
* Deposit funds into the contract. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this instance.
* @param _commitment the note commitment, which is PedersenHash(nullifier + secret)
*/
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* Returns the last root
*/
getLastRoot(overrides?: CallOverrides): Promise<BigNumber>;
/**
* Hash 2 tree leaves, returns MiMC(_left, _right)
*/
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* Whether the root is present in the root history
*/
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* whether a note is already spent
*/
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* whether an array of notes is already spent
*/
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<BigNumber>;
levels(overrides?: CallOverrides): Promise<BigNumber>;
nextIndex(overrides?: CallOverrides): Promise<BigNumber>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
operator(overrides?: CallOverrides): Promise<BigNumber>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<BigNumber>;
token(overrides?: CallOverrides): Promise<BigNumber>;
/**
* allow operator to update SNARK verification keys. This is needed to update keys after the final trusted setup ceremony is held. After that operator rights are supposed to be transferred to zero address
*/
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
verifier(overrides?: CallOverrides): Promise<BigNumber>;
/**
* Withdraw a deposit from the contract. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs `input` array consists of: - merkle root of all deposits in the contract - hash of unique deposit nullifier to prevent double spends - the recipient of funds - optional fee that goes to the transaction sender (usually a relay)
*/
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<BigNumber>;
};
populateTransaction: {
FIELD_SIZE(overrides?: CallOverrides): Promise<PopulatedTransaction>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<PopulatedTransaction>;
ZERO_VALUE(overrides?: CallOverrides): Promise<PopulatedTransaction>;
/**
* operator can change his address
*/
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
currentRootIndex(overrides?: CallOverrides): Promise<PopulatedTransaction>;
denomination(overrides?: CallOverrides): Promise<PopulatedTransaction>;
/**
* Deposit funds into the contract. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this instance.
* @param _commitment the note commitment, which is PedersenHash(nullifier + secret)
*/
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
/**
* Returns the last root
*/
getLastRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
/**
* Hash 2 tree leaves, returns MiMC(_left, _right)
*/
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
/**
* Whether the root is present in the root history
*/
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
/**
* whether a note is already spent
*/
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
/**
* whether an array of notes is already spent
*/
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
levels(overrides?: CallOverrides): Promise<PopulatedTransaction>;
nextIndex(overrides?: CallOverrides): Promise<PopulatedTransaction>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
operator(overrides?: CallOverrides): Promise<PopulatedTransaction>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
token(overrides?: CallOverrides): Promise<PopulatedTransaction>;
/**
* allow operator to update SNARK verification keys. This is needed to update keys after the final trusted setup ceremony is held. After that operator rights are supposed to be transferred to zero address
*/
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
verifier(overrides?: CallOverrides): Promise<PopulatedTransaction>;
/**
* Withdraw a deposit from the contract. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs `input` array consists of: - merkle root of all deposits in the contract - hash of unique deposit nullifier to prevent double spends - the recipient of funds - optional fee that goes to the transaction sender (usually a relay)
*/
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
};
}

View File

@ -0,0 +1,929 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
BaseContract,
BigNumber,
BigNumberish,
BytesLike,
CallOverrides,
ContractTransaction,
Overrides,
PayableOverrides,
PopulatedTransaction,
Signer,
utils,
} from "ethers";
import type {
FunctionFragment,
Result,
EventFragment,
} from "@ethersproject/abi";
import type { Listener, Provider } from "@ethersproject/providers";
import type {
TypedEventFilter,
TypedEvent,
TypedListener,
OnEvent,
PromiseOrValue,
} from "./common";
export interface ETHTornadoInterface extends utils.Interface {
functions: {
"FIELD_SIZE()": FunctionFragment;
"ROOT_HISTORY_SIZE()": FunctionFragment;
"ZERO_VALUE()": FunctionFragment;
"changeOperator(address)": FunctionFragment;
"commitments(bytes32)": FunctionFragment;
"currentRootIndex()": FunctionFragment;
"denomination()": FunctionFragment;
"deposit(bytes32)": FunctionFragment;
"filledSubtrees(uint256)": FunctionFragment;
"getLastRoot()": FunctionFragment;
"hashLeftRight(bytes32,bytes32)": FunctionFragment;
"isKnownRoot(bytes32)": FunctionFragment;
"isSpent(bytes32)": FunctionFragment;
"isSpentArray(bytes32[])": FunctionFragment;
"levels()": FunctionFragment;
"nextIndex()": FunctionFragment;
"nullifierHashes(bytes32)": FunctionFragment;
"operator()": FunctionFragment;
"roots(uint256)": FunctionFragment;
"updateVerifier(address)": FunctionFragment;
"verifier()": FunctionFragment;
"withdraw(bytes,bytes32,bytes32,address,address,uint256,uint256)": FunctionFragment;
"zeros(uint256)": FunctionFragment;
};
getFunction(
nameOrSignatureOrTopic:
| "FIELD_SIZE"
| "ROOT_HISTORY_SIZE"
| "ZERO_VALUE"
| "changeOperator"
| "commitments"
| "currentRootIndex"
| "denomination"
| "deposit"
| "filledSubtrees"
| "getLastRoot"
| "hashLeftRight"
| "isKnownRoot"
| "isSpent"
| "isSpentArray"
| "levels"
| "nextIndex"
| "nullifierHashes"
| "operator"
| "roots"
| "updateVerifier"
| "verifier"
| "withdraw"
| "zeros"
): FunctionFragment;
encodeFunctionData(
functionFragment: "FIELD_SIZE",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "ROOT_HISTORY_SIZE",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "ZERO_VALUE",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "changeOperator",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(
functionFragment: "commitments",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "currentRootIndex",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "denomination",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "deposit",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "filledSubtrees",
values: [PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "getLastRoot",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "hashLeftRight",
values: [PromiseOrValue<BytesLike>, PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "isKnownRoot",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "isSpent",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "isSpentArray",
values: [PromiseOrValue<BytesLike>[]]
): string;
encodeFunctionData(functionFragment: "levels", values?: undefined): string;
encodeFunctionData(functionFragment: "nextIndex", values?: undefined): string;
encodeFunctionData(
functionFragment: "nullifierHashes",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(functionFragment: "operator", values?: undefined): string;
encodeFunctionData(
functionFragment: "roots",
values: [PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "updateVerifier",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(functionFragment: "verifier", values?: undefined): string;
encodeFunctionData(
functionFragment: "withdraw",
values: [
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>,
PromiseOrValue<string>,
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BigNumberish>
]
): string;
encodeFunctionData(
functionFragment: "zeros",
values: [PromiseOrValue<BigNumberish>]
): string;
decodeFunctionResult(functionFragment: "FIELD_SIZE", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "ROOT_HISTORY_SIZE",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "ZERO_VALUE", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "changeOperator",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "commitments",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "currentRootIndex",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "denomination",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "deposit", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "filledSubtrees",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getLastRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "hashLeftRight",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "isKnownRoot",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "isSpent", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "isSpentArray",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "levels", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "nextIndex", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "nullifierHashes",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "operator", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "roots", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "updateVerifier",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "verifier", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "zeros", data: BytesLike): Result;
events: {
"Deposit(bytes32,uint32,uint256)": EventFragment;
"Withdrawal(address,bytes32,address,uint256)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "Deposit"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Withdrawal"): EventFragment;
}
export interface DepositEventObject {
commitment: string;
leafIndex: number;
timestamp: BigNumber;
}
export type DepositEvent = TypedEvent<
[string, number, BigNumber],
DepositEventObject
>;
export type DepositEventFilter = TypedEventFilter<DepositEvent>;
export interface WithdrawalEventObject {
to: string;
nullifierHash: string;
relayer: string;
fee: BigNumber;
}
export type WithdrawalEvent = TypedEvent<
[string, string, string, BigNumber],
WithdrawalEventObject
>;
export type WithdrawalEventFilter = TypedEventFilter<WithdrawalEvent>;
export interface ETHTornado extends BaseContract {
contractName: "ETHTornado";
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
interface: ETHTornadoInterface;
queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>;
listeners<TEvent extends TypedEvent>(
eventFilter?: TypedEventFilter<TEvent>
): Array<TypedListener<TEvent>>;
listeners(eventName?: string): Array<Listener>;
removeAllListeners<TEvent extends TypedEvent>(
eventFilter: TypedEventFilter<TEvent>
): this;
removeAllListeners(eventName?: string): this;
off: OnEvent<this>;
on: OnEvent<this>;
once: OnEvent<this>;
removeListener: OnEvent<this>;
functions: {
FIELD_SIZE(overrides?: CallOverrides): Promise<[BigNumber]>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<[number]>;
ZERO_VALUE(overrides?: CallOverrides): Promise<[BigNumber]>;
/**
* operator can change his address
*/
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[boolean]>;
currentRootIndex(overrides?: CallOverrides): Promise<[number]>;
denomination(overrides?: CallOverrides): Promise<[BigNumber]>;
/**
* Deposit funds into the contract. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this instance.
* @param _commitment the note commitment, which is PedersenHash(nullifier + secret)
*/
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<[string]>;
/**
* Returns the last root
*/
getLastRoot(overrides?: CallOverrides): Promise<[string]>;
/**
* Hash 2 tree leaves, returns MiMC(_left, _right)
*/
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[string]>;
/**
* Whether the root is present in the root history
*/
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[boolean]>;
/**
* whether a note is already spent
*/
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[boolean]>;
/**
* whether an array of notes is already spent
*/
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<[boolean[]] & { spent: boolean[] }>;
levels(overrides?: CallOverrides): Promise<[number]>;
nextIndex(overrides?: CallOverrides): Promise<[number]>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[boolean]>;
operator(overrides?: CallOverrides): Promise<[string]>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<[string]>;
/**
* allow operator to update SNARK verification keys. This is needed to update keys after the final trusted setup ceremony is held. After that operator rights are supposed to be transferred to zero address
*/
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
verifier(overrides?: CallOverrides): Promise<[string]>;
/**
* Withdraw a deposit from the contract. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs `input` array consists of: - merkle root of all deposits in the contract - hash of unique deposit nullifier to prevent double spends - the recipient of funds - optional fee that goes to the transaction sender (usually a relay)
*/
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<[string]>;
};
FIELD_SIZE(overrides?: CallOverrides): Promise<BigNumber>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<number>;
ZERO_VALUE(overrides?: CallOverrides): Promise<BigNumber>;
/**
* operator can change his address
*/
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
currentRootIndex(overrides?: CallOverrides): Promise<number>;
denomination(overrides?: CallOverrides): Promise<BigNumber>;
/**
* Deposit funds into the contract. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this instance.
* @param _commitment the note commitment, which is PedersenHash(nullifier + secret)
*/
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
/**
* Returns the last root
*/
getLastRoot(overrides?: CallOverrides): Promise<string>;
/**
* Hash 2 tree leaves, returns MiMC(_left, _right)
*/
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<string>;
/**
* Whether the root is present in the root history
*/
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* whether a note is already spent
*/
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* whether an array of notes is already spent
*/
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<boolean[]>;
levels(overrides?: CallOverrides): Promise<number>;
nextIndex(overrides?: CallOverrides): Promise<number>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
operator(overrides?: CallOverrides): Promise<string>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
/**
* allow operator to update SNARK verification keys. This is needed to update keys after the final trusted setup ceremony is held. After that operator rights are supposed to be transferred to zero address
*/
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
verifier(overrides?: CallOverrides): Promise<string>;
/**
* Withdraw a deposit from the contract. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs `input` array consists of: - merkle root of all deposits in the contract - hash of unique deposit nullifier to prevent double spends - the recipient of funds - optional fee that goes to the transaction sender (usually a relay)
*/
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
callStatic: {
FIELD_SIZE(overrides?: CallOverrides): Promise<BigNumber>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<number>;
ZERO_VALUE(overrides?: CallOverrides): Promise<BigNumber>;
/**
* operator can change his address
*/
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
currentRootIndex(overrides?: CallOverrides): Promise<number>;
denomination(overrides?: CallOverrides): Promise<BigNumber>;
/**
* Deposit funds into the contract. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this instance.
* @param _commitment the note commitment, which is PedersenHash(nullifier + secret)
*/
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<void>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
/**
* Returns the last root
*/
getLastRoot(overrides?: CallOverrides): Promise<string>;
/**
* Hash 2 tree leaves, returns MiMC(_left, _right)
*/
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<string>;
/**
* Whether the root is present in the root history
*/
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* whether a note is already spent
*/
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
/**
* whether an array of notes is already spent
*/
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<boolean[]>;
levels(overrides?: CallOverrides): Promise<number>;
nextIndex(overrides?: CallOverrides): Promise<number>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
operator(overrides?: CallOverrides): Promise<string>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
/**
* allow operator to update SNARK verification keys. This is needed to update keys after the final trusted setup ceremony is held. After that operator rights are supposed to be transferred to zero address
*/
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>;
verifier(overrides?: CallOverrides): Promise<string>;
/**
* Withdraw a deposit from the contract. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs `input` array consists of: - merkle root of all deposits in the contract - hash of unique deposit nullifier to prevent double spends - the recipient of funds - optional fee that goes to the transaction sender (usually a relay)
*/
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
};
filters: {
"Deposit(bytes32,uint32,uint256)"(
commitment?: PromiseOrValue<BytesLike> | null,
leafIndex?: null,
timestamp?: null
): DepositEventFilter;
Deposit(
commitment?: PromiseOrValue<BytesLike> | null,
leafIndex?: null,
timestamp?: null
): DepositEventFilter;
"Withdrawal(address,bytes32,address,uint256)"(
to?: null,
nullifierHash?: null,
relayer?: PromiseOrValue<string> | null,
fee?: null
): WithdrawalEventFilter;
Withdrawal(
to?: null,
nullifierHash?: null,
relayer?: PromiseOrValue<string> | null,
fee?: null
): WithdrawalEventFilter;
};
estimateGas: {
FIELD_SIZE(overrides?: CallOverrides): Promise<BigNumber>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<BigNumber>;
ZERO_VALUE(overrides?: CallOverrides): Promise<BigNumber>;
/**
* operator can change his address
*/
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
currentRootIndex(overrides?: CallOverrides): Promise<BigNumber>;
denomination(overrides?: CallOverrides): Promise<BigNumber>;
/**
* Deposit funds into the contract. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this instance.
* @param _commitment the note commitment, which is PedersenHash(nullifier + secret)
*/
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* Returns the last root
*/
getLastRoot(overrides?: CallOverrides): Promise<BigNumber>;
/**
* Hash 2 tree leaves, returns MiMC(_left, _right)
*/
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* Whether the root is present in the root history
*/
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* whether a note is already spent
*/
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* whether an array of notes is already spent
*/
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<BigNumber>;
levels(overrides?: CallOverrides): Promise<BigNumber>;
nextIndex(overrides?: CallOverrides): Promise<BigNumber>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
operator(overrides?: CallOverrides): Promise<BigNumber>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<BigNumber>;
/**
* allow operator to update SNARK verification keys. This is needed to update keys after the final trusted setup ceremony is held. After that operator rights are supposed to be transferred to zero address
*/
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
verifier(overrides?: CallOverrides): Promise<BigNumber>;
/**
* Withdraw a deposit from the contract. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs `input` array consists of: - merkle root of all deposits in the contract - hash of unique deposit nullifier to prevent double spends - the recipient of funds - optional fee that goes to the transaction sender (usually a relay)
*/
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<BigNumber>;
};
populateTransaction: {
FIELD_SIZE(overrides?: CallOverrides): Promise<PopulatedTransaction>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<PopulatedTransaction>;
ZERO_VALUE(overrides?: CallOverrides): Promise<PopulatedTransaction>;
/**
* operator can change his address
*/
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
currentRootIndex(overrides?: CallOverrides): Promise<PopulatedTransaction>;
denomination(overrides?: CallOverrides): Promise<PopulatedTransaction>;
/**
* Deposit funds into the contract. The caller must send (for ETH) or approve (for ERC20) value equal to or `denomination` of this instance.
* @param _commitment the note commitment, which is PedersenHash(nullifier + secret)
*/
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
/**
* Returns the last root
*/
getLastRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
/**
* Hash 2 tree leaves, returns MiMC(_left, _right)
*/
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
/**
* Whether the root is present in the root history
*/
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
/**
* whether a note is already spent
*/
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
/**
* whether an array of notes is already spent
*/
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
levels(overrides?: CallOverrides): Promise<PopulatedTransaction>;
nextIndex(overrides?: CallOverrides): Promise<PopulatedTransaction>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
operator(overrides?: CallOverrides): Promise<PopulatedTransaction>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
/**
* allow operator to update SNARK verification keys. This is needed to update keys after the final trusted setup ceremony is held. After that operator rights are supposed to be transferred to zero address
*/
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
verifier(overrides?: CallOverrides): Promise<PopulatedTransaction>;
/**
* Withdraw a deposit from the contract. `proof` is a zkSNARK proof data, and input is an array of circuit public inputs `input` array consists of: - merkle root of all deposits in the contract - hash of unique deposit nullifier to prevent double spends - the recipient of funds - optional fee that goes to the transaction sender (usually a relay)
*/
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
};
}

View File

@ -0,0 +1,600 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
BaseContract,
BigNumber,
BigNumberish,
BytesLike,
CallOverrides,
ContractTransaction,
PayableOverrides,
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,
PromiseOrValue,
} from "./common";
export declare namespace Multicall3 {
export type CallStruct = {
target: PromiseOrValue<string>;
callData: PromiseOrValue<BytesLike>;
};
export type CallStructOutput = [string, string] & {
target: string;
callData: string;
};
export type Call3Struct = {
target: PromiseOrValue<string>;
allowFailure: PromiseOrValue<boolean>;
callData: PromiseOrValue<BytesLike>;
};
export type Call3StructOutput = [string, boolean, string] & {
target: string;
allowFailure: boolean;
callData: string;
};
export type ResultStruct = {
success: PromiseOrValue<boolean>;
returnData: PromiseOrValue<BytesLike>;
};
export type ResultStructOutput = [boolean, string] & {
success: boolean;
returnData: string;
};
export type Call3ValueStruct = {
target: PromiseOrValue<string>;
allowFailure: PromiseOrValue<boolean>;
value: PromiseOrValue<BigNumberish>;
callData: PromiseOrValue<BytesLike>;
};
export type Call3ValueStructOutput = [string, boolean, BigNumber, string] & {
target: string;
allowFailure: boolean;
value: BigNumber;
callData: string;
};
}
export interface Multicall3ContractInterface extends utils.Interface {
functions: {
"aggregate((address,bytes)[])": FunctionFragment;
"aggregate3((address,bool,bytes)[])": FunctionFragment;
"aggregate3Value((address,bool,uint256,bytes)[])": FunctionFragment;
"blockAndAggregate((address,bytes)[])": FunctionFragment;
"getBasefee()": FunctionFragment;
"getBlockHash(uint256)": FunctionFragment;
"getBlockNumber()": FunctionFragment;
"getChainId()": FunctionFragment;
"getCurrentBlockCoinbase()": FunctionFragment;
"getCurrentBlockDifficulty()": FunctionFragment;
"getCurrentBlockGasLimit()": FunctionFragment;
"getCurrentBlockTimestamp()": FunctionFragment;
"getEthBalance(address)": FunctionFragment;
"getLastBlockHash()": FunctionFragment;
"tryAggregate(bool,(address,bytes)[])": FunctionFragment;
"tryBlockAndAggregate(bool,(address,bytes)[])": FunctionFragment;
};
getFunction(
nameOrSignatureOrTopic:
| "aggregate"
| "aggregate3"
| "aggregate3Value"
| "blockAndAggregate"
| "getBasefee"
| "getBlockHash"
| "getBlockNumber"
| "getChainId"
| "getCurrentBlockCoinbase"
| "getCurrentBlockDifficulty"
| "getCurrentBlockGasLimit"
| "getCurrentBlockTimestamp"
| "getEthBalance"
| "getLastBlockHash"
| "tryAggregate"
| "tryBlockAndAggregate"
): FunctionFragment;
encodeFunctionData(
functionFragment: "aggregate",
values: [Multicall3.CallStruct[]]
): string;
encodeFunctionData(
functionFragment: "aggregate3",
values: [Multicall3.Call3Struct[]]
): string;
encodeFunctionData(
functionFragment: "aggregate3Value",
values: [Multicall3.Call3ValueStruct[]]
): string;
encodeFunctionData(
functionFragment: "blockAndAggregate",
values: [Multicall3.CallStruct[]]
): string;
encodeFunctionData(
functionFragment: "getBasefee",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getBlockHash",
values: [PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "getBlockNumber",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getChainId",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getCurrentBlockCoinbase",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getCurrentBlockDifficulty",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getCurrentBlockGasLimit",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getCurrentBlockTimestamp",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getEthBalance",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(
functionFragment: "getLastBlockHash",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "tryAggregate",
values: [PromiseOrValue<boolean>, Multicall3.CallStruct[]]
): string;
encodeFunctionData(
functionFragment: "tryBlockAndAggregate",
values: [PromiseOrValue<boolean>, Multicall3.CallStruct[]]
): string;
decodeFunctionResult(functionFragment: "aggregate", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "aggregate3", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "aggregate3Value",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "blockAndAggregate",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "getBasefee", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "getBlockHash",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getBlockNumber",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "getChainId", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "getCurrentBlockCoinbase",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getCurrentBlockDifficulty",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getCurrentBlockGasLimit",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getCurrentBlockTimestamp",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getEthBalance",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getLastBlockHash",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "tryAggregate",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "tryBlockAndAggregate",
data: BytesLike
): Result;
events: {};
}
export interface Multicall3Contract extends BaseContract {
contractName: "Multicall3Contract";
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
interface: Multicall3ContractInterface;
queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>;
listeners<TEvent extends TypedEvent>(
eventFilter?: TypedEventFilter<TEvent>
): Array<TypedListener<TEvent>>;
listeners(eventName?: string): Array<Listener>;
removeAllListeners<TEvent extends TypedEvent>(
eventFilter: TypedEventFilter<TEvent>
): this;
removeAllListeners(eventName?: string): this;
off: OnEvent<this>;
on: OnEvent<this>;
once: OnEvent<this>;
removeListener: OnEvent<this>;
functions: {
aggregate(
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
aggregate3(
calls: Multicall3.Call3Struct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
aggregate3Value(
calls: Multicall3.Call3ValueStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
blockAndAggregate(
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
getBasefee(
overrides?: CallOverrides
): Promise<[BigNumber] & { basefee: BigNumber }>;
getBlockHash(
blockNumber: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<[string] & { blockHash: string }>;
getBlockNumber(
overrides?: CallOverrides
): Promise<[BigNumber] & { blockNumber: BigNumber }>;
getChainId(
overrides?: CallOverrides
): Promise<[BigNumber] & { chainid: BigNumber }>;
getCurrentBlockCoinbase(
overrides?: CallOverrides
): Promise<[string] & { coinbase: string }>;
getCurrentBlockDifficulty(
overrides?: CallOverrides
): Promise<[BigNumber] & { difficulty: BigNumber }>;
getCurrentBlockGasLimit(
overrides?: CallOverrides
): Promise<[BigNumber] & { gaslimit: BigNumber }>;
getCurrentBlockTimestamp(
overrides?: CallOverrides
): Promise<[BigNumber] & { timestamp: BigNumber }>;
getEthBalance(
addr: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber] & { balance: BigNumber }>;
getLastBlockHash(
overrides?: CallOverrides
): Promise<[string] & { blockHash: string }>;
tryAggregate(
requireSuccess: PromiseOrValue<boolean>,
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
tryBlockAndAggregate(
requireSuccess: PromiseOrValue<boolean>,
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
};
aggregate(
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
aggregate3(
calls: Multicall3.Call3Struct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
aggregate3Value(
calls: Multicall3.Call3ValueStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
blockAndAggregate(
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
getBasefee(overrides?: CallOverrides): Promise<BigNumber>;
getBlockHash(
blockNumber: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
getBlockNumber(overrides?: CallOverrides): Promise<BigNumber>;
getChainId(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockCoinbase(overrides?: CallOverrides): Promise<string>;
getCurrentBlockDifficulty(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockGasLimit(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockTimestamp(overrides?: CallOverrides): Promise<BigNumber>;
getEthBalance(
addr: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
getLastBlockHash(overrides?: CallOverrides): Promise<string>;
tryAggregate(
requireSuccess: PromiseOrValue<boolean>,
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
tryBlockAndAggregate(
requireSuccess: PromiseOrValue<boolean>,
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
callStatic: {
aggregate(
calls: Multicall3.CallStruct[],
overrides?: CallOverrides
): Promise<
[BigNumber, string[]] & { blockNumber: BigNumber; returnData: string[] }
>;
aggregate3(
calls: Multicall3.Call3Struct[],
overrides?: CallOverrides
): Promise<Multicall3.ResultStructOutput[]>;
aggregate3Value(
calls: Multicall3.Call3ValueStruct[],
overrides?: CallOverrides
): Promise<Multicall3.ResultStructOutput[]>;
blockAndAggregate(
calls: Multicall3.CallStruct[],
overrides?: CallOverrides
): Promise<
[BigNumber, string, Multicall3.ResultStructOutput[]] & {
blockNumber: BigNumber;
blockHash: string;
returnData: Multicall3.ResultStructOutput[];
}
>;
getBasefee(overrides?: CallOverrides): Promise<BigNumber>;
getBlockHash(
blockNumber: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
getBlockNumber(overrides?: CallOverrides): Promise<BigNumber>;
getChainId(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockCoinbase(overrides?: CallOverrides): Promise<string>;
getCurrentBlockDifficulty(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockGasLimit(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockTimestamp(overrides?: CallOverrides): Promise<BigNumber>;
getEthBalance(
addr: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
getLastBlockHash(overrides?: CallOverrides): Promise<string>;
tryAggregate(
requireSuccess: PromiseOrValue<boolean>,
calls: Multicall3.CallStruct[],
overrides?: CallOverrides
): Promise<Multicall3.ResultStructOutput[]>;
tryBlockAndAggregate(
requireSuccess: PromiseOrValue<boolean>,
calls: Multicall3.CallStruct[],
overrides?: CallOverrides
): Promise<
[BigNumber, string, Multicall3.ResultStructOutput[]] & {
blockNumber: BigNumber;
blockHash: string;
returnData: Multicall3.ResultStructOutput[];
}
>;
};
filters: {};
estimateGas: {
aggregate(
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
aggregate3(
calls: Multicall3.Call3Struct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
aggregate3Value(
calls: Multicall3.Call3ValueStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
blockAndAggregate(
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
getBasefee(overrides?: CallOverrides): Promise<BigNumber>;
getBlockHash(
blockNumber: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<BigNumber>;
getBlockNumber(overrides?: CallOverrides): Promise<BigNumber>;
getChainId(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockCoinbase(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockDifficulty(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockGasLimit(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockTimestamp(overrides?: CallOverrides): Promise<BigNumber>;
getEthBalance(
addr: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
getLastBlockHash(overrides?: CallOverrides): Promise<BigNumber>;
tryAggregate(
requireSuccess: PromiseOrValue<boolean>,
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
tryBlockAndAggregate(
requireSuccess: PromiseOrValue<boolean>,
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
};
populateTransaction: {
aggregate(
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
aggregate3(
calls: Multicall3.Call3Struct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
aggregate3Value(
calls: Multicall3.Call3ValueStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
blockAndAggregate(
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
getBasefee(overrides?: CallOverrides): Promise<PopulatedTransaction>;
getBlockHash(
blockNumber: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
getBlockNumber(overrides?: CallOverrides): Promise<PopulatedTransaction>;
getChainId(overrides?: CallOverrides): Promise<PopulatedTransaction>;
getCurrentBlockCoinbase(
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
getCurrentBlockDifficulty(
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
getCurrentBlockGasLimit(
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
getCurrentBlockTimestamp(
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
getEthBalance(
addr: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
getLastBlockHash(overrides?: CallOverrides): Promise<PopulatedTransaction>;
tryAggregate(
requireSuccess: PromiseOrValue<boolean>,
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
tryBlockAndAggregate(
requireSuccess: PromiseOrValue<boolean>,
calls: Multicall3.CallStruct[],
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
};
}

View File

@ -0,0 +1,310 @@
/* 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 } from "@ethersproject/abi";
import type { Listener, Provider } from "@ethersproject/providers";
import type {
TypedEventFilter,
TypedEvent,
TypedListener,
OnEvent,
PromiseOrValue,
} from "./common";
export declare namespace Multicall {
export type CallStruct = {
target: PromiseOrValue<string>;
callData: PromiseOrValue<BytesLike>;
};
export type CallStructOutput = [string, string] & {
target: string;
callData: string;
};
}
export interface MulticallContractInterface extends utils.Interface {
functions: {
"aggregate((address,bytes)[])": FunctionFragment;
"getBlockHash(uint256)": FunctionFragment;
"getCurrentBlockCoinbase()": FunctionFragment;
"getCurrentBlockDifficulty()": FunctionFragment;
"getCurrentBlockGasLimit()": FunctionFragment;
"getCurrentBlockTimestamp()": FunctionFragment;
"getEthBalance(address)": FunctionFragment;
"getLastBlockHash()": FunctionFragment;
};
getFunction(
nameOrSignatureOrTopic:
| "aggregate"
| "getBlockHash"
| "getCurrentBlockCoinbase"
| "getCurrentBlockDifficulty"
| "getCurrentBlockGasLimit"
| "getCurrentBlockTimestamp"
| "getEthBalance"
| "getLastBlockHash"
): FunctionFragment;
encodeFunctionData(
functionFragment: "aggregate",
values: [Multicall.CallStruct[]]
): string;
encodeFunctionData(
functionFragment: "getBlockHash",
values: [PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "getCurrentBlockCoinbase",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getCurrentBlockDifficulty",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getCurrentBlockGasLimit",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getCurrentBlockTimestamp",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getEthBalance",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(
functionFragment: "getLastBlockHash",
values?: undefined
): string;
decodeFunctionResult(functionFragment: "aggregate", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "getBlockHash",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getCurrentBlockCoinbase",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getCurrentBlockDifficulty",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getCurrentBlockGasLimit",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getCurrentBlockTimestamp",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getEthBalance",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getLastBlockHash",
data: BytesLike
): Result;
events: {};
}
export interface MulticallContract extends BaseContract {
contractName: "MulticallContract";
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
interface: MulticallContractInterface;
queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>;
listeners<TEvent extends TypedEvent>(
eventFilter?: TypedEventFilter<TEvent>
): Array<TypedListener<TEvent>>;
listeners(eventName?: string): Array<Listener>;
removeAllListeners<TEvent extends TypedEvent>(
eventFilter: TypedEventFilter<TEvent>
): this;
removeAllListeners(eventName?: string): this;
off: OnEvent<this>;
on: OnEvent<this>;
once: OnEvent<this>;
removeListener: OnEvent<this>;
functions: {
aggregate(
calls: Multicall.CallStruct[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
getBlockHash(
blockNumber: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<[string] & { blockHash: string }>;
getCurrentBlockCoinbase(
overrides?: CallOverrides
): Promise<[string] & { coinbase: string }>;
getCurrentBlockDifficulty(
overrides?: CallOverrides
): Promise<[BigNumber] & { difficulty: BigNumber }>;
getCurrentBlockGasLimit(
overrides?: CallOverrides
): Promise<[BigNumber] & { gaslimit: BigNumber }>;
getCurrentBlockTimestamp(
overrides?: CallOverrides
): Promise<[BigNumber] & { timestamp: BigNumber }>;
getEthBalance(
addr: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[BigNumber] & { balance: BigNumber }>;
getLastBlockHash(
overrides?: CallOverrides
): Promise<[string] & { blockHash: string }>;
};
aggregate(
calls: Multicall.CallStruct[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
getBlockHash(
blockNumber: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
getCurrentBlockCoinbase(overrides?: CallOverrides): Promise<string>;
getCurrentBlockDifficulty(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockGasLimit(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockTimestamp(overrides?: CallOverrides): Promise<BigNumber>;
getEthBalance(
addr: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
getLastBlockHash(overrides?: CallOverrides): Promise<string>;
callStatic: {
aggregate(
calls: Multicall.CallStruct[],
overrides?: CallOverrides
): Promise<
[BigNumber, string[]] & { blockNumber: BigNumber; returnData: string[] }
>;
getBlockHash(
blockNumber: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
getCurrentBlockCoinbase(overrides?: CallOverrides): Promise<string>;
getCurrentBlockDifficulty(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockGasLimit(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockTimestamp(overrides?: CallOverrides): Promise<BigNumber>;
getEthBalance(
addr: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
getLastBlockHash(overrides?: CallOverrides): Promise<string>;
};
filters: {};
estimateGas: {
aggregate(
calls: Multicall.CallStruct[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
getBlockHash(
blockNumber: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<BigNumber>;
getCurrentBlockCoinbase(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockDifficulty(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockGasLimit(overrides?: CallOverrides): Promise<BigNumber>;
getCurrentBlockTimestamp(overrides?: CallOverrides): Promise<BigNumber>;
getEthBalance(
addr: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
getLastBlockHash(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
aggregate(
calls: Multicall.CallStruct[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
getBlockHash(
blockNumber: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
getCurrentBlockCoinbase(
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
getCurrentBlockDifficulty(
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
getCurrentBlockGasLimit(
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
getCurrentBlockTimestamp(
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
getEthBalance(
addr: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
getLastBlockHash(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,789 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
BaseContract,
BigNumber,
BigNumberish,
BytesLike,
CallOverrides,
ContractTransaction,
Overrides,
PayableOverrides,
PopulatedTransaction,
Signer,
utils,
} from "ethers";
import type {
FunctionFragment,
Result,
EventFragment,
} from "@ethersproject/abi";
import type { Listener, Provider } from "@ethersproject/providers";
import type {
TypedEventFilter,
TypedEvent,
TypedListener,
OnEvent,
PromiseOrValue,
} from "./common";
export interface TornadoInstanceInterface extends utils.Interface {
functions: {
"changeOperator(address)": FunctionFragment;
"nullifierHashes(bytes32)": FunctionFragment;
"withdraw(bytes,bytes32,bytes32,address,address,uint256,uint256)": FunctionFragment;
"verifier()": FunctionFragment;
"hashLeftRight(bytes32,bytes32)": FunctionFragment;
"FIELD_SIZE()": FunctionFragment;
"levels()": FunctionFragment;
"operator()": FunctionFragment;
"isKnownRoot(bytes32)": FunctionFragment;
"commitments(bytes32)": FunctionFragment;
"denomination()": FunctionFragment;
"currentRootIndex()": FunctionFragment;
"updateVerifier(address)": FunctionFragment;
"isSpentArray(bytes32[])": FunctionFragment;
"deposit(bytes32)": FunctionFragment;
"getLastRoot()": FunctionFragment;
"roots(uint256)": FunctionFragment;
"ROOT_HISTORY_SIZE()": FunctionFragment;
"isSpent(bytes32)": FunctionFragment;
"zeros(uint256)": FunctionFragment;
"ZERO_VALUE()": FunctionFragment;
"filledSubtrees(uint256)": FunctionFragment;
"nextIndex()": FunctionFragment;
};
getFunction(
nameOrSignatureOrTopic:
| "changeOperator"
| "nullifierHashes"
| "withdraw"
| "verifier"
| "hashLeftRight"
| "FIELD_SIZE"
| "levels"
| "operator"
| "isKnownRoot"
| "commitments"
| "denomination"
| "currentRootIndex"
| "updateVerifier"
| "isSpentArray"
| "deposit"
| "getLastRoot"
| "roots"
| "ROOT_HISTORY_SIZE"
| "isSpent"
| "zeros"
| "ZERO_VALUE"
| "filledSubtrees"
| "nextIndex"
): FunctionFragment;
encodeFunctionData(
functionFragment: "changeOperator",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(
functionFragment: "nullifierHashes",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "withdraw",
values: [
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>,
PromiseOrValue<string>,
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BigNumberish>
]
): string;
encodeFunctionData(functionFragment: "verifier", values?: undefined): string;
encodeFunctionData(
functionFragment: "hashLeftRight",
values: [PromiseOrValue<BytesLike>, PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "FIELD_SIZE",
values?: undefined
): string;
encodeFunctionData(functionFragment: "levels", values?: undefined): string;
encodeFunctionData(functionFragment: "operator", values?: undefined): string;
encodeFunctionData(
functionFragment: "isKnownRoot",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "commitments",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "denomination",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "currentRootIndex",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "updateVerifier",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(
functionFragment: "isSpentArray",
values: [PromiseOrValue<BytesLike>[]]
): string;
encodeFunctionData(
functionFragment: "deposit",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "getLastRoot",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "roots",
values: [PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "ROOT_HISTORY_SIZE",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "isSpent",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "zeros",
values: [PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "ZERO_VALUE",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "filledSubtrees",
values: [PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(functionFragment: "nextIndex", values?: undefined): string;
decodeFunctionResult(
functionFragment: "changeOperator",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "nullifierHashes",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "verifier", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "hashLeftRight",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "FIELD_SIZE", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "levels", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "operator", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "isKnownRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "commitments",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "denomination",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "currentRootIndex",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "updateVerifier",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "isSpentArray",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "deposit", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "getLastRoot",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "roots", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "ROOT_HISTORY_SIZE",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "isSpent", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "zeros", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "ZERO_VALUE", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "filledSubtrees",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "nextIndex", data: BytesLike): Result;
events: {
"Deposit(bytes32,uint32,uint256)": EventFragment;
"Withdrawal(address,bytes32,address,uint256)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "Deposit"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Withdrawal"): EventFragment;
}
export interface DepositEventObject {
commitment: string;
leafIndex: number;
timestamp: BigNumber;
}
export type DepositEvent = TypedEvent<
[string, number, BigNumber],
DepositEventObject
>;
export type DepositEventFilter = TypedEventFilter<DepositEvent>;
export interface WithdrawalEventObject {
to: string;
nullifierHash: string;
relayer: string;
fee: BigNumber;
}
export type WithdrawalEvent = TypedEvent<
[string, string, string, BigNumber],
WithdrawalEventObject
>;
export type WithdrawalEventFilter = TypedEventFilter<WithdrawalEvent>;
export interface TornadoInstance extends BaseContract {
contractName: "TornadoInstance";
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
interface: TornadoInstanceInterface;
queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>;
listeners<TEvent extends TypedEvent>(
eventFilter?: TypedEventFilter<TEvent>
): Array<TypedListener<TEvent>>;
listeners(eventName?: string): Array<Listener>;
removeAllListeners<TEvent extends TypedEvent>(
eventFilter: TypedEventFilter<TEvent>
): this;
removeAllListeners(eventName?: string): this;
off: OnEvent<this>;
on: OnEvent<this>;
once: OnEvent<this>;
removeListener: OnEvent<this>;
functions: {
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[boolean]>;
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
verifier(overrides?: CallOverrides): Promise<[string]>;
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[string]>;
FIELD_SIZE(overrides?: CallOverrides): Promise<[BigNumber]>;
levels(overrides?: CallOverrides): Promise<[number]>;
operator(overrides?: CallOverrides): Promise<[string]>;
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[boolean]>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[boolean]>;
denomination(overrides?: CallOverrides): Promise<[BigNumber]>;
currentRootIndex(overrides?: CallOverrides): Promise<[number]>;
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<[boolean[]] & { spent: boolean[] }>;
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
getLastRoot(overrides?: CallOverrides): Promise<[string]>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<[string]>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<[number]>;
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[boolean]>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<[string]>;
ZERO_VALUE(overrides?: CallOverrides): Promise<[BigNumber]>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<[string]>;
nextIndex(overrides?: CallOverrides): Promise<[number]>;
};
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
verifier(overrides?: CallOverrides): Promise<string>;
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<string>;
FIELD_SIZE(overrides?: CallOverrides): Promise<BigNumber>;
levels(overrides?: CallOverrides): Promise<number>;
operator(overrides?: CallOverrides): Promise<string>;
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
denomination(overrides?: CallOverrides): Promise<BigNumber>;
currentRootIndex(overrides?: CallOverrides): Promise<number>;
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<boolean[]>;
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
getLastRoot(overrides?: CallOverrides): Promise<string>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<number>;
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
ZERO_VALUE(overrides?: CallOverrides): Promise<BigNumber>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
nextIndex(overrides?: CallOverrides): Promise<number>;
callStatic: {
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>;
verifier(overrides?: CallOverrides): Promise<string>;
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<string>;
FIELD_SIZE(overrides?: CallOverrides): Promise<BigNumber>;
levels(overrides?: CallOverrides): Promise<number>;
operator(overrides?: CallOverrides): Promise<string>;
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
denomination(overrides?: CallOverrides): Promise<BigNumber>;
currentRootIndex(overrides?: CallOverrides): Promise<number>;
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<void>;
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<boolean[]>;
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<void>;
getLastRoot(overrides?: CallOverrides): Promise<string>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<number>;
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<boolean>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
ZERO_VALUE(overrides?: CallOverrides): Promise<BigNumber>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<string>;
nextIndex(overrides?: CallOverrides): Promise<number>;
};
filters: {
"Deposit(bytes32,uint32,uint256)"(
commitment?: PromiseOrValue<BytesLike> | null,
leafIndex?: null,
timestamp?: null
): DepositEventFilter;
Deposit(
commitment?: PromiseOrValue<BytesLike> | null,
leafIndex?: null,
timestamp?: null
): DepositEventFilter;
"Withdrawal(address,bytes32,address,uint256)"(
to?: null,
nullifierHash?: null,
relayer?: PromiseOrValue<string> | null,
fee?: null
): WithdrawalEventFilter;
Withdrawal(
to?: null,
nullifierHash?: null,
relayer?: PromiseOrValue<string> | null,
fee?: null
): WithdrawalEventFilter;
};
estimateGas: {
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
verifier(overrides?: CallOverrides): Promise<BigNumber>;
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
FIELD_SIZE(overrides?: CallOverrides): Promise<BigNumber>;
levels(overrides?: CallOverrides): Promise<BigNumber>;
operator(overrides?: CallOverrides): Promise<BigNumber>;
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
denomination(overrides?: CallOverrides): Promise<BigNumber>;
currentRootIndex(overrides?: CallOverrides): Promise<BigNumber>;
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<BigNumber>;
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
getLastRoot(overrides?: CallOverrides): Promise<BigNumber>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<BigNumber>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<BigNumber>;
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<BigNumber>;
ZERO_VALUE(overrides?: CallOverrides): Promise<BigNumber>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<BigNumber>;
nextIndex(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
changeOperator(
_newOperator: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
nullifierHashes(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
withdraw(
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
verifier(overrides?: CallOverrides): Promise<PopulatedTransaction>;
hashLeftRight(
_left: PromiseOrValue<BytesLike>,
_right: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
FIELD_SIZE(overrides?: CallOverrides): Promise<PopulatedTransaction>;
levels(overrides?: CallOverrides): Promise<PopulatedTransaction>;
operator(overrides?: CallOverrides): Promise<PopulatedTransaction>;
isKnownRoot(
_root: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
commitments(
arg0: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
denomination(overrides?: CallOverrides): Promise<PopulatedTransaction>;
currentRootIndex(overrides?: CallOverrides): Promise<PopulatedTransaction>;
updateVerifier(
_newVerifier: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
isSpentArray(
_nullifierHashes: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
deposit(
_commitment: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
getLastRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
roots(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
ROOT_HISTORY_SIZE(overrides?: CallOverrides): Promise<PopulatedTransaction>;
isSpent(
_nullifierHash: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
zeros(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
ZERO_VALUE(overrides?: CallOverrides): Promise<PopulatedTransaction>;
filledSubtrees(
arg0: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
nextIndex(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

View File

@ -0,0 +1,452 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
BaseContract,
BigNumber,
BigNumberish,
BytesLike,
CallOverrides,
ContractTransaction,
Overrides,
PayableOverrides,
PopulatedTransaction,
Signer,
utils,
} from "ethers";
import type {
FunctionFragment,
Result,
EventFragment,
} from "@ethersproject/abi";
import type { Listener, Provider } from "@ethersproject/providers";
import type {
TypedEventFilter,
TypedEvent,
TypedListener,
OnEvent,
PromiseOrValue,
} from "./common";
export interface TornadoProxyInterface extends utils.Interface {
functions: {
"bulkResolve(bytes32[])": FunctionFragment;
"governance()": FunctionFragment;
"instances(address)": FunctionFragment;
"resolve(bytes32)": FunctionFragment;
"tornadoTrees()": FunctionFragment;
"deposit(address,bytes32,bytes)": FunctionFragment;
"updateInstance(address,bool)": FunctionFragment;
"withdraw(address,bytes,bytes32,bytes32,address,address,uint256,uint256)": FunctionFragment;
"rescueTokens(address,address,uint256)": FunctionFragment;
};
getFunction(
nameOrSignatureOrTopic:
| "bulkResolve"
| "governance"
| "instances"
| "resolve"
| "tornadoTrees"
| "deposit"
| "updateInstance"
| "withdraw"
| "rescueTokens"
): FunctionFragment;
encodeFunctionData(
functionFragment: "bulkResolve",
values: [PromiseOrValue<BytesLike>[]]
): string;
encodeFunctionData(
functionFragment: "governance",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "instances",
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(
functionFragment: "resolve",
values: [PromiseOrValue<BytesLike>]
): string;
encodeFunctionData(
functionFragment: "tornadoTrees",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "deposit",
values: [
PromiseOrValue<string>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>
]
): string;
encodeFunctionData(
functionFragment: "updateInstance",
values: [PromiseOrValue<string>, PromiseOrValue<boolean>]
): string;
encodeFunctionData(
functionFragment: "withdraw",
values: [
PromiseOrValue<string>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>,
PromiseOrValue<BytesLike>,
PromiseOrValue<string>,
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>,
PromiseOrValue<BigNumberish>
]
): string;
encodeFunctionData(
functionFragment: "rescueTokens",
values: [
PromiseOrValue<string>,
PromiseOrValue<string>,
PromiseOrValue<BigNumberish>
]
): string;
decodeFunctionResult(
functionFragment: "bulkResolve",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "governance", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "instances", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "resolve", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "tornadoTrees",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "deposit", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "updateInstance",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "rescueTokens",
data: BytesLike
): Result;
events: {
"EncryptedNote(address,bytes)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "EncryptedNote"): EventFragment;
}
export interface EncryptedNoteEventObject {
sender: string;
encryptedNote: string;
}
export type EncryptedNoteEvent = TypedEvent<
[string, string],
EncryptedNoteEventObject
>;
export type EncryptedNoteEventFilter = TypedEventFilter<EncryptedNoteEvent>;
export interface TornadoProxy extends BaseContract {
contractName: "TornadoProxy";
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
interface: TornadoProxyInterface;
queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TEvent>>;
listeners<TEvent extends TypedEvent>(
eventFilter?: TypedEventFilter<TEvent>
): Array<TypedListener<TEvent>>;
listeners(eventName?: string): Array<Listener>;
removeAllListeners<TEvent extends TypedEvent>(
eventFilter: TypedEventFilter<TEvent>
): this;
removeAllListeners(eventName?: string): this;
off: OnEvent<this>;
on: OnEvent<this>;
once: OnEvent<this>;
removeListener: OnEvent<this>;
functions: {
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<[string[]] & { result: string[] }>;
governance(overrides?: CallOverrides): Promise<[string]>;
instances(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<[boolean]>;
resolve(
node: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<[string]>;
tornadoTrees(overrides?: CallOverrides): Promise<[string]>;
deposit(
_tornado: PromiseOrValue<string>,
_commitment: PromiseOrValue<BytesLike>,
_encryptedNote: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
updateInstance(
_instance: PromiseOrValue<string>,
_update: PromiseOrValue<boolean>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
withdraw(
_tornado: PromiseOrValue<string>,
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
rescueTokens(
_token: PromiseOrValue<string>,
_to: PromiseOrValue<string>,
_balance: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
};
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<string[]>;
governance(overrides?: CallOverrides): Promise<string>;
instances(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<boolean>;
resolve(
node: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<string>;
tornadoTrees(overrides?: CallOverrides): Promise<string>;
deposit(
_tornado: PromiseOrValue<string>,
_commitment: PromiseOrValue<BytesLike>,
_encryptedNote: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
updateInstance(
_instance: PromiseOrValue<string>,
_update: PromiseOrValue<boolean>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
withdraw(
_tornado: PromiseOrValue<string>,
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
rescueTokens(
_token: PromiseOrValue<string>,
_to: PromiseOrValue<string>,
_balance: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
callStatic: {
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<string[]>;
governance(overrides?: CallOverrides): Promise<string>;
instances(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<boolean>;
resolve(
node: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<string>;
tornadoTrees(overrides?: CallOverrides): Promise<string>;
deposit(
_tornado: PromiseOrValue<string>,
_commitment: PromiseOrValue<BytesLike>,
_encryptedNote: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<void>;
updateInstance(
_instance: PromiseOrValue<string>,
_update: PromiseOrValue<boolean>,
overrides?: CallOverrides
): Promise<void>;
withdraw(
_tornado: PromiseOrValue<string>,
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>;
rescueTokens(
_token: PromiseOrValue<string>,
_to: PromiseOrValue<string>,
_balance: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>;
};
filters: {
"EncryptedNote(address,bytes)"(
sender?: PromiseOrValue<string> | null,
encryptedNote?: null
): EncryptedNoteEventFilter;
EncryptedNote(
sender?: PromiseOrValue<string> | null,
encryptedNote?: null
): EncryptedNoteEventFilter;
};
estimateGas: {
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<BigNumber>;
governance(overrides?: CallOverrides): Promise<BigNumber>;
instances(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<BigNumber>;
resolve(
node: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<BigNumber>;
tornadoTrees(overrides?: CallOverrides): Promise<BigNumber>;
deposit(
_tornado: PromiseOrValue<string>,
_commitment: PromiseOrValue<BytesLike>,
_encryptedNote: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
updateInstance(
_instance: PromiseOrValue<string>,
_update: PromiseOrValue<boolean>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
withdraw(
_tornado: PromiseOrValue<string>,
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
rescueTokens(
_token: PromiseOrValue<string>,
_to: PromiseOrValue<string>,
_balance: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
};
populateTransaction: {
bulkResolve(
domains: PromiseOrValue<BytesLike>[],
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
governance(overrides?: CallOverrides): Promise<PopulatedTransaction>;
instances(
arg0: PromiseOrValue<string>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
resolve(
node: PromiseOrValue<BytesLike>,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
tornadoTrees(overrides?: CallOverrides): Promise<PopulatedTransaction>;
deposit(
_tornado: PromiseOrValue<string>,
_commitment: PromiseOrValue<BytesLike>,
_encryptedNote: PromiseOrValue<BytesLike>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
updateInstance(
_instance: PromiseOrValue<string>,
_update: PromiseOrValue<boolean>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
withdraw(
_tornado: PromiseOrValue<string>,
_proof: PromiseOrValue<BytesLike>,
_root: PromiseOrValue<BytesLike>,
_nullifierHash: PromiseOrValue<BytesLike>,
_recipient: PromiseOrValue<string>,
_relayer: PromiseOrValue<string>,
_fee: PromiseOrValue<BigNumberish>,
_refund: PromiseOrValue<BigNumberish>,
overrides?: PayableOverrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
rescueTokens(
_token: PromiseOrValue<string>,
_to: PromiseOrValue<string>,
_balance: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
};
}

View File

@ -0,0 +1,46 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type { Listener } from "@ethersproject/providers";
import type { Event, EventFilter } from "ethers";
export interface TypedEvent<
TArgsArray extends Array<any> = any,
TArgsObject = any
> extends Event {
args: TArgsArray & TArgsObject;
}
export interface TypedEventFilter<_TEvent extends TypedEvent>
extends EventFilter {}
export interface TypedListener<TEvent extends TypedEvent> {
(...listenerArg: [...__TypechainArgsArray<TEvent>, TEvent]): void;
}
type __TypechainArgsArray<T> = T extends TypedEvent<infer U> ? U : never;
export interface OnEvent<TRes> {
<TEvent extends TypedEvent>(
eventFilter: TypedEventFilter<TEvent>,
listener: TypedListener<TEvent>
): TRes;
(eventName: string, listener: Listener): TRes;
}
export type MinEthersFactory<C, ARGS> = {
deploy(...a: ARGS[]): Promise<C>;
};
export type GetContractTypeFromFactory<F> = F extends MinEthersFactory<
infer C,
any
>
? C
: never;
export type GetARGsTypeFromFactory<F> = F extends MinEthersFactory<any, any>
? Parameters<F["deploy"]>
: never;
export type PromiseOrValue<T> = T | Promise<T>;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,231 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from "ethers";
import type { Provider } from "@ethersproject/providers";
import type { ERC20, ERC20Interface } from "../ERC20";
const _abi = [
{
constant: true,
inputs: [],
name: "totalSupply",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [],
name: "_totalSupply",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [
{
internalType: "address",
name: "who",
type: "address",
},
],
name: "balanceOf",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: false,
inputs: [
{
internalType: "address",
name: "to",
type: "address",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
],
name: "transfer",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "owner",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "spender",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "value",
type: "uint256",
},
],
name: "Approval",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "from",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "to",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "value",
type: "uint256",
},
],
name: "Transfer",
type: "event",
},
{
constant: true,
inputs: [
{
internalType: "address",
name: "owner",
type: "address",
},
{
internalType: "address",
name: "spender",
type: "address",
},
],
name: "allowance",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: false,
inputs: [
{
internalType: "address",
name: "from",
type: "address",
},
{
internalType: "address",
name: "to",
type: "address",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
],
name: "transferFrom",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function",
},
{
constant: false,
inputs: [
{
internalType: "address",
name: "spender",
type: "address",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
],
name: "approve",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "owner",
type: "address",
},
],
name: "nonces",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
] as const;
export class ERC20__factory {
static readonly abi = _abi;
static createInterface(): ERC20Interface {
return new utils.Interface(_abi) as ERC20Interface;
}
static connect(address: string, signerOrProvider: Signer | Provider): ERC20 {
return new Contract(address, _abi, signerOrProvider) as ERC20;
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,464 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from "ethers";
import type { Provider } from "@ethersproject/providers";
import type {
Multicall3Contract,
Multicall3ContractInterface,
} from "../Multicall3Contract";
const _abi = [
{
inputs: [
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
],
internalType: "struct Multicall3.Call[]",
name: "calls",
type: "tuple[]",
},
],
name: "aggregate",
outputs: [
{
internalType: "uint256",
name: "blockNumber",
type: "uint256",
},
{
internalType: "bytes[]",
name: "returnData",
type: "bytes[]",
},
],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bool",
name: "allowFailure",
type: "bool",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
],
internalType: "struct Multicall3.Call3[]",
name: "calls",
type: "tuple[]",
},
],
name: "aggregate3",
outputs: [
{
components: [
{
internalType: "bool",
name: "success",
type: "bool",
},
{
internalType: "bytes",
name: "returnData",
type: "bytes",
},
],
internalType: "struct Multicall3.Result[]",
name: "returnData",
type: "tuple[]",
},
],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bool",
name: "allowFailure",
type: "bool",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
],
internalType: "struct Multicall3.Call3Value[]",
name: "calls",
type: "tuple[]",
},
],
name: "aggregate3Value",
outputs: [
{
components: [
{
internalType: "bool",
name: "success",
type: "bool",
},
{
internalType: "bytes",
name: "returnData",
type: "bytes",
},
],
internalType: "struct Multicall3.Result[]",
name: "returnData",
type: "tuple[]",
},
],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
],
internalType: "struct Multicall3.Call[]",
name: "calls",
type: "tuple[]",
},
],
name: "blockAndAggregate",
outputs: [
{
internalType: "uint256",
name: "blockNumber",
type: "uint256",
},
{
internalType: "bytes32",
name: "blockHash",
type: "bytes32",
},
{
components: [
{
internalType: "bool",
name: "success",
type: "bool",
},
{
internalType: "bytes",
name: "returnData",
type: "bytes",
},
],
internalType: "struct Multicall3.Result[]",
name: "returnData",
type: "tuple[]",
},
],
stateMutability: "payable",
type: "function",
},
{
inputs: [],
name: "getBasefee",
outputs: [
{
internalType: "uint256",
name: "basefee",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "blockNumber",
type: "uint256",
},
],
name: "getBlockHash",
outputs: [
{
internalType: "bytes32",
name: "blockHash",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getBlockNumber",
outputs: [
{
internalType: "uint256",
name: "blockNumber",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getChainId",
outputs: [
{
internalType: "uint256",
name: "chainid",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getCurrentBlockCoinbase",
outputs: [
{
internalType: "address",
name: "coinbase",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getCurrentBlockDifficulty",
outputs: [
{
internalType: "uint256",
name: "difficulty",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getCurrentBlockGasLimit",
outputs: [
{
internalType: "uint256",
name: "gaslimit",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getCurrentBlockTimestamp",
outputs: [
{
internalType: "uint256",
name: "timestamp",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "addr",
type: "address",
},
],
name: "getEthBalance",
outputs: [
{
internalType: "uint256",
name: "balance",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getLastBlockHash",
outputs: [
{
internalType: "bytes32",
name: "blockHash",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bool",
name: "requireSuccess",
type: "bool",
},
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
],
internalType: "struct Multicall3.Call[]",
name: "calls",
type: "tuple[]",
},
],
name: "tryAggregate",
outputs: [
{
components: [
{
internalType: "bool",
name: "success",
type: "bool",
},
{
internalType: "bytes",
name: "returnData",
type: "bytes",
},
],
internalType: "struct Multicall3.Result[]",
name: "returnData",
type: "tuple[]",
},
],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "bool",
name: "requireSuccess",
type: "bool",
},
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
],
internalType: "struct Multicall3.Call[]",
name: "calls",
type: "tuple[]",
},
],
name: "tryBlockAndAggregate",
outputs: [
{
internalType: "uint256",
name: "blockNumber",
type: "uint256",
},
{
internalType: "bytes32",
name: "blockHash",
type: "bytes32",
},
{
components: [
{
internalType: "bool",
name: "success",
type: "bool",
},
{
internalType: "bytes",
name: "returnData",
type: "bytes",
},
],
internalType: "struct Multicall3.Result[]",
name: "returnData",
type: "tuple[]",
},
],
stateMutability: "payable",
type: "function",
},
] as const;
export class Multicall3Contract__factory {
static readonly abi = _abi;
static createInterface(): Multicall3ContractInterface {
return new utils.Interface(_abi) as Multicall3ContractInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): Multicall3Contract {
return new Contract(address, _abi, signerOrProvider) as Multicall3Contract;
}
}

View File

@ -0,0 +1,165 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from "ethers";
import type { Provider } from "@ethersproject/providers";
import type {
MulticallContract,
MulticallContractInterface,
} from "../MulticallContract";
const _abi = [
{
inputs: [
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
],
internalType: "struct Multicall.Call[]",
name: "calls",
type: "tuple[]",
},
],
name: "aggregate",
outputs: [
{
internalType: "uint256",
name: "blockNumber",
type: "uint256",
},
{
internalType: "bytes[]",
name: "returnData",
type: "bytes[]",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "blockNumber",
type: "uint256",
},
],
name: "getBlockHash",
outputs: [
{
internalType: "bytes32",
name: "blockHash",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getCurrentBlockCoinbase",
outputs: [
{
internalType: "address",
name: "coinbase",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getCurrentBlockDifficulty",
outputs: [
{
internalType: "uint256",
name: "difficulty",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getCurrentBlockGasLimit",
outputs: [
{
internalType: "uint256",
name: "gaslimit",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getCurrentBlockTimestamp",
outputs: [
{
internalType: "uint256",
name: "timestamp",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "addr",
type: "address",
},
],
name: "getEthBalance",
outputs: [
{
internalType: "uint256",
name: "balance",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getLastBlockHash",
outputs: [
{
internalType: "bytes32",
name: "blockHash",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
] as const;
export class MulticallContract__factory {
static readonly abi = _abi;
static createInterface(): MulticallContractInterface {
return new utils.Interface(_abi) as MulticallContractInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): MulticallContract {
return new Contract(address, _abi, signerOrProvider) as MulticallContract;
}
}

View File

@ -0,0 +1,694 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from "ethers";
import type { Provider } from "@ethersproject/providers";
import type {
RelayerRegistryAbi,
RelayerRegistryAbiInterface,
} from "../RelayerRegistryAbi";
const _abi = [
{
inputs: [
{
internalType: "address",
name: "_torn",
type: "address",
},
{
internalType: "address",
name: "_governance",
type: "address",
},
{
internalType: "address",
name: "_ens",
type: "address",
},
{
internalType: "bytes32",
name: "_staking",
type: "bytes32",
},
{
internalType: "bytes32",
name: "_feeManager",
type: "bytes32",
},
],
stateMutability: "nonpayable",
type: "constructor",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "uint256",
name: "minStakeAmount",
type: "uint256",
},
],
name: "MinimumStakeAmount",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "relayer",
type: "address",
},
],
name: "RelayerBalanceNullified",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "bytes32",
name: "relayer",
type: "bytes32",
},
{
indexed: false,
internalType: "string",
name: "ensName",
type: "string",
},
{
indexed: false,
internalType: "address",
name: "relayerAddress",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "stakedAmount",
type: "uint256",
},
],
name: "RelayerRegistered",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "tornadoRouter",
type: "address",
},
],
name: "RouterRegistered",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "relayer",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "amountStakeAdded",
type: "uint256",
},
],
name: "StakeAddedToRelayer",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "relayer",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "amountBurned",
type: "uint256",
},
],
name: "StakeBurned",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "relayer",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "worker",
type: "address",
},
],
name: "WorkerRegistered",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "relayer",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "worker",
type: "address",
},
],
name: "WorkerUnregistered",
type: "event",
},
{
inputs: [
{
internalType: "bytes32[]",
name: "domains",
type: "bytes32[]",
},
],
name: "bulkResolve",
outputs: [
{
internalType: "address[]",
name: "result",
type: "address[]",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "sender",
type: "address",
},
{
internalType: "address",
name: "relayer",
type: "address",
},
{
internalType: "contract ITornadoInstance",
name: "pool",
type: "address",
},
],
name: "burn",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "ens",
outputs: [
{
internalType: "contract IENS",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "feeManager",
outputs: [
{
internalType: "contract FeeManager",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
],
name: "getRelayerBalance",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
],
name: "getRelayerEnsHash",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "governance",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "_tornadoRouter",
type: "bytes32",
},
],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "toResolve",
type: "address",
},
],
name: "isRelayer",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
{
internalType: "address",
name: "toResolve",
type: "address",
},
],
name: "isRelayerRegistered",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "minStakeAmount",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
],
name: "nullifyBalance",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "string",
name: "ensName",
type: "string",
},
{
internalType: "uint256",
name: "stake",
type: "uint256",
},
{
internalType: "address[]",
name: "workersToRegister",
type: "address[]",
},
],
name: "register",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "string",
name: "ensName",
type: "string",
},
{
internalType: "uint256",
name: "stake",
type: "uint256",
},
{
internalType: "address[]",
name: "workersToRegister",
type: "address[]",
},
{
internalType: "address",
name: "relayer",
type: "address",
},
{
internalType: "uint256",
name: "deadline",
type: "uint256",
},
{
internalType: "uint8",
name: "v",
type: "uint8",
},
{
internalType: "bytes32",
name: "r",
type: "bytes32",
},
{
internalType: "bytes32",
name: "s",
type: "bytes32",
},
],
name: "registerPermit",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
{
internalType: "address",
name: "worker",
type: "address",
},
],
name: "registerWorker",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
name: "relayers",
outputs: [
{
internalType: "uint256",
name: "balance",
type: "uint256",
},
{
internalType: "bytes32",
name: "ensHash",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32",
},
],
name: "resolve",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "minAmount",
type: "uint256",
},
],
name: "setMinStakeAmount",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "tornadoRouterAddress",
type: "address",
},
],
name: "setTornadoRouter",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
{
internalType: "uint256",
name: "stake",
type: "uint256",
},
],
name: "stakeToRelayer",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
{
internalType: "uint256",
name: "stake",
type: "uint256",
},
{
internalType: "address",
name: "staker",
type: "address",
},
{
internalType: "uint256",
name: "deadline",
type: "uint256",
},
{
internalType: "uint8",
name: "v",
type: "uint8",
},
{
internalType: "bytes32",
name: "r",
type: "bytes32",
},
{
internalType: "bytes32",
name: "s",
type: "bytes32",
},
],
name: "stakeToRelayerPermit",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "staking",
outputs: [
{
internalType: "contract ITornadoStakingRewards",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "torn",
outputs: [
{
internalType: "contract TORN",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "tornadoRouter",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "worker",
type: "address",
},
],
name: "unregisterWorker",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
name: "workers",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
] as const;
export class RelayerRegistryAbi__factory {
static readonly abi = _abi;
static createInterface(): RelayerRegistryAbiInterface {
return new utils.Interface(_abi) as RelayerRegistryAbiInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): RelayerRegistryAbi {
return new Contract(address, _abi, signerOrProvider) as RelayerRegistryAbi;
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,543 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from "ethers";
import type { Provider } from "@ethersproject/providers";
import type {
TornadoInstance,
TornadoInstanceInterface,
} from "../TornadoInstance";
const _abi = [
{
constant: false,
inputs: [
{
internalType: "address",
name: "_newOperator",
type: "address",
},
],
name: "changeOperator",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function",
},
{
constant: true,
inputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
name: "nullifierHashes",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: false,
inputs: [
{
internalType: "bytes",
name: "_proof",
type: "bytes",
},
{
internalType: "bytes32",
name: "_root",
type: "bytes32",
},
{
internalType: "bytes32",
name: "_nullifierHash",
type: "bytes32",
},
{
internalType: "address payable",
name: "_recipient",
type: "address",
},
{
internalType: "address payable",
name: "_relayer",
type: "address",
},
{
internalType: "uint256",
name: "_fee",
type: "uint256",
},
{
internalType: "uint256",
name: "_refund",
type: "uint256",
},
],
name: "withdraw",
outputs: [],
payable: true,
stateMutability: "payable",
type: "function",
},
{
constant: true,
inputs: [],
name: "verifier",
outputs: [
{
internalType: "contract IVerifier",
name: "",
type: "address",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [
{
internalType: "bytes32",
name: "_left",
type: "bytes32",
},
{
internalType: "bytes32",
name: "_right",
type: "bytes32",
},
],
name: "hashLeftRight",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
payable: false,
stateMutability: "pure",
type: "function",
},
{
constant: true,
inputs: [],
name: "FIELD_SIZE",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [],
name: "levels",
outputs: [
{
internalType: "uint32",
name: "",
type: "uint32",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [],
name: "operator",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [
{
internalType: "bytes32",
name: "_root",
type: "bytes32",
},
],
name: "isKnownRoot",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
name: "commitments",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [],
name: "denomination",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [],
name: "currentRootIndex",
outputs: [
{
internalType: "uint32",
name: "",
type: "uint32",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: false,
inputs: [
{
internalType: "address",
name: "_newVerifier",
type: "address",
},
],
name: "updateVerifier",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function",
},
{
constant: true,
inputs: [
{
internalType: "bytes32[]",
name: "_nullifierHashes",
type: "bytes32[]",
},
],
name: "isSpentArray",
outputs: [
{
internalType: "bool[]",
name: "spent",
type: "bool[]",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: false,
inputs: [
{
internalType: "bytes32",
name: "_commitment",
type: "bytes32",
},
],
name: "deposit",
outputs: [],
payable: true,
stateMutability: "payable",
type: "function",
},
{
constant: true,
inputs: [],
name: "getLastRoot",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
name: "roots",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [],
name: "ROOT_HISTORY_SIZE",
outputs: [
{
internalType: "uint32",
name: "",
type: "uint32",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [
{
internalType: "bytes32",
name: "_nullifierHash",
type: "bytes32",
},
],
name: "isSpent",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
name: "zeros",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [],
name: "ZERO_VALUE",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
name: "filledSubtrees",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
constant: true,
inputs: [],
name: "nextIndex",
outputs: [
{
internalType: "uint32",
name: "",
type: "uint32",
},
],
payable: false,
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "contract IVerifier",
name: "_verifier",
type: "address",
},
{
internalType: "uint256",
name: "_denomination",
type: "uint256",
},
{
internalType: "uint32",
name: "_merkleTreeHeight",
type: "uint32",
},
{
internalType: "address",
name: "_operator",
type: "address",
},
],
payable: false,
stateMutability: "nonpayable",
type: "constructor",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "commitment",
type: "bytes32",
},
{
indexed: false,
internalType: "uint32",
name: "leafIndex",
type: "uint32",
},
{
indexed: false,
internalType: "uint256",
name: "timestamp",
type: "uint256",
},
],
name: "Deposit",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "to",
type: "address",
},
{
indexed: false,
internalType: "bytes32",
name: "nullifierHash",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "relayer",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "fee",
type: "uint256",
},
],
name: "Withdrawal",
type: "event",
},
] as const;
export class TornadoInstance__factory {
static readonly abi = _abi;
static createInterface(): TornadoInstanceInterface {
return new utils.Interface(_abi) as TornadoInstanceInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): TornadoInstance {
return new Contract(address, _abi, signerOrProvider) as TornadoInstance;
}
}

View File

@ -0,0 +1,258 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from "ethers";
import type { Provider } from "@ethersproject/providers";
import type { TornadoProxy, TornadoProxyInterface } from "../TornadoProxy";
const _abi = [
{
inputs: [
{
internalType: "bytes32",
name: "_tornadoTrees",
type: "bytes32",
},
{
internalType: "bytes32",
name: "_governance",
type: "bytes32",
},
{
internalType: "bytes32[]",
name: "_instances",
type: "bytes32[]",
},
],
stateMutability: "nonpayable",
type: "constructor",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "sender",
type: "address",
},
{
indexed: false,
internalType: "bytes",
name: "encryptedNote",
type: "bytes",
},
],
name: "EncryptedNote",
type: "event",
},
{
inputs: [
{
internalType: "bytes32[]",
name: "domains",
type: "bytes32[]",
},
],
name: "bulkResolve",
outputs: [
{
internalType: "address[]",
name: "result",
type: "address[]",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "governance",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "contract ITornadoInstance",
name: "",
type: "address",
},
],
name: "instances",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32",
},
],
name: "resolve",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "tornadoTrees",
outputs: [
{
internalType: "contract ITornadoTrees",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "contract ITornadoInstance",
name: "_tornado",
type: "address",
},
{
internalType: "bytes32",
name: "_commitment",
type: "bytes32",
},
{
internalType: "bytes",
name: "_encryptedNote",
type: "bytes",
},
],
name: "deposit",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "contract ITornadoInstance",
name: "_instance",
type: "address",
},
{
internalType: "bool",
name: "_update",
type: "bool",
},
],
name: "updateInstance",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "contract ITornadoInstance",
name: "_tornado",
type: "address",
},
{
internalType: "bytes",
name: "_proof",
type: "bytes",
},
{
internalType: "bytes32",
name: "_root",
type: "bytes32",
},
{
internalType: "bytes32",
name: "_nullifierHash",
type: "bytes32",
},
{
internalType: "address payable",
name: "_recipient",
type: "address",
},
{
internalType: "address payable",
name: "_relayer",
type: "address",
},
{
internalType: "uint256",
name: "_fee",
type: "uint256",
},
{
internalType: "uint256",
name: "_refund",
type: "uint256",
},
],
name: "withdraw",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "contract IERC20",
name: "_token",
type: "address",
},
{
internalType: "address payable",
name: "_to",
type: "address",
},
{
internalType: "uint256",
name: "_balance",
type: "uint256",
},
],
name: "rescueTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
] as const;
export class TornadoProxy__factory {
static readonly abi = _abi;
static createInterface(): TornadoProxyInterface {
return new utils.Interface(_abi) as TornadoProxyInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): TornadoProxy {
return new Contract(address, _abi, signerOrProvider) as TornadoProxy;
}
}

View File

@ -0,0 +1,12 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
export { ERC20__factory } from "./ERC20__factory";
export { ERC20Mock__factory } from "./ERC20Mock__factory";
export { ERC20Tornado__factory } from "./ERC20Tornado__factory";
export { ETHTornado__factory } from "./ETHTornado__factory";
export { Multicall3Contract__factory } from "./Multicall3Contract__factory";
export { MulticallContract__factory } from "./MulticallContract__factory";
export { RelayerRegistry__factory } from "./RelayerRegistry__factory";
export { TornadoInstance__factory } from "./TornadoInstance__factory";
export { TornadoProxy__factory } from "./TornadoProxy__factory";

View File

@ -0,0 +1,22 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
export type { ERC20 } from "./ERC20";
export type { ERC20Mock } from "./ERC20Mock";
export type { ERC20Tornado } from "./ERC20Tornado";
export type { ETHTornado } from "./ETHTornado";
export type { Multicall3Contract } from "./Multicall3Contract";
export type { MulticallContract } from "./MulticallContract";
export type { RelayerRegistry } from "./RelayerRegistry";
export type { TornadoInstance } from "./TornadoInstance";
export type { TornadoProxy } from "./TornadoProxy";
export * as factories from "./factories";
export { ERC20__factory } from "./factories/ERC20__factory";
export { ERC20Mock__factory } from "./factories/ERC20Mock__factory";
export { ERC20Tornado__factory } from "./factories/ERC20Tornado__factory";
export { ETHTornado__factory } from "./factories/ETHTornado__factory";
export { Multicall3Contract__factory } from "./factories/Multicall3Contract__factory";
export { MulticallContract__factory } from "./factories/MulticallContract__factory";
export { RelayerRegistry__factory } from "./factories/RelayerRegistry__factory";
export { TornadoInstance__factory } from "./factories/TornadoInstance__factory";
export { TornadoProxy__factory } from "./factories/TornadoProxy__factory";

View File

@ -0,0 +1,178 @@
// ts-essentials
import { DeepRequired, Merge } from 'ts-essentials'
// Contract types
import { RelayerRegistry } from './deth/RelayerRegistry.js'
// Local imports
import { AsyncUtils, ErrorUtils } from '@tornado/sdk-utils'
import { Docs, Cache, Onchain, Options as DataOptions } from '@tornado/sdk-data'
import { Chain, Synchronizer, Options as ChainOptions, syncErrorHandler } from '@tornado/sdk-chain'
// @ts-ignore
import { toIndexableString } from 'pouchdb-collate'
import { match } from 'assert'
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECLARATIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export namespace Options {
export type Cache = DataOptions.Cache
export type Sync = ChainOptions.Sync
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ IMPLEMENTATIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export class Registrations extends Docs.Base {}
export class Stakes extends Docs.Base {}
export class Burns extends Docs.Base {}
export class RegistrationsCache extends Cache.Syncable<Registrations> {
// TODO: IMPLEMENT
buildDoc(response: any): Docs.Withdrawal {
return new Docs.Withdrawal(response)
}
getErrorHandlers(): Array<AsyncUtils.ErrorHandler> {
return [syncErrorHandler]
}
getCallbacks(registry: RelayerRegistry): Array<AsyncUtils.Callback> {
return [
(fromBlock: number, toBlock: number) => {
return registry.queryFilter(
registry.filters['RelayerRegistered(bytes32,string,address,uint256)'](null, null, null, null),
fromBlock,
toBlock
)
}
]
}
}
export class StakesCache extends Cache.Syncable<Stakes> {
// TODO: IMPLEMENT
buildDoc(response: any): Docs.Withdrawal {
return new Docs.Withdrawal(response)
}
getErrorHandlers(): Array<AsyncUtils.ErrorHandler> {
return [syncErrorHandler]
}
getCallbacks(registry: RelayerRegistry): Array<AsyncUtils.Callback> {
return [
(fromBlock: number, toBlock: number) => {
return registry.queryFilter(
registry.filters['StakeAddedToRelayer(address,uint256)'](null, null),
fromBlock,
toBlock
)
}
]
}
}
export class BurnsCache extends Cache.Syncable<Burns> {
// TODO: IMPLEMENT
buildDoc(response: any): Docs.Withdrawal {
return new Docs.Withdrawal(response)
}
getErrorHandlers(): Array<AsyncUtils.ErrorHandler> {
return [syncErrorHandler]
}
getCallbacks(registry: RelayerRegistry): Array<AsyncUtils.Callback> {
return [
(fromBlock: number, toBlock: number) => {
return registry.queryFilter(
registry.filters['StakeBurned(address,uint256)'](null, null),
fromBlock,
toBlock
)
}
]
}
}
export class Registry extends Synchronizer {
private _chain?: Chain
get chain(): Chain {
this._checkProvider('chain')
return this._chain!
}
constructor() {
super()
this.caches = new Map<string, Cache.Syncable<Docs.Base>>()
}
loadRegistrations(name: string, options?: Options.Cache): RegistrationsCache {
return this.loadCache<Registrations, RegistrationsCache>(name, options)
}
loadStakes(name: string, options?: Options.Cache): StakesCache {
return this.loadCache<Stakes, StakesCache>(name, options)
}
loadBurns(name: string, options?: Options.Cache): BurnsCache {
return this.loadCache<Burns, BurnsCache>(name, options)
}
loadCache<D extends Docs.Base, C extends Cache.Syncable<D> = Cache.Syncable<D>>(
name: string,
options?: Options.Cache
): C {
let constructor,
cache = super.loadCache(name)
if (!cache) {
const regexp = /([A-Za-z]+)([0-9]+)/
const matches = name.match(regexp)
if (!matches)
throw ErrorUtils.getError(`Registry.loadCache: name ${name} has wrong format for cache`)
// ETH net id
if (matches.length === 2)
name += "1"
if (matches[1] === 'Registrations') {
constructor = (name: string, options?: Options.Cache) => new RegistrationsCache(name, options)
} else if (matches[1] === 'Burns') {
constructor = (name: string, options?: Options.Cache) => new BurnsCache(name, options)
} else if (matches[1] === 'Stakes') {
constructor = (name: string, options?: Options.Cache) => new StakesCache(name, options)
} else throw ErrorUtils.getError(`Registry.loadCache: there exists no such event ${matches[1]}`)
cache = constructor(name, options)
this.caches.set(name, cache)
}
return cache as C
}
// TODO: FINISH
async _sync(
event: string,
networkId?: string,
options?: Merge<Options.Sync, Options.Cache>
): Promise<void> {
networkId = networkId ?? '1'
if (this.chain.id !== +networkId)
throw ErrorUtils.getError('Registry.syncRegistrations: provider bound to wrong chain!')
const registryAddress = await Onchain.getRegistryAddress(networkId)
options = options ?? {}
options.startBlock = options.startBlock ?? (await Onchain.getRegistryDeployBlockNum(networkId))
}
private _checkProvider(parentCallName: string): void {
if (!this._chain)
throw ErrorUtils.getError('Core.' + parentCallName + ': you must first connect a provider!')
}
protected async _populateSyncOptions(options: Options.Sync): Promise<DeepRequired<Options.Sync>> {
options.targetBlock = options.targetBlock ?? (await this.chain.latestBlockNum())
return super._populateSyncOptions(options)
}
}

View File

@ -0,0 +1,32 @@
{
"include": ["./src"],
"exclude": ["node_modules"],
"ts-node": {
// Do not forget to `npm i -D tsconfig-paths`
"require": ["tsconfig-paths/register"]
},
"compilerOptions": {
// ~~~~~~~~~~~~~~~~~~~~~~~~~NODE 18 STANDARD~~~~~~~~~~~~~~~~~~~~~~~
"target": "es2022",
"module": "CommonJS",
"lib": ["es2022"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node",
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"outDir": "./dist",
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"allowSyntheticDefaultImports": true,
"checkJs": true,
"allowJs": true,
"baseUrl": ".",
"paths": {
"test/*": ["test/*"],
"src/*": ["src/*"]
}
}
}

View File

@ -1,6 +1,6 @@
ISC License
Copyright 2023 T-Hax
Copyright 2023 AlienTornadosaurusHex
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

View File

@ -1,11 +1,11 @@
{
"name": "@tornado/sdk-utils",
"author": "T-Hax",
"author": "AlienTornadosaurusHex",
"license": "ISC",
"description": "Tornado SDK general utilities.",
"repository": {
"type": "git",
"url": "https://development.tornadocash.community/T-Hax/sdk-monorepo"
"url": "https://development.tornadocash.community/AlienTornadosaurusHex/sdk-monorepo"
},
"homepage": "https://tornadocash.community",
"keywords": [

View File

@ -1,6 +1,6 @@
ISC License
Copyright 2023 T-Hax
Copyright 2023 AlienTornadosaurusHex
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

View File

@ -1,11 +1,11 @@
{
"name": "@tornado/sdk-web",
"author": "T-Hax",
"author": "AlienTornadosaurusHex",
"license": "ISC",
"description": "Tornado SDK web utilities.",
"repository": {
"type": "git",
"url": "https://development.tornadocash.community/T-Hax/sdk-utils"
"url": "https://development.tornadocash.community/AlienTornadosaurusHex/sdk-utils"
},
"homepage": "https://tornadocash.community",
"keywords": [

View File

@ -1,6 +1,6 @@
ISC License
Copyright 2023 T-Hax
Copyright 2023 AlienTornadosaurusHex
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

View File

@ -1,11 +1,11 @@
{
"name": "@tornado/sdk",
"author": "T-Hax",
"author": "AlienTornadosaurusHex",
"license": "ISC",
"description": "The Tornado SDK.",
"repository": {
"type": "git",
"url": "https://development.tornadocash.community/T-Hax/sdk-monorepo"
"url": "https://development.tornadocash.community/AlienTornadosaurusHex/sdk-monorepo"
},
"homepage": "https://tornadocash.community",
"keywords": [

679
abis/RelayerRegistry.json Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,10 @@
{
"name": "@tornado/sdk-monorepo",
"author": "T-Hax",
"author": "AlienTornadosaurusHex",
"license": "ISC",
"description": "Tornado SDK monorepo.",
"repository": "https://development.tornadocash.community/T-Hax/sdk",
"homepage": "https://tornadocash.community",
"repository": "https://development.tornadocash.community/AlienTornadosaurusHex/sdk",
"homepage": "https://tornado.ws",
"keywords": [
"ethereum",
"crypto",
@ -70,6 +70,7 @@
"format:crypto": "yarn workspace @tornado/sdk-crypto run format",
"format:chain": "yarn workspace @tornado/sdk-chain run format",
"format:utils": "yarn workspace @tornado/sdk-utils run format",
"format:registry": "yarn workspace @tornado/sdk-registry run format",
"docs": "yarn workspace @tornado/sdk run typedoc --out ../../docs/api src/index.ts",
"compile": "yarn workspaces foreach run build",
"compile:sdk": "yarn workspace @tornado/sdk build",
@ -79,6 +80,7 @@
"compile:crypto": "yarn workspace @tornado/sdk-crypto build",
"compile:chain": "yarn workspace @tornado/sdk-chain build",
"compile:utils": "yarn workspace @tornado/sdk-utils build",
"compile:registry": "yarn workspace @tornado/sdk-registry build",
"prepare": "yarn workspaces foreach run format && yarn workspaces foreach run build",
"prepare:sdk": "yarn format:sdk && yarn compile:sdk",
"prepare:core": "yarn format:core && yarn compile:core",
@ -87,10 +89,12 @@
"prepare:crypto": "yarn format:crypto && yarn compile:crypto",
"prepare:chain": "yarn format:chain && yarn compile:chain",
"prepare:utils": "yarn format:utils && yarn compile:utils",
"typechain": "yarn typechain:test && yarn typechain:core && yarn typechain:chain",
"prepare:registry": "yarn format:registry && yarn compile:registry",
"typechain": "yarn typechain:test && yarn typechain:core && yarn typechain:chain && yarn typechain:registry",
"typechain:test": "typechain --target \"ethers-v5\" --discriminate-types --glob \"./abis/*.json\" --out-dir=\"./test/deth\"",
"typechain:core": "typechain --target \"ethers-v5\" --discriminate-types --glob \"./abis/*.json\" --out-dir=\"./@tornado/sdk-core/src/deth\"",
"typechain:chain": "typechain --target \"ethers-v5\" --discriminate-types --glob \"./abis/*.json\" --out-dir=\"./@tornado/sdk-chain/src/deth\"",
"typechain:registry": "typechain --target \"ethers-v5\" --discriminate-types --glob \"./abis/*.json\" --out-dir=\"./@tornado/sdk-registry/src/deth\"",
"packall": "mkdir -p packages && yarn workspaces foreach --no-private pack --out \"../../packages/%s-@%v.zip\" && rename -a '@' '' packages/*"
},
"publishConfig": {

1138
test/deth/RelayerRegistry.ts Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,694 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from "ethers";
import type { Provider } from "@ethersproject/providers";
import type {
RelayerRegistryAbi,
RelayerRegistryAbiInterface,
} from "../RelayerRegistryAbi";
const _abi = [
{
inputs: [
{
internalType: "address",
name: "_torn",
type: "address",
},
{
internalType: "address",
name: "_governance",
type: "address",
},
{
internalType: "address",
name: "_ens",
type: "address",
},
{
internalType: "bytes32",
name: "_staking",
type: "bytes32",
},
{
internalType: "bytes32",
name: "_feeManager",
type: "bytes32",
},
],
stateMutability: "nonpayable",
type: "constructor",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "uint256",
name: "minStakeAmount",
type: "uint256",
},
],
name: "MinimumStakeAmount",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "relayer",
type: "address",
},
],
name: "RelayerBalanceNullified",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "bytes32",
name: "relayer",
type: "bytes32",
},
{
indexed: false,
internalType: "string",
name: "ensName",
type: "string",
},
{
indexed: false,
internalType: "address",
name: "relayerAddress",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "stakedAmount",
type: "uint256",
},
],
name: "RelayerRegistered",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "tornadoRouter",
type: "address",
},
],
name: "RouterRegistered",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "relayer",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "amountStakeAdded",
type: "uint256",
},
],
name: "StakeAddedToRelayer",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "relayer",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "amountBurned",
type: "uint256",
},
],
name: "StakeBurned",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "relayer",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "worker",
type: "address",
},
],
name: "WorkerRegistered",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "relayer",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "worker",
type: "address",
},
],
name: "WorkerUnregistered",
type: "event",
},
{
inputs: [
{
internalType: "bytes32[]",
name: "domains",
type: "bytes32[]",
},
],
name: "bulkResolve",
outputs: [
{
internalType: "address[]",
name: "result",
type: "address[]",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "sender",
type: "address",
},
{
internalType: "address",
name: "relayer",
type: "address",
},
{
internalType: "contract ITornadoInstance",
name: "pool",
type: "address",
},
],
name: "burn",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "ens",
outputs: [
{
internalType: "contract IENS",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "feeManager",
outputs: [
{
internalType: "contract FeeManager",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
],
name: "getRelayerBalance",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
],
name: "getRelayerEnsHash",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "governance",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "_tornadoRouter",
type: "bytes32",
},
],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "toResolve",
type: "address",
},
],
name: "isRelayer",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
{
internalType: "address",
name: "toResolve",
type: "address",
},
],
name: "isRelayerRegistered",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "minStakeAmount",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
],
name: "nullifyBalance",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "string",
name: "ensName",
type: "string",
},
{
internalType: "uint256",
name: "stake",
type: "uint256",
},
{
internalType: "address[]",
name: "workersToRegister",
type: "address[]",
},
],
name: "register",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "string",
name: "ensName",
type: "string",
},
{
internalType: "uint256",
name: "stake",
type: "uint256",
},
{
internalType: "address[]",
name: "workersToRegister",
type: "address[]",
},
{
internalType: "address",
name: "relayer",
type: "address",
},
{
internalType: "uint256",
name: "deadline",
type: "uint256",
},
{
internalType: "uint8",
name: "v",
type: "uint8",
},
{
internalType: "bytes32",
name: "r",
type: "bytes32",
},
{
internalType: "bytes32",
name: "s",
type: "bytes32",
},
],
name: "registerPermit",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
{
internalType: "address",
name: "worker",
type: "address",
},
],
name: "registerWorker",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
name: "relayers",
outputs: [
{
internalType: "uint256",
name: "balance",
type: "uint256",
},
{
internalType: "bytes32",
name: "ensHash",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "node",
type: "bytes32",
},
],
name: "resolve",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "minAmount",
type: "uint256",
},
],
name: "setMinStakeAmount",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "tornadoRouterAddress",
type: "address",
},
],
name: "setTornadoRouter",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
{
internalType: "uint256",
name: "stake",
type: "uint256",
},
],
name: "stakeToRelayer",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "relayer",
type: "address",
},
{
internalType: "uint256",
name: "stake",
type: "uint256",
},
{
internalType: "address",
name: "staker",
type: "address",
},
{
internalType: "uint256",
name: "deadline",
type: "uint256",
},
{
internalType: "uint8",
name: "v",
type: "uint8",
},
{
internalType: "bytes32",
name: "r",
type: "bytes32",
},
{
internalType: "bytes32",
name: "s",
type: "bytes32",
},
],
name: "stakeToRelayerPermit",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "staking",
outputs: [
{
internalType: "contract ITornadoStakingRewards",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "torn",
outputs: [
{
internalType: "contract TORN",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "tornadoRouter",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "worker",
type: "address",
},
],
name: "unregisterWorker",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
name: "workers",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
] as const;
export class RelayerRegistryAbi__factory {
static readonly abi = _abi;
static createInterface(): RelayerRegistryAbiInterface {
return new utils.Interface(_abi) as RelayerRegistryAbiInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): RelayerRegistryAbi {
return new Contract(address, _abi, signerOrProvider) as RelayerRegistryAbi;
}
}

File diff suppressed because one or more lines are too long

View File

@ -7,5 +7,6 @@ export { ERC20Tornado__factory } from "./ERC20Tornado__factory";
export { ETHTornado__factory } from "./ETHTornado__factory";
export { Multicall3Contract__factory } from "./Multicall3Contract__factory";
export { MulticallContract__factory } from "./MulticallContract__factory";
export { RelayerRegistry__factory } from "./RelayerRegistry__factory";
export { TornadoInstance__factory } from "./TornadoInstance__factory";
export { TornadoProxy__factory } from "./TornadoProxy__factory";

View File

@ -7,6 +7,7 @@ export type { ERC20Tornado } from "./ERC20Tornado";
export type { ETHTornado } from "./ETHTornado";
export type { Multicall3Contract } from "./Multicall3Contract";
export type { MulticallContract } from "./MulticallContract";
export type { RelayerRegistry } from "./RelayerRegistry";
export type { TornadoInstance } from "./TornadoInstance";
export type { TornadoProxy } from "./TornadoProxy";
export * as factories from "./factories";
@ -16,5 +17,6 @@ export { ERC20Tornado__factory } from "./factories/ERC20Tornado__factory";
export { ETHTornado__factory } from "./factories/ETHTornado__factory";
export { Multicall3Contract__factory } from "./factories/Multicall3Contract__factory";
export { MulticallContract__factory } from "./factories/MulticallContract__factory";
export { RelayerRegistry__factory } from "./factories/RelayerRegistry__factory";
export { TornadoInstance__factory } from "./factories/TornadoInstance__factory";
export { TornadoProxy__factory } from "./factories/TornadoProxy__factory";

View File

@ -26,6 +26,7 @@
"baseUrl": ".",
"paths": {
"test/*": ["test/*"],
"@tornado/sdk-registry": ["@tornado/sdk-registry/src/index.ts"],
"@tornado/sdk-chain": ["@tornado/sdk-chain/src/index.ts"],
"@tornado/sdk-core": ["@tornado/sdk-core/src/index.ts"],
"@tornado/sdk-crypto": ["@tornado/sdk-crypto/src/index.ts"],

View File

@ -1196,6 +1196,47 @@ __metadata:
languageName: unknown
linkType: soft
"@tornado/sdk-registry@workspace:@tornado/sdk-registry":
version: 0.0.0-use.local
resolution: "@tornado/sdk-registry@workspace:@tornado/sdk-registry"
dependencies:
"@ethersproject/abi": ^5.7.0
"@ethersproject/providers": ^5.7.2
"@tornado/sdk-chain": "workspace:*"
"@tornado/sdk-data": "workspace:*"
"@tornado/sdk-utils": "workspace:*"
"@tornado/sdk-web": "workspace:*"
"@types/big-integer": ^0.0.31
"@types/chai": ^4.2.18
"@types/fs-extra": ^11.0.1
"@types/mocha": ^10.0.1
"@types/node": ^18.15.0
"@typescript-eslint/eslint-plugin": ^5.54.1
"@typescript-eslint/parser": ^5.54.1
chai: ^4.3.4
conventional-changelog-cli: ^2.1.1
dotenv: ^16.0.3
eslint: ^8.35.0
eslint-plugin-prettier: ^4.2.1
ethereum-waffle: ^4.0.10
ethers: ^5
fs-extra: ^11.1.0
mocha: ^10.2.0
pouchdb-collate: ^8.0.1
prettier: ^2.3.0
rimraf: ^5.0.0
source-map-support: ^0.5.19
ts-essentials: ^9.3.1
ts-node: ^10.9.1
tsc-alias: ^1.2.11
tsconfig-paths: ^4.1.2
typescript: ^5.0.4
dependenciesMeta:
tsconfig-paths@4.2.0:
unplugged: true
languageName: unknown
linkType: soft
"@tornado/sdk-utils@workspace:*, @tornado/sdk-utils@workspace:@tornado/sdk-utils":
version: 0.0.0-use.local
resolution: "@tornado/sdk-utils@workspace:@tornado/sdk-utils"