From 82e942694acc62f067cc1f564a21e6463e732f9a Mon Sep 17 00:00:00 2001 From: Danil Kovtonyuk Date: Tue, 16 Nov 2021 18:03:07 +1000 Subject: [PATCH] fix: new contract --- src/abi/TornadoPool.json | 198 ++++++++++++- src/artifacts/TornadoPool.d.ts | 274 +++++++++++++++++- .../factories/TornadoPool__factory.ts | 198 ++++++++++++- src/constants/contracts.ts | 2 +- 4 files changed, 629 insertions(+), 43 deletions(-) diff --git a/src/abi/TornadoPool.json b/src/abi/TornadoPool.json index 1d257cb..1c70139 100644 --- a/src/abi/TornadoPool.json +++ b/src/abi/TornadoPool.json @@ -40,6 +40,16 @@ "internalType": "address", "name": "_governance", "type": "address" + }, + { + "internalType": "uint256", + "name": "_l1ChainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_multisig", + "type": "address" } ], "stateMutability": "nonpayable", @@ -167,6 +177,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "ambBridge", + "outputs": [ + { + "internalType": "contract IAMB", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -254,19 +277,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "governance", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -322,6 +332,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "isCalledByOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -425,6 +448,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "multisig", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "nextIndex", @@ -493,6 +529,119 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "root", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "inputNullifiers", + "type": "bytes32[]" + }, + { + "internalType": "bytes32[2]", + "name": "outputCommitments", + "type": "bytes32[2]" + }, + { + "internalType": "uint256", + "name": "publicAmount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "extDataHash", + "type": "bytes32" + } + ], + "internalType": "struct TornadoPool.Proof", + "name": "_args", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "int256", + "name": "extAmount", + "type": "int256" + }, + { + "internalType": "address", + "name": "relayer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "fee", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "encryptedOutput1", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "encryptedOutput2", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "isL1Withdrawal", + "type": "bool" + } + ], + "internalType": "struct TornadoPool.ExtData", + "name": "_extData", + "type": "tuple" + } + ], + "name": "onTransact", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ownerChainId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -622,6 +771,29 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract IERC6777", + "name": "_token", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_balance", + "type": "uint256" + } + ], + "name": "rescueTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { diff --git a/src/artifacts/TornadoPool.d.ts b/src/artifacts/TornadoPool.d.ts index 9c65951..1f9c59b 100644 --- a/src/artifacts/TornadoPool.d.ts +++ b/src/artifacts/TornadoPool.d.ts @@ -26,15 +26,16 @@ interface TornadoPoolInterface extends ethers.utils.Interface { "MAX_FEE()": FunctionFragment; "ROOT_HISTORY_SIZE()": FunctionFragment; "ZERO_VALUE()": FunctionFragment; + "ambBridge()": FunctionFragment; "calculatePublicAmount(int256,uint256)": FunctionFragment; "configureLimits(uint256,uint256)": FunctionFragment; "currentRootIndex()": FunctionFragment; "filledSubtrees(uint256)": FunctionFragment; "getLastRoot()": FunctionFragment; - "governance()": FunctionFragment; "hashLeftRight(bytes32,bytes32)": FunctionFragment; "hasher()": FunctionFragment; "initialize(uint256,uint256)": FunctionFragment; + "isCalledByOwner()": FunctionFragment; "isKnownRoot(bytes32)": FunctionFragment; "isSpent(bytes32)": FunctionFragment; "l1Unwrapper()": FunctionFragment; @@ -42,12 +43,17 @@ interface TornadoPoolInterface extends ethers.utils.Interface { "levels()": FunctionFragment; "maximumDepositAmount()": FunctionFragment; "minimalWithdrawalAmount()": FunctionFragment; + "multisig()": FunctionFragment; "nextIndex()": FunctionFragment; "nullifierHashes(bytes32)": FunctionFragment; "omniBridge()": FunctionFragment; "onTokenBridged(address,uint256,bytes)": FunctionFragment; + "onTransact(tuple,tuple)": FunctionFragment; + "owner()": FunctionFragment; + "ownerChainId()": FunctionFragment; "register(tuple)": FunctionFragment; "registerAndTransact(tuple,tuple,tuple)": FunctionFragment; + "rescueTokens(address,address,uint256)": FunctionFragment; "roots(uint256)": FunctionFragment; "token()": FunctionFragment; "transact(tuple,tuple)": FunctionFragment; @@ -74,6 +80,7 @@ interface TornadoPoolInterface extends ethers.utils.Interface { functionFragment: "ZERO_VALUE", values?: undefined ): string; + encodeFunctionData(functionFragment: "ambBridge", values?: undefined): string; encodeFunctionData( functionFragment: "calculatePublicAmount", values: [BigNumberish, BigNumberish] @@ -94,10 +101,6 @@ interface TornadoPoolInterface extends ethers.utils.Interface { functionFragment: "getLastRoot", values?: undefined ): string; - encodeFunctionData( - functionFragment: "governance", - values?: undefined - ): string; encodeFunctionData( functionFragment: "hashLeftRight", values: [BytesLike, BytesLike] @@ -107,6 +110,10 @@ interface TornadoPoolInterface extends ethers.utils.Interface { functionFragment: "initialize", values: [BigNumberish, BigNumberish] ): string; + encodeFunctionData( + functionFragment: "isCalledByOwner", + values?: undefined + ): string; encodeFunctionData( functionFragment: "isKnownRoot", values: [BytesLike] @@ -129,6 +136,7 @@ interface TornadoPoolInterface extends ethers.utils.Interface { functionFragment: "minimalWithdrawalAmount", values?: undefined ): string; + encodeFunctionData(functionFragment: "multisig", values?: undefined): string; encodeFunctionData(functionFragment: "nextIndex", values?: undefined): string; encodeFunctionData( functionFragment: "nullifierHashes", @@ -142,6 +150,33 @@ interface TornadoPoolInterface extends ethers.utils.Interface { functionFragment: "onTokenBridged", values: [string, BigNumberish, BytesLike] ): string; + encodeFunctionData( + functionFragment: "onTransact", + values: [ + { + proof: BytesLike; + root: BytesLike; + inputNullifiers: BytesLike[]; + outputCommitments: [BytesLike, BytesLike]; + publicAmount: BigNumberish; + extDataHash: BytesLike; + }, + { + recipient: string; + extAmount: BigNumberish; + relayer: string; + fee: BigNumberish; + encryptedOutput1: BytesLike; + encryptedOutput2: BytesLike; + isL1Withdrawal: boolean; + } + ] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "ownerChainId", + values?: undefined + ): string; encodeFunctionData( functionFragment: "register", values: [{ owner: string; publicKey: BytesLike }] @@ -169,6 +204,10 @@ interface TornadoPoolInterface extends ethers.utils.Interface { } ] ): string; + encodeFunctionData( + functionFragment: "rescueTokens", + values: [string, string, BigNumberish] + ): string; encodeFunctionData(functionFragment: "roots", values: [BigNumberish]): string; encodeFunctionData(functionFragment: "token", values?: undefined): string; encodeFunctionData( @@ -224,6 +263,7 @@ interface TornadoPoolInterface extends ethers.utils.Interface { data: BytesLike ): Result; decodeFunctionResult(functionFragment: "ZERO_VALUE", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "ambBridge", data: BytesLike): Result; decodeFunctionResult( functionFragment: "calculatePublicAmount", data: BytesLike @@ -244,13 +284,16 @@ interface TornadoPoolInterface extends ethers.utils.Interface { functionFragment: "getLastRoot", data: BytesLike ): Result; - decodeFunctionResult(functionFragment: "governance", data: BytesLike): Result; decodeFunctionResult( functionFragment: "hashLeftRight", data: BytesLike ): Result; decodeFunctionResult(functionFragment: "hasher", data: BytesLike): Result; decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isCalledByOwner", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "isKnownRoot", data: BytesLike @@ -273,6 +316,7 @@ interface TornadoPoolInterface extends ethers.utils.Interface { functionFragment: "minimalWithdrawalAmount", data: BytesLike ): Result; + decodeFunctionResult(functionFragment: "multisig", data: BytesLike): Result; decodeFunctionResult(functionFragment: "nextIndex", data: BytesLike): Result; decodeFunctionResult( functionFragment: "nullifierHashes", @@ -283,11 +327,21 @@ interface TornadoPoolInterface extends ethers.utils.Interface { functionFragment: "onTokenBridged", data: BytesLike ): Result; + decodeFunctionResult(functionFragment: "onTransact", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "ownerChainId", + data: BytesLike + ): Result; decodeFunctionResult(functionFragment: "register", data: BytesLike): Result; decodeFunctionResult( functionFragment: "registerAndTransact", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "rescueTokens", + data: BytesLike + ): Result; decodeFunctionResult(functionFragment: "roots", data: BytesLike): Result; decodeFunctionResult(functionFragment: "token", data: BytesLike): Result; decodeFunctionResult(functionFragment: "transact", data: BytesLike): Result; @@ -364,6 +418,8 @@ export class TornadoPool extends BaseContract { ZERO_VALUE(overrides?: CallOverrides): Promise<[BigNumber]>; + ambBridge(overrides?: CallOverrides): Promise<[string]>; + calculatePublicAmount( _extAmount: BigNumberish, _fee: BigNumberish, @@ -385,8 +441,6 @@ export class TornadoPool extends BaseContract { getLastRoot(overrides?: CallOverrides): Promise<[string]>; - governance(overrides?: CallOverrides): Promise<[string]>; - hashLeftRight( _left: BytesLike, _right: BytesLike, @@ -401,6 +455,10 @@ export class TornadoPool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + isCalledByOwner( + overrides?: Overrides & { from?: string | Promise } + ): Promise; + isKnownRoot( _root: BytesLike, overrides?: CallOverrides @@ -421,6 +479,8 @@ export class TornadoPool extends BaseContract { minimalWithdrawalAmount(overrides?: CallOverrides): Promise<[BigNumber]>; + multisig(overrides?: CallOverrides): Promise<[string]>; + nextIndex(overrides?: CallOverrides): Promise<[number]>; nullifierHashes( @@ -437,6 +497,31 @@ export class TornadoPool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + onTransact( + _args: { + proof: BytesLike; + root: BytesLike; + inputNullifiers: BytesLike[]; + outputCommitments: [BytesLike, BytesLike]; + publicAmount: BigNumberish; + extDataHash: BytesLike; + }, + _extData: { + recipient: string; + extAmount: BigNumberish; + relayer: string; + fee: BigNumberish; + encryptedOutput1: BytesLike; + encryptedOutput2: BytesLike; + isL1Withdrawal: boolean; + }, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + owner(overrides?: CallOverrides): Promise<[string]>; + + ownerChainId(overrides?: CallOverrides): Promise<[string]>; + register( _account: { owner: string; publicKey: BytesLike }, overrides?: Overrides & { from?: string | Promise } @@ -464,6 +549,13 @@ export class TornadoPool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + rescueTokens( + _token: string, + _to: string, + _balance: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + roots(arg0: BigNumberish, overrides?: CallOverrides): Promise<[string]>; token(overrides?: CallOverrides): Promise<[string]>; @@ -518,6 +610,8 @@ export class TornadoPool extends BaseContract { ZERO_VALUE(overrides?: CallOverrides): Promise; + ambBridge(overrides?: CallOverrides): Promise; + calculatePublicAmount( _extAmount: BigNumberish, _fee: BigNumberish, @@ -539,8 +633,6 @@ export class TornadoPool extends BaseContract { getLastRoot(overrides?: CallOverrides): Promise; - governance(overrides?: CallOverrides): Promise; - hashLeftRight( _left: BytesLike, _right: BytesLike, @@ -555,6 +647,10 @@ export class TornadoPool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + isCalledByOwner( + overrides?: Overrides & { from?: string | Promise } + ): Promise; + isKnownRoot(_root: BytesLike, overrides?: CallOverrides): Promise; isSpent( @@ -572,6 +668,8 @@ export class TornadoPool extends BaseContract { minimalWithdrawalAmount(overrides?: CallOverrides): Promise; + multisig(overrides?: CallOverrides): Promise; + nextIndex(overrides?: CallOverrides): Promise; nullifierHashes(arg0: BytesLike, overrides?: CallOverrides): Promise; @@ -585,6 +683,31 @@ export class TornadoPool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + onTransact( + _args: { + proof: BytesLike; + root: BytesLike; + inputNullifiers: BytesLike[]; + outputCommitments: [BytesLike, BytesLike]; + publicAmount: BigNumberish; + extDataHash: BytesLike; + }, + _extData: { + recipient: string; + extAmount: BigNumberish; + relayer: string; + fee: BigNumberish; + encryptedOutput1: BytesLike; + encryptedOutput2: BytesLike; + isL1Withdrawal: boolean; + }, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + ownerChainId(overrides?: CallOverrides): Promise; + register( _account: { owner: string; publicKey: BytesLike }, overrides?: Overrides & { from?: string | Promise } @@ -612,6 +735,13 @@ export class TornadoPool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + rescueTokens( + _token: string, + _to: string, + _balance: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + roots(arg0: BigNumberish, overrides?: CallOverrides): Promise; token(overrides?: CallOverrides): Promise; @@ -666,6 +796,8 @@ export class TornadoPool extends BaseContract { ZERO_VALUE(overrides?: CallOverrides): Promise; + ambBridge(overrides?: CallOverrides): Promise; + calculatePublicAmount( _extAmount: BigNumberish, _fee: BigNumberish, @@ -687,8 +819,6 @@ export class TornadoPool extends BaseContract { getLastRoot(overrides?: CallOverrides): Promise; - governance(overrides?: CallOverrides): Promise; - hashLeftRight( _left: BytesLike, _right: BytesLike, @@ -703,6 +833,8 @@ export class TornadoPool extends BaseContract { overrides?: CallOverrides ): Promise; + isCalledByOwner(overrides?: CallOverrides): Promise; + isKnownRoot(_root: BytesLike, overrides?: CallOverrides): Promise; isSpent( @@ -720,6 +852,8 @@ export class TornadoPool extends BaseContract { minimalWithdrawalAmount(overrides?: CallOverrides): Promise; + multisig(overrides?: CallOverrides): Promise; + nextIndex(overrides?: CallOverrides): Promise; nullifierHashes( @@ -736,6 +870,31 @@ export class TornadoPool extends BaseContract { overrides?: CallOverrides ): Promise; + onTransact( + _args: { + proof: BytesLike; + root: BytesLike; + inputNullifiers: BytesLike[]; + outputCommitments: [BytesLike, BytesLike]; + publicAmount: BigNumberish; + extDataHash: BytesLike; + }, + _extData: { + recipient: string; + extAmount: BigNumberish; + relayer: string; + fee: BigNumberish; + encryptedOutput1: BytesLike; + encryptedOutput2: BytesLike; + isL1Withdrawal: boolean; + }, + overrides?: CallOverrides + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + ownerChainId(overrides?: CallOverrides): Promise; + register( _account: { owner: string; publicKey: BytesLike }, overrides?: CallOverrides @@ -763,6 +922,13 @@ export class TornadoPool extends BaseContract { overrides?: CallOverrides ): Promise; + rescueTokens( + _token: string, + _to: string, + _balance: BigNumberish, + overrides?: CallOverrides + ): Promise; + roots(arg0: BigNumberish, overrides?: CallOverrides): Promise; token(overrides?: CallOverrides): Promise; @@ -838,6 +1004,8 @@ export class TornadoPool extends BaseContract { ZERO_VALUE(overrides?: CallOverrides): Promise; + ambBridge(overrides?: CallOverrides): Promise; + calculatePublicAmount( _extAmount: BigNumberish, _fee: BigNumberish, @@ -859,8 +1027,6 @@ export class TornadoPool extends BaseContract { getLastRoot(overrides?: CallOverrides): Promise; - governance(overrides?: CallOverrides): Promise; - hashLeftRight( _left: BytesLike, _right: BytesLike, @@ -875,6 +1041,10 @@ export class TornadoPool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + isCalledByOwner( + overrides?: Overrides & { from?: string | Promise } + ): Promise; + isKnownRoot( _root: BytesLike, overrides?: CallOverrides @@ -895,6 +1065,8 @@ export class TornadoPool extends BaseContract { minimalWithdrawalAmount(overrides?: CallOverrides): Promise; + multisig(overrides?: CallOverrides): Promise; + nextIndex(overrides?: CallOverrides): Promise; nullifierHashes( @@ -911,6 +1083,31 @@ export class TornadoPool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + onTransact( + _args: { + proof: BytesLike; + root: BytesLike; + inputNullifiers: BytesLike[]; + outputCommitments: [BytesLike, BytesLike]; + publicAmount: BigNumberish; + extDataHash: BytesLike; + }, + _extData: { + recipient: string; + extAmount: BigNumberish; + relayer: string; + fee: BigNumberish; + encryptedOutput1: BytesLike; + encryptedOutput2: BytesLike; + isL1Withdrawal: boolean; + }, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + ownerChainId(overrides?: CallOverrides): Promise; + register( _account: { owner: string; publicKey: BytesLike }, overrides?: Overrides & { from?: string | Promise } @@ -938,6 +1135,13 @@ export class TornadoPool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + rescueTokens( + _token: string, + _to: string, + _balance: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + roots(arg0: BigNumberish, overrides?: CallOverrides): Promise; token(overrides?: CallOverrides): Promise; @@ -993,6 +1197,8 @@ export class TornadoPool extends BaseContract { ZERO_VALUE(overrides?: CallOverrides): Promise; + ambBridge(overrides?: CallOverrides): Promise; + calculatePublicAmount( _extAmount: BigNumberish, _fee: BigNumberish, @@ -1014,8 +1220,6 @@ export class TornadoPool extends BaseContract { getLastRoot(overrides?: CallOverrides): Promise; - governance(overrides?: CallOverrides): Promise; - hashLeftRight( _left: BytesLike, _right: BytesLike, @@ -1030,6 +1234,10 @@ export class TornadoPool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + isCalledByOwner( + overrides?: Overrides & { from?: string | Promise } + ): Promise; + isKnownRoot( _root: BytesLike, overrides?: CallOverrides @@ -1054,6 +1262,8 @@ export class TornadoPool extends BaseContract { overrides?: CallOverrides ): Promise; + multisig(overrides?: CallOverrides): Promise; + nextIndex(overrides?: CallOverrides): Promise; nullifierHashes( @@ -1070,6 +1280,31 @@ export class TornadoPool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + onTransact( + _args: { + proof: BytesLike; + root: BytesLike; + inputNullifiers: BytesLike[]; + outputCommitments: [BytesLike, BytesLike]; + publicAmount: BigNumberish; + extDataHash: BytesLike; + }, + _extData: { + recipient: string; + extAmount: BigNumberish; + relayer: string; + fee: BigNumberish; + encryptedOutput1: BytesLike; + encryptedOutput2: BytesLike; + isL1Withdrawal: boolean; + }, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + ownerChainId(overrides?: CallOverrides): Promise; + register( _account: { owner: string; publicKey: BytesLike }, overrides?: Overrides & { from?: string | Promise } @@ -1097,6 +1332,13 @@ export class TornadoPool extends BaseContract { overrides?: Overrides & { from?: string | Promise } ): Promise; + rescueTokens( + _token: string, + _to: string, + _balance: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + roots( arg0: BigNumberish, overrides?: CallOverrides diff --git a/src/artifacts/factories/TornadoPool__factory.ts b/src/artifacts/factories/TornadoPool__factory.ts index 1ae16e4..7076df5 100644 --- a/src/artifacts/factories/TornadoPool__factory.ts +++ b/src/artifacts/factories/TornadoPool__factory.ts @@ -49,6 +49,16 @@ const _abi = [ name: "_governance", type: "address", }, + { + internalType: "uint256", + name: "_l1ChainId", + type: "uint256", + }, + { + internalType: "address", + name: "_multisig", + type: "address", + }, ], stateMutability: "nonpayable", type: "constructor", @@ -175,6 +185,19 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [], + name: "ambBridge", + outputs: [ + { + internalType: "contract IAMB", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -262,19 +285,6 @@ const _abi = [ stateMutability: "view", type: "function", }, - { - inputs: [], - name: "governance", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, { inputs: [ { @@ -330,6 +340,19 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [], + name: "isCalledByOwner", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { @@ -433,6 +456,19 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [], + name: "multisig", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "nextIndex", @@ -501,6 +537,119 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + components: [ + { + internalType: "bytes", + name: "proof", + type: "bytes", + }, + { + internalType: "bytes32", + name: "root", + type: "bytes32", + }, + { + internalType: "bytes32[]", + name: "inputNullifiers", + type: "bytes32[]", + }, + { + internalType: "bytes32[2]", + name: "outputCommitments", + type: "bytes32[2]", + }, + { + internalType: "uint256", + name: "publicAmount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "extDataHash", + type: "bytes32", + }, + ], + internalType: "struct TornadoPool.Proof", + name: "_args", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "int256", + name: "extAmount", + type: "int256", + }, + { + internalType: "address", + name: "relayer", + type: "address", + }, + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + { + internalType: "bytes", + name: "encryptedOutput1", + type: "bytes", + }, + { + internalType: "bytes", + name: "encryptedOutput2", + type: "bytes", + }, + { + internalType: "bool", + name: "isL1Withdrawal", + type: "bool", + }, + ], + internalType: "struct TornadoPool.ExtData", + name: "_extData", + type: "tuple", + }, + ], + name: "onTransact", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "ownerChainId", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -630,6 +779,29 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "contract IERC6777", + name: "_token", + type: "address", + }, + { + internalType: "address payable", + name: "_to", + type: "address", + }, + { + internalType: "uint256", + name: "_balance", + type: "uint256", + }, + ], + name: "rescueTokens", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { diff --git a/src/constants/contracts.ts b/src/constants/contracts.ts index d464174..64fcbc1 100644 --- a/src/constants/contracts.ts +++ b/src/constants/contracts.ts @@ -5,7 +5,7 @@ export const CONTRACT_NETWORKS: { [chainId in ChainId]: string } = { [ChainId.GOERLI]: '0xE2D9aF526edeB16a02FBC3B68B0eB9B534f9c114', [ChainId.OPTIMISM]: '0xcd7318c299A82E887f5180EF865a4c350dFC9fe5', // [ChainId.XDAI]: '0xdd85b1dbE3379AFA37F703822f9E328d4bAf8625', // BNB - [ChainId.XDAI]: '0xBCc3689369f18916FBEB4B547BAB1488CC46290B', // ETH + [ChainId.XDAI]: '0x9719570C85c93a74c72B5B2c08AA133fcBc35377', // ETH }; export const RPC_LIST: { [chainId in ChainId]: string } = {