Monorepository has been setup

Signed-off-by: T-Hax <>
This commit is contained in:
T-Hax 2023-05-02 22:19:28 +00:00
parent f88fc5c812
commit 9419f0673c
345 changed files with 988845 additions and 537 deletions

View File

@ -1,13 +1,19 @@
# RPC URLs
ETH_MAINNET_TEST_RPC=
# debug (debug events are logged to console) # debug (debug events are logged to console)
DEBUG= DEBUG=
# use tor (torify tests) # use tor (torify tests)
TORIFY= TORIFY=
# tor port (regular = 9050, browser = 9150) # tor port (regular = 9050, browser = 9150)
TOR_PORT= TOR_PORT=
# RPC URLs
ETH_MAINNET_TEST_RPC=
# Instances to test syncing for
# Must be in order lower to greater
# Tokens (must be in order): ETH,DAI
SYNC_TEST_INSTANCES="1ETH0.1,1DAI100000"
# relayer DOMAIN (the example.xyz in https://example.xyz) for testing # relayer DOMAIN (the example.xyz in https://example.xyz) for testing
TEST_RELAYER_DOMAIN= TEST_RELAYER_DOMAIN=

5
.gitignore vendored
View File

@ -6,9 +6,12 @@
## Personal project folders I'm using ## Personal project folders I'm using
.code
cache cache
vanilla_cache
scripts scripts
packages
reference
references
## We are NOT using Zero-Installs ## We are NOT using Zero-Installs

View File

@ -1,8 +1,7 @@
# file handling # file handling
extension: [ "ts" ] extension: [ "ts" ]
spec: ["src/**/*.test.ts"] spec: ["test/*.ts"]
require: ["ts-node/register", "tsconfig-paths/register.js", "src/test/preload.ts"] require: ["tsconfig-paths/register.js", "test/preload.ts"]
ignore: "src/test/utils.test.ts"
# # This is an example Mocha config containing every Mocha option plus others. # # This is an example Mocha config containing every Mocha option plus others.
# allow-uncaught: false # allow-uncaught: false

File diff suppressed because one or more lines are too long

View File

@ -1,28 +1,13 @@
# So basically, we want to selectively download packages from the Gitea repository but still allow the enableTelemetry: false
# main repositories, so we are going to have to scope OUR packages properly. This means, unless the tornadocash
# Gitea organization defines a default scope, that we'll have to add every user scope. Including my own below.
# Note that all scopes are after @ prefix. So my prefix is @thax
npmScopes: npmScopes:
thax: thax:
npmPublishRegistry: "https://development.tornadocash.community/api/packages/T-Hax/npm/"
npmRegistryServer: "https://development.tornadocash.community/api/packages/T-Hax/npm/" npmRegistryServer: "https://development.tornadocash.community/api/packages/T-Hax/npm/"
# The below can be EXPORTED via some env file which actually exports the variables though tornado:
# Check the env.example, you will notice it's not a regular env npmRegistryServer: "https://development.tornadocash.community/api/packages/T-Hax/npm/"
# So split your env files up, since this is only for manual actions
# npmAuthToken: ${GITEA_AUTH_TOKEN}
# If the following isn't set you won't have a node_modules folder npmPublishRegistry: "https://development.tornadocash.community/api/packages/T-Hax/npm/"
# You might be used to a node_modules folder instead of a pnp or other folder type npmAuthToken: ${GITEA_AUTH_TOKEN}
# If you want to use the new linkers uncomment or change the following
# nodeLinker: "node-modules"
# So the tornadocash org, the person who maintains it, might setup something (in future) like,
# tornadocash:
# npmPublishRegistry: "https://development.tornadocash.community/api/packages/tornadocash/npm/"
# npmRegistryServer: "https://development.tornadocash.community/api/packages/tornadocash/npm/"
# We disable telemetry for obvious reasons.
enableTelemetry: false
packageExtensions: packageExtensions:
"@resolver-engine/imports-fs@*": "@resolver-engine/imports-fs@*":
@ -30,4 +15,8 @@ packageExtensions:
"@resolver-engine/core": "*" "@resolver-engine/core": "*"
"@thax/circomlib@*": "@thax/circomlib@*":
dependencies: dependencies:
"web3-utils": "*" web3-utils: "*"
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

View File

@ -0,0 +1,13 @@
# RPC URLs
ETH_MAINNET_TEST_RPC=
# debug (debug events are logged to console)
DEBUG=
# use tor (torify tests)
TORIFY=
# tor port (regular = 9050, browser = 9150)
TOR_PORT=
# relayer DOMAIN (the example.xyz in https://example.xyz) for testing
TEST_RELAYER_DOMAIN=

View File

@ -0,0 +1,3 @@
build
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-chain/.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-chain/.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
build
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 @@
build
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": []
}

26
@tornado/sdk-chain/.vscode/launch.json vendored Normal file
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,33 @@
# So basically, we want to selectively download packages from the Gitea repository but still allow the
# main repositories, so we are going to have to scope OUR packages properly. This means, unless the tornadocash
# Gitea organization defines a default scope, that we'll have to add every user scope. Including my own below.
# Note that all scopes are after @ prefix. So my prefix is @thax
npmScopes:
thax:
npmPublishRegistry: "https://development.tornadocash.community/api/packages/T-Hax/npm/"
npmRegistryServer: "https://development.tornadocash.community/api/packages/T-Hax/npm/"
# The below can be EXPORTED via some env file which actually exports the variables though
# Check the env.example, you will notice it's not a regular env
# So split your env files up, since this is only for manual actions
# npmAuthToken: ${GITEA_AUTH_TOKEN}
# If the following isn't set you won't have a node_modules folder
# You might be used to a node_modules folder instead of a pnp or other folder type
# If you want to use the new linkers uncomment or change the following
# nodeLinker: "node-modules"
# So the tornadocash org, the person who maintains it, might setup something (in future) like,
# tornadocash:
# npmPublishRegistry: "https://development.tornadocash.community/api/packages/tornadocash/npm/"
# npmRegistryServer: "https://development.tornadocash.community/api/packages/tornadocash/npm/"
# We disable telemetry for obvious reasons.
enableTelemetry: false
packageExtensions:
"@resolver-engine/imports-fs@*":
dependencies:
"@resolver-engine/core": "*"
"@thax/circomlib@*":
dependencies:
"web3-utils": "*"

View File

@ -0,0 +1,7 @@
ISC License
Copyright 2023 T-Hax
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,84 @@
{
"name": "@tornado/sdk-chain",
"author": "T-Hax",
"license": "ISC",
"description": "Tornado SDK blockchain-ethers utilities.",
"repository": "https://development.tornadocash.community/T-Hax/sdk-chain",
"type": "module",
"homepage": "https://tornadocash.community",
"keywords": [
"ethereum",
"crypto",
"zk"
],
"version": "2023.04.28",
"engines": {
"node": "^18"
},
"main": "./build/index.js",
"dependencies": {
"@ethersproject/abi": "^5.7.0",
"@ethersproject/abstract-provider": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@tornado/sdk-data": "workspace:*",
"@tornado/sdk-utils": "workspace:*",
"ethers": "^5",
"pouchdb-collate": "^8.0.1"
},
"devDependencies": {
"@typechain/ethers-v5": "^10.2.0",
"@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",
"@types/pouchdb": "^6.4.0",
"@types/pouchdb-adapter-memory": "^6.1.3",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"@uniswap/default-token-list": "^9.3.0",
"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",
"ganache": "^7.7.7",
"mocha": "^10.2.0",
"prettier": "^2.3.0",
"rimraf": "^4.4.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",
"typechain": "^8.1.1",
"typescript": "^5.0.4"
},
"scripts": {
"test": "npm run build && mocha --inspect --require source-map-support/register --bail ./build/test/",
"typechain": "typechain --target \"ethers-v5\" --discriminate-types --glob \"./src/resources/abis/*.json\" --out-dir=\"./src/types/deth\"",
"build": "rimraf build && tsc && tsc-alias",
"preversion": "npm run lint && npm run build && npm test",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && npm run format && git add -A",
"postversion": "git push --follow-tags && npm publish",
"lint": "eslint --ext ts,js --fix src",
"build-live": "tsc -w && tsc-alias -w",
"clean": "rm -rf --interactive=never cache/*",
"format": "prettier src/**/*.ts -w"
},
"files": [
"build/lib/**/*",
"build/index.*",
"build/types/**/*"
],
"publishConfig": {
"access": "public"
},
"dependenciesMeta": {
"tsconfig-paths@4.2.0": {
"unplugged": true
}
}
}

View File

@ -0,0 +1,321 @@
/* 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,704 @@
/* 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,719 @@
/* 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,705 @@
/* 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,465 @@
/* 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,214 @@
/* 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>
}
}

View File

@ -0,0 +1,565 @@
/* 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,358 @@
/* 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,32 @@
/* 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,458 @@
/* 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,159 @@
/* 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,537 @@
/* 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,255 @@
/* 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,11 @@
/* 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 { TornadoInstance__factory } from './TornadoInstance__factory'
export { TornadoProxy__factory } from './TornadoProxy__factory'

View File

@ -0,0 +1,20 @@
/* 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 { 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 { TornadoInstance__factory } from './factories/TornadoInstance__factory'
export { TornadoProxy__factory } from './factories/TornadoProxy__factory'

View File

@ -17,30 +17,51 @@ import {
// Our local types // Our local types
import { import {
ERC20Tornado,
ERC20Tornado__factory, ERC20Tornado__factory,
ETHTornado,
ETHTornado__factory, ETHTornado__factory,
TornadoInstance, TornadoInstance,
TornadoInstance__factory, TornadoInstance__factory,
TornadoProxy__factory, TornadoProxy__factory,
TornadoProxy, TornadoProxy,
ERC20__factory,
ERC20, ERC20,
ERC20__factory,
Multicall3Contract__factory Multicall3Contract__factory
} from 'types/deth' } from './deth'
import { Multicall3 } from 'types/deth/Multicall3Contract' import { Multicall3 } from './deth/Multicall3Contract'
import { TornadoContracts, Options } from 'types/sdk/chain'
// Local modules // Local modules
import { Onchain, Cache, Docs } from 'lib/data' import { Onchain, Cache, Docs } from '@tornado/sdk-data'
import { ErrorUtils, HexUtils, AsyncUtils } from 'lib/utils' import { ErrorUtils, HexUtils, AsyncUtils } from '@tornado/sdk-utils'
// @ts-ignore // @ts-ignore
import { parseIndexableString } from 'pouchdb-collate' import { parseIndexableString } from 'pouchdb-collate'
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECLARATIONS (MUST BE INLINED) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export type TornadoContracts = TornadoInstance | TornadoProxy | ETHTornado | ERC20Tornado | ERC20
export namespace Options {
export interface Sync {
startBlock?: number
targetBlock?: number
blockDelta?: number
blockDivisor?: number
concurrencyLimit?: number
msTimeout?: number
listenForEvents?: boolean
persistentCache?: true
cacheAdapter?: string
}
}
// We use a vanilla provider here, but in reality we will probably // We use a vanilla provider here, but in reality we will probably
// add a censorship-checking custom derivative of it // add a censorship-checking custom derivative of it
type Provider = providers.Provider type Provider = providers.Provider
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ REST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/** /**
* The Chain class stores Tornado-agnostic chain data and also * The Chain class stores Tornado-agnostic chain data and also
* handles such interactions. * handles such interactions.

View File

@ -0,0 +1,31 @@
{
"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": "./build",
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"allowSyntheticDefaultImports": true,
"checkJs": true,
"allowJs": true,
"baseUrl": ".",
"paths": {
"src/*": ["src/*"]
}
}
}

View File

@ -0,0 +1,13 @@
# RPC URLs
ETH_MAINNET_TEST_RPC=
# debug (debug events are logged to console)
DEBUG=
# use tor (torify tests)
TORIFY=
# tor port (regular = 9050, browser = 9150)
TOR_PORT=
# relayer DOMAIN (the example.xyz in https://example.xyz) for testing
TEST_RELAYER_DOMAIN=

View File

@ -0,0 +1,3 @@
build
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-core/.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-core/.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
build
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 @@
build
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": []
}

26
@tornado/sdk-core/.vscode/launch.json vendored Normal file
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"
}
]
}

32
@tornado/sdk-core/.vscode/settings.json vendored Normal file
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,33 @@
# So basically, we want to selectively download packages from the Gitea repository but still allow the
# main repositories, so we are going to have to scope OUR packages properly. This means, unless the tornadocash
# Gitea organization defines a default scope, that we'll have to add every user scope. Including my own below.
# Note that all scopes are after @ prefix. So my prefix is @thax
npmScopes:
thax:
npmPublishRegistry: "https://development.tornadocash.community/api/packages/T-Hax/npm/"
npmRegistryServer: "https://development.tornadocash.community/api/packages/T-Hax/npm/"
# The below can be EXPORTED via some env file which actually exports the variables though
# Check the env.example, you will notice it's not a regular env
# So split your env files up, since this is only for manual actions
# npmAuthToken: ${GITEA_AUTH_TOKEN}
# If the following isn't set you won't have a node_modules folder
# You might be used to a node_modules folder instead of a pnp or other folder type
# If you want to use the new linkers uncomment or change the following
# nodeLinker: "node-modules"
# So the tornadocash org, the person who maintains it, might setup something (in future) like,
# tornadocash:
# npmPublishRegistry: "https://development.tornadocash.community/api/packages/tornadocash/npm/"
# npmRegistryServer: "https://development.tornadocash.community/api/packages/tornadocash/npm/"
# We disable telemetry for obvious reasons.
enableTelemetry: false
packageExtensions:
"@resolver-engine/imports-fs@*":
dependencies:
"@resolver-engine/core": "*"
"@thax/circomlib@*":
dependencies:
"web3-utils": "*"

View File

@ -0,0 +1,7 @@
ISC License
Copyright 2023 T-Hax
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,86 @@
{
"name": "@tornado/sdk-core",
"author": "T-Hax",
"license": "ISC",
"description": "Tornado SDK core modules.",
"repository": "https://development.tornadocash.community/T-Hax/sdk-core",
"homepage": "https://tornadocash.community",
"keywords": [
"ethereum",
"crypto",
"zk"
],
"version": "2023.04.28",
"engines": {
"node": "^18"
},
"main": "./build/index.js",
"dependencies": {
"@ethersproject/abi": "^5.7.0",
"@ethersproject/abstract-provider": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@tornado/sdk-chain": "workspace:*",
"@tornado/sdk-crypto": "workspace:*",
"@tornado/sdk-data": "workspace:*",
"@tornado/sdk-utils": "workspace:*",
"ethers": "^5",
"pouchdb-collate": "^8.0.1",
"snarkjs": "npm:@thax/snarkjs@^0.1.20-p2"
},
"devDependencies": {
"@typechain/ethers-v5": "^10.2.0",
"@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",
"@types/pouchdb": "^6.4.0",
"@types/pouchdb-adapter-memory": "^6.1.3",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"@uniswap/default-token-list": "^9.3.0",
"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",
"ganache": "^7.7.7",
"mocha": "^10.2.0",
"prettier": "^2.3.0",
"rimraf": "^4.4.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",
"typechain": "^8.1.1",
"typescript": "^5.0.4"
},
"scripts": {
"test": "npm run build && mocha --inspect --require source-map-support/register --bail ./build/test/",
"typechain": "typechain --target \"ethers-v5\" --discriminate-types --glob \"./src/resources/abis/*.json\" --out-dir=\"./src/types/deth\"",
"build": "rimraf build && tsc && tsc-alias",
"preversion": "npm run lint && npm run build && npm test",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && npm run format && git add -A",
"postversion": "git push --follow-tags && npm publish",
"lint": "eslint --ext ts,js --fix src",
"build-live": "tsc -w && tsc-alias -w",
"clean": "rm -rf --interactive=never cache/*",
"format": "prettier src/**/*.ts -w"
},
"files": [
"build/lib/**/*",
"build/index.*",
"build/types/**/*"
],
"publishConfig": {
"access": "public"
},
"dependenciesMeta": {
"tsconfig-paths@4.2.0": {
"unplugged": true
}
}
}

View File

@ -0,0 +1,321 @@
/* 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,704 @@
/* 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,719 @@
/* 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,705 @@
/* 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,465 @@
/* 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,214 @@
/* 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>
}
}

View File

@ -0,0 +1,565 @@
/* 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,358 @@
/* 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,32 @@
/* 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,458 @@
/* 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,159 @@
/* 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,537 @@
/* 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,255 @@
/* 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,11 @@
/* 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 { TornadoInstance__factory } from './TornadoInstance__factory'
export { TornadoProxy__factory } from './TornadoProxy__factory'

View File

@ -0,0 +1,20 @@
/* 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 { 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 { TornadoInstance__factory } from './factories/TornadoInstance__factory'
export { TornadoProxy__factory } from './factories/TornadoProxy__factory'

View File

@ -2,13 +2,14 @@
import { DeepRequired, MarkOptional } from 'ts-essentials' import { DeepRequired, MarkOptional } from 'ts-essentials'
// Local types // Local types
import { Options as ChainOptions } from 'types/sdk/chain' import { TornadoInstance, TornadoProxy } from './deth'
import { RelayerProperties as RelayerDataProperties, Options as DataOptions } from 'types/sdk/data'
import { Options, Transactions } from 'types/sdk/core' // Monorepo
import { ZKDepositData, InputFor } from 'types/sdk/crypto' import { RelayerProperties as RelayerDataProperties } from '@tornado/sdk-data'
import { TornadoInstance, TornadoProxy } from 'types/deth' import { ZKDepositData, InputFor } from '@tornado/sdk-crypto'
// External imports // External imports
import { TransactionRequest } from '@ethersproject/abstract-provider'
import { BigNumber, providers } from 'ethers' import { BigNumber, providers } from 'ethers'
import { parseUnits } from 'ethers/lib/utils' import { parseUnits } from 'ethers/lib/utils'
import { bigInt } from 'snarkjs' import { bigInt } from 'snarkjs'
@ -17,10 +18,48 @@ import { bigInt } from 'snarkjs'
import { parseIndexableString } from 'pouchdb-collate' import { parseIndexableString } from 'pouchdb-collate'
// Local imports // Local imports
import { Primitives } from 'lib/crypto' import { Primitives } from '@tornado/sdk-crypto'
import { ErrorUtils, ObjectUtils, AsyncUtils } from 'lib/utils' import { ErrorUtils, ObjectUtils, AsyncUtils } from '@tornado/sdk-utils'
import { Docs, Cache, Keys, Constants, Onchain } from 'lib/data' import { Docs, Cache, Keys, Constants, Onchain } from '@tornado/sdk-data'
import { Contracts, Chain, Synchronizer } from 'lib/chain' import { Contracts, Chain, Synchronizer, Options as ChainOptions } from '@tornado/sdk-chain'
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECLARATIONS (MUST BE INLINED) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export namespace Options {
export namespace Core {
export interface Deposit {
depositsPerInstance?: Array<number>
doNotPopulate?: boolean
backup?: {
invoices?: boolean
notes?: boolean
}
}
export type Invoice = Deposit
export interface BuildDepositProof {
gasPrice?: BigNumber
gasPriceCushion?: BigNumber
tokenDecimals?: number
ethPurchaseAmounts?: Array<BigNumber>
checkNotesSpent?: boolean
checkKnownRoot?: boolean
merkleTreeHeight?: number
}
}
export type Sync = ChainOptions.Sync
}
export namespace Transactions {
export interface Deposit {
request: TransactionRequest
invoice?: string
note?: string
}
export type Invoice = Deposit
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOR SYNCHRONIZATION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOR SYNCHRONIZATION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -566,7 +605,7 @@ export class Core extends Synchronizer {
//}) //})
} }
loadDepositCache(name: string, options?: ChainOptions.Sync): DepositCache { loadDepositCache(name: string, options?: Options.Sync): DepositCache {
if (!this.caches.has(name)) { if (!this.caches.has(name)) {
this.caches.set( this.caches.set(
name, name,
@ -579,7 +618,7 @@ export class Core extends Synchronizer {
return this.caches.get(name) as DepositCache return this.caches.get(name) as DepositCache
} }
loadWithdrawalCache(name: string, options?: ChainOptions.Sync): WithdrawalCache { loadWithdrawalCache(name: string, options?: Options.Sync): WithdrawalCache {
if (!this.caches.has(name)) { if (!this.caches.has(name)) {
this.caches.set( this.caches.set(
name, name,
@ -592,7 +631,7 @@ export class Core extends Synchronizer {
return this.caches.get(name) as WithdrawalCache return this.caches.get(name) as WithdrawalCache
} }
loadCache<C extends Cache.Base<Docs.Base>>(name: string, options?: ChainOptions.Sync): C { loadCache<C extends Cache.Base<Docs.Base>>(name: string, options?: Options.Sync): C {
if (!this.caches.has(name)) { if (!this.caches.has(name)) {
this.caches.set( this.caches.set(
name, name,
@ -605,7 +644,7 @@ export class Core extends Synchronizer {
return this.caches.get(name) as C return this.caches.get(name) as C
} }
async syncDeposits(instance: TornadoInstance, options?: ChainOptions.Sync): Promise<void> { async syncDeposits(instance: TornadoInstance, options?: Options.Sync): Promise<void> {
const lookupKeys = await Onchain.getInstanceLookupKeys(instance.address) const lookupKeys = await Onchain.getInstanceLookupKeys(instance.address)
const pathstring = lookupKeys.network + lookupKeys.token + lookupKeys.denomination const pathstring = lookupKeys.network + lookupKeys.token + lookupKeys.denomination
@ -625,7 +664,7 @@ export class Core extends Synchronizer {
if (!this.caches.has(cache.name)) this.caches.set(cache.name, cache) if (!this.caches.has(cache.name)) this.caches.set(cache.name, cache)
} }
async syncWithdrawals(instance: TornadoInstance, options?: ChainOptions.Sync): Promise<void> { async syncWithdrawals(instance: TornadoInstance, options?: Options.Sync): Promise<void> {
const lookupKeys = await Onchain.getInstanceLookupKeys(instance.address) const lookupKeys = await Onchain.getInstanceLookupKeys(instance.address)
const pathstring = lookupKeys.network + lookupKeys.token + lookupKeys.denomination const pathstring = lookupKeys.network + lookupKeys.token + lookupKeys.denomination
@ -645,7 +684,7 @@ export class Core extends Synchronizer {
if (!this.caches.has(cache.name)) this.caches.set(cache.name, cache) if (!this.caches.has(cache.name)) this.caches.set(cache.name, cache)
} }
protected async _populateSyncOptions(options: ChainOptions.Sync): Promise<DeepRequired<ChainOptions.Sync>> { protected async _populateSyncOptions(options: Options.Sync): Promise<DeepRequired<Options.Sync>> {
if (!options.startBlock) throw ErrorUtils.getError('Core._populateSyncOptions: startBlock not set.') if (!options.startBlock) throw ErrorUtils.getError('Core._populateSyncOptions: startBlock not set.')
options.targetBlock = options.targetBlock ?? (await this.chain.latestBlockNum()) options.targetBlock = options.targetBlock ?? (await this.chain.latestBlockNum())
@ -664,8 +703,6 @@ export class Core extends Synchronizer {
options.listenForEvents = options.listenForEvents ?? false options.listenForEvents = options.listenForEvents ?? false
return options as DeepRequired<ChainOptions.Sync> return options as DeepRequired<Options.Sync>
} }
} }
export { Transactions, 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",
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"preserveSymlinks": true,
"outDir": "./build",
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"allowSyntheticDefaultImports": true,
"checkJs": true,
"allowJs": true,
"baseUrl": ".",
"paths": {
"src/*": ["src/*"]
}
}
}

View File

@ -0,0 +1,13 @@
# RPC URLs
ETH_MAINNET_TEST_RPC=
# debug (debug events are logged to console)
DEBUG=
# use tor (torify tests)
TORIFY=
# tor port (regular = 9050, browser = 9150)
TOR_PORT=
# relayer DOMAIN (the example.xyz in https://example.xyz) for testing
TEST_RELAYER_DOMAIN=

View File

@ -0,0 +1,3 @@
build
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-crypto/.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-crypto/.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
build
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 @@
build
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": []
}

26
@tornado/sdk-crypto/.vscode/launch.json vendored Normal file
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,33 @@
# So basically, we want to selectively download packages from the Gitea repository but still allow the
# main repositories, so we are going to have to scope OUR packages properly. This means, unless the tornadocash
# Gitea organization defines a default scope, that we'll have to add every user scope. Including my own below.
# Note that all scopes are after @ prefix. So my prefix is @thax
npmScopes:
thax:
npmPublishRegistry: "https://development.tornadocash.community/api/packages/T-Hax/npm/"
npmRegistryServer: "https://development.tornadocash.community/api/packages/T-Hax/npm/"
# The below can be EXPORTED via some env file which actually exports the variables though
# Check the env.example, you will notice it's not a regular env
# So split your env files up, since this is only for manual actions
# npmAuthToken: ${GITEA_AUTH_TOKEN}
# If the following isn't set you won't have a node_modules folder
# You might be used to a node_modules folder instead of a pnp or other folder type
# If you want to use the new linkers uncomment or change the following
# nodeLinker: "node-modules"
# So the tornadocash org, the person who maintains it, might setup something (in future) like,
# tornadocash:
# npmPublishRegistry: "https://development.tornadocash.community/api/packages/tornadocash/npm/"
# npmRegistryServer: "https://development.tornadocash.community/api/packages/tornadocash/npm/"
# We disable telemetry for obvious reasons.
enableTelemetry: false
packageExtensions:
"@resolver-engine/imports-fs@*":
dependencies:
"@resolver-engine/core": "*"
"@thax/circomlib@*":
dependencies:
"web3-utils": "*"

View File

@ -0,0 +1,7 @@
ISC License
Copyright 2023 T-Hax
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 @@
# sdk-crypto

View File

@ -0,0 +1,79 @@
{
"name": "@tornado/sdk-crypto",
"author": "T-Hax",
"license": "ISC",
"description": "Tornado SDK cryptographic primitives.",
"repository": "https://development.tornadocash.community/T-Hax/sdk-crypto",
"homepage": "https://tornadocash.community",
"keywords": [
"ethereum",
"crypto",
"zk"
],
"version": "2023.04.28",
"engines": {
"node": "^18"
},
"main": "./build/index.js",
"types": "./build/index.d.ts",
"dependencies": {
"@tornado/sdk-data": "workspace:*",
"@tornado/sdk-utils": "workspace:*",
"chalk": "^5.2.0",
"circomlib": "npm:@thax/circomlib@^0.0.20-p1",
"ethers": "^5",
"fixed-merkle-tree": "npm:@thax/fixed-merkle-tree@^0.6.1-p1",
"snarkjs": "npm:@thax/snarkjs@^0.1.20-p2",
"websnark": "npm:@thax/websnark@^0.0.4-p1"
},
"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": "^4.4.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": {
"test": "npm run build && mocha --inspect --require source-map-support/register --bail ./build/test/",
"typechain": "typechain --target \"ethers-v5\" --discriminate-types --glob \"./src/resources/abis/*.json\" --out-dir=\"./src/types/deth\"",
"build": "rimraf build && tsc && tsc-alias",
"preversion": "npm run lint && npm run build && npm test",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && npm run format && git add -A",
"postversion": "git push --follow-tags && npm publish",
"lint": "eslint --ext ts,js --fix src",
"build-live": "tsc -w && tsc-alias -w",
"clean": "rm -rf --interactive=never cache/*",
"format": "prettier src/*.ts -w"
},
"files": [
"build/lib/**/*",
"build/index.*",
"build/types/**/*"
],
"publishConfig": {
"access": "public"
},
"dependenciesMeta": {
"tsconfig-paths@4.2.0": {
"unplugged": true
}
}
}

View File

@ -1,6 +1,3 @@
// crypto types
import { InputFor, OutputOf, ZKDepositData } from 'types/sdk/crypto'
// External crypto // External crypto
import circomlib from 'circomlib' import circomlib from 'circomlib'
import { bigInt } from 'snarkjs' import { bigInt } from 'snarkjs'
@ -10,10 +7,132 @@ import MerkleTreeDefault, { MerkleTree } from 'fixed-merkle-tree'
import { genWitnessAndProve, toSolidityInput } from 'websnark/src/utils' import { genWitnessAndProve, toSolidityInput } from 'websnark/src/utils'
// Some utils to work with hex numbers // Some utils to work with hex numbers
import { ErrorUtils, HexUtils, NumberUtils } from 'lib/utils' import { ErrorUtils, HexUtils, NumberUtils } from '@tornado/sdk-utils'
// Parse some files // Parse some files
import { Files, Json } from 'lib/data' import { Files, Json } from '@tornado/sdk-data'
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECLARATIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Interfaces for the cryptographic primitives.
export type bigInt = typeof bigInt
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OUTPUTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* These are types which define and scope (!) the outputs of the cryptograhic
* functions. They have been scoped such that there isn't much naming confusion
* between what a function takes and not. Common aliases are used there where deemed
* appropriate.
*/
export namespace OutputOf {
export type PedersenHash = bigInt
export interface CreateDeposit {
nullifier: bigInt
secret: bigInt
preimage: Buffer
commitment: PedersenHash
hexCommitment: string
nullifierHash: PedersenHash
hexNullifierHash: string
}
export interface MerkleProof {
root: any
path: {
indices: any
elements: any[]
}
}
export interface Groth16Proof {
pi_a: string
pi_b: string
pi_c: string
}
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OUTPUT ALIASES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* There may be also multiple output aliases for one output, to make the code more readable,
* in a certain sense of speaking. The delimiter below just makes this comment not pass on to
* `MerkleTree`.
*/
type __OutputAliasDelimiter = null
export type MerkleProof = OutputOf.MerkleProof
export type ZKProof = OutputOf.Groth16Proof
export type DepositProof = OutputOf.Groth16Proof
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INPUTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* These are types which define and scope (!) the inputs of the cryptograhic
* functions. The same as above applies, but note that some outputs are inputs
* for other functions. For example, MerkleTree is an output of the function
* which builds the Tornado Cash merkle tree, and this is passed as input,
* to the merkle proof builder.
*/
export namespace InputFor {
export interface PedersenHash {
msg: Buffer
}
export interface CreateDeposit {
nullifier?: bigInt
secret?: bigInt
}
export interface BuildMerkleTree {
height: number
leaves: Array<string>
}
export interface ZKProof {
public: {
root: string
tree: MerkleTree
leafIndex: number
hexNullifierHash: string
recipientAddress: string
relayerAddress: string
fee: bigInt
refund: bigInt
}
private: {
nullifier: bigInt
secret: bigInt
}
}
interface PublicGroth16 {
root: any
nullifierHash: PedersenHash
recipient: bigInt
relayer: bigInt
refund: bigInt
fee: bigInt
}
interface PrivateGroth16 {
nullifier: bigInt
secret: bigInt
pathIndices: number[]
pathElements: string[]
}
export type Groth16 = PublicGroth16 & PrivateGroth16
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INPUT ALIASES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* There may be also multiple input aliases for one input, to make the code more readable,
* in a certain sense of speaking. The delimiter below just makes this comment not pass on to
* `TornadoDeposit`.
*/
type __InputAliasDelimiter = null
export type ZKDepositData = OutputOf.CreateDeposit
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SETUP ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SETUP ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/** /**
@ -159,14 +278,3 @@ export namespace Primitives {
return proofs return proofs
} }
} }
// TODO: implement and decide whether to add in declarations an ambient namespace and merge it here
// export function buildMerkleTree(deposit: Crypto.TornadoDeposit): Crypto.MerkleTree {}
// export function calcMerkleProof(tree: Crypto.MerkleTree): Crypto.MerkleProof {}
// export function calcDepositProof(merkleProof: Crypto.InputFor.DepositProof): Crypto.OutputOf.DepositProof {}
// Namespace exports
export { InputFor, OutputOf, ZKDepositData }

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": "./build",
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"allowSyntheticDefaultImports": true,
"checkJs": true,
"allowJs": true,
"baseUrl": ".",
"paths": {
"test/*": ["test/*"],
"src/*": ["src/*"]
}
}
}

View File

@ -0,0 +1,13 @@
# RPC URLs
ETH_MAINNET_TEST_RPC=
# debug (debug events are logged to console)
DEBUG=
# use tor (torify tests)
TORIFY=
# tor port (regular = 9050, browser = 9150)
TOR_PORT=
# relayer DOMAIN (the example.xyz in https://example.xyz) for testing
TEST_RELAYER_DOMAIN=

View File

@ -0,0 +1,3 @@
build
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-data/.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-data/.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
build
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 @@
build
node_modules
package-log.json

View File

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

Some files were not shown because too many files have changed in this diff Show More