fix: update contracts
This commit is contained in:
parent
69f63a4dba
commit
4809d17f27
@ -208,14 +208,21 @@
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "_pubKey",
|
||||
"type": "bytes"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "_account",
|
||||
"type": "bytes"
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "pubKey",
|
||||
"type": "bytes"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "account",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct TornadoPool.Register",
|
||||
"name": "args",
|
||||
"type": "tuple"
|
||||
}
|
||||
],
|
||||
"name": "register",
|
||||
@ -226,44 +233,73 @@
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "_proof",
|
||||
"type": "bytes"
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "pubKey",
|
||||
"type": "bytes"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "account",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct TornadoPool.Register",
|
||||
"name": "_registerArgs",
|
||||
"type": "tuple"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "_root",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "_newRoot",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[]",
|
||||
"name": "_inputNullifiers",
|
||||
"type": "bytes32[]"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[2]",
|
||||
"name": "_outputCommitments",
|
||||
"type": "bytes32[2]"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_outPathIndices",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_extAmount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_fee",
|
||||
"type": "uint256"
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "proof",
|
||||
"type": "bytes"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "root",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "newRoot",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[]",
|
||||
"name": "inputNullifiers",
|
||||
"type": "bytes32[]"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[2]",
|
||||
"name": "outputCommitments",
|
||||
"type": "bytes32[2]"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "outPathIndices",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "extAmount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "fee",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "extDataHash",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"internalType": "struct TornadoPool.Proof",
|
||||
"name": "_proofArgs",
|
||||
"type": "tuple"
|
||||
},
|
||||
{
|
||||
"components": [
|
||||
@ -291,11 +327,93 @@
|
||||
"internalType": "struct TornadoPool.ExtData",
|
||||
"name": "_extData",
|
||||
"type": "tuple"
|
||||
}
|
||||
],
|
||||
"name": "registerAndTransact",
|
||||
"outputs": [],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "proof",
|
||||
"type": "bytes"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "root",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "newRoot",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[]",
|
||||
"name": "inputNullifiers",
|
||||
"type": "bytes32[]"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[2]",
|
||||
"name": "outputCommitments",
|
||||
"type": "bytes32[2]"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "outPathIndices",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "extAmount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "fee",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "extDataHash",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"internalType": "struct TornadoPool.Proof",
|
||||
"name": "_args",
|
||||
"type": "tuple"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "_extDataHash",
|
||||
"type": "bytes32"
|
||||
"components": [
|
||||
{
|
||||
"internalType": "address payable",
|
||||
"name": "recipient",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address payable",
|
||||
"name": "relayer",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "encryptedOutput1",
|
||||
"type": "bytes"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "encryptedOutput2",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"internalType": "struct TornadoPool.ExtData",
|
||||
"name": "_extData",
|
||||
"type": "tuple"
|
||||
}
|
||||
],
|
||||
"name": "transaction",
|
||||
@ -332,49 +450,56 @@
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "_proof",
|
||||
"type": "bytes"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "_root",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "_newRoot",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[]",
|
||||
"name": "_inputNullifiers",
|
||||
"type": "bytes32[]"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[2]",
|
||||
"name": "_outputCommitments",
|
||||
"type": "bytes32[2]"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_outPathIndices",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_extAmount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_fee",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "_extDataHash",
|
||||
"type": "bytes32"
|
||||
"components": [
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "proof",
|
||||
"type": "bytes"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "root",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "newRoot",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[]",
|
||||
"name": "inputNullifiers",
|
||||
"type": "bytes32[]"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32[2]",
|
||||
"name": "outputCommitments",
|
||||
"type": "bytes32[2]"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "outPathIndices",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "extAmount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "fee",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "extDataHash",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"internalType": "struct TornadoPool.Proof",
|
||||
"name": "_args",
|
||||
"type": "tuple"
|
||||
}
|
||||
],
|
||||
"name": "verifyProof",
|
||||
|
413
src/artifacts/TornadoPool.d.ts
vendored
413
src/artifacts/TornadoPool.d.ts
vendored
@ -29,11 +29,12 @@ interface TornadoPoolInterface extends ethers.utils.Interface {
|
||||
"currentRoot()": FunctionFragment;
|
||||
"isSpent(bytes32)": FunctionFragment;
|
||||
"nullifierHashes(bytes32)": FunctionFragment;
|
||||
"register(bytes,bytes)": FunctionFragment;
|
||||
"transaction(bytes,bytes32,bytes32,bytes32[],bytes32[2],uint256,uint256,uint256,tuple,bytes32)": FunctionFragment;
|
||||
"register(tuple)": FunctionFragment;
|
||||
"registerAndTransact(tuple,tuple,tuple)": FunctionFragment;
|
||||
"transaction(tuple,tuple)": FunctionFragment;
|
||||
"verifier16()": FunctionFragment;
|
||||
"verifier2()": FunctionFragment;
|
||||
"verifyProof(bytes,bytes32,bytes32,bytes32[],bytes32[2],uint256,uint256,uint256,bytes32)": FunctionFragment;
|
||||
"verifyProof(tuple)": FunctionFragment;
|
||||
};
|
||||
|
||||
encodeFunctionData(
|
||||
@ -63,26 +64,51 @@ interface TornadoPoolInterface extends ethers.utils.Interface {
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "register",
|
||||
values: [BytesLike, BytesLike]
|
||||
values: [{ pubKey: BytesLike; account: BytesLike }]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "transaction",
|
||||
functionFragment: "registerAndTransact",
|
||||
values: [
|
||||
BytesLike,
|
||||
BytesLike,
|
||||
BytesLike,
|
||||
BytesLike[],
|
||||
[BytesLike, BytesLike],
|
||||
BigNumberish,
|
||||
BigNumberish,
|
||||
BigNumberish,
|
||||
{ pubKey: BytesLike; account: BytesLike },
|
||||
{
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
{
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
}
|
||||
]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "transaction",
|
||||
values: [
|
||||
{
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
BytesLike
|
||||
{
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
}
|
||||
]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
@ -93,15 +119,17 @@ interface TornadoPoolInterface extends ethers.utils.Interface {
|
||||
encodeFunctionData(
|
||||
functionFragment: "verifyProof",
|
||||
values: [
|
||||
BytesLike,
|
||||
BytesLike,
|
||||
BytesLike,
|
||||
BytesLike[],
|
||||
[BytesLike, BytesLike],
|
||||
BigNumberish,
|
||||
BigNumberish,
|
||||
BigNumberish,
|
||||
BytesLike
|
||||
{
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
}
|
||||
]
|
||||
): string;
|
||||
|
||||
@ -128,6 +156,10 @@ interface TornadoPoolInterface extends ethers.utils.Interface {
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "register", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "registerAndTransact",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "transaction",
|
||||
data: BytesLike
|
||||
@ -220,27 +252,50 @@ export class TornadoPool extends BaseContract {
|
||||
): Promise<[boolean]>;
|
||||
|
||||
register(
|
||||
_pubKey: BytesLike,
|
||||
_account: BytesLike,
|
||||
args: { pubKey: BytesLike; account: BytesLike },
|
||||
overrides?: Overrides & { from?: string | Promise<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
transaction(
|
||||
_proof: BytesLike,
|
||||
_root: BytesLike,
|
||||
_newRoot: BytesLike,
|
||||
_inputNullifiers: BytesLike[],
|
||||
_outputCommitments: [BytesLike, BytesLike],
|
||||
_outPathIndices: BigNumberish,
|
||||
_extAmount: BigNumberish,
|
||||
_fee: BigNumberish,
|
||||
registerAndTransact(
|
||||
_registerArgs: { pubKey: BytesLike; account: BytesLike },
|
||||
_proofArgs: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
_extData: {
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
},
|
||||
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
transaction(
|
||||
_args: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
_extData: {
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
},
|
||||
_extDataHash: BytesLike,
|
||||
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
@ -249,15 +304,17 @@ export class TornadoPool extends BaseContract {
|
||||
verifier2(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
verifyProof(
|
||||
_proof: BytesLike,
|
||||
_root: BytesLike,
|
||||
_newRoot: BytesLike,
|
||||
_inputNullifiers: BytesLike[],
|
||||
_outputCommitments: [BytesLike, BytesLike],
|
||||
_outPathIndices: BigNumberish,
|
||||
_extAmount: BigNumberish,
|
||||
_fee: BigNumberish,
|
||||
_extDataHash: BytesLike,
|
||||
_args: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
overrides?: CallOverrides
|
||||
): Promise<[boolean]>;
|
||||
};
|
||||
@ -283,27 +340,50 @@ export class TornadoPool extends BaseContract {
|
||||
nullifierHashes(arg0: BytesLike, overrides?: CallOverrides): Promise<boolean>;
|
||||
|
||||
register(
|
||||
_pubKey: BytesLike,
|
||||
_account: BytesLike,
|
||||
args: { pubKey: BytesLike; account: BytesLike },
|
||||
overrides?: Overrides & { from?: string | Promise<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
transaction(
|
||||
_proof: BytesLike,
|
||||
_root: BytesLike,
|
||||
_newRoot: BytesLike,
|
||||
_inputNullifiers: BytesLike[],
|
||||
_outputCommitments: [BytesLike, BytesLike],
|
||||
_outPathIndices: BigNumberish,
|
||||
_extAmount: BigNumberish,
|
||||
_fee: BigNumberish,
|
||||
registerAndTransact(
|
||||
_registerArgs: { pubKey: BytesLike; account: BytesLike },
|
||||
_proofArgs: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
_extData: {
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
},
|
||||
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
transaction(
|
||||
_args: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
_extData: {
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
},
|
||||
_extDataHash: BytesLike,
|
||||
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
@ -312,15 +392,17 @@ export class TornadoPool extends BaseContract {
|
||||
verifier2(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
verifyProof(
|
||||
_proof: BytesLike,
|
||||
_root: BytesLike,
|
||||
_newRoot: BytesLike,
|
||||
_inputNullifiers: BytesLike[],
|
||||
_outputCommitments: [BytesLike, BytesLike],
|
||||
_outPathIndices: BigNumberish,
|
||||
_extAmount: BigNumberish,
|
||||
_fee: BigNumberish,
|
||||
_extDataHash: BytesLike,
|
||||
_args: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
|
||||
@ -349,27 +431,50 @@ export class TornadoPool extends BaseContract {
|
||||
): Promise<boolean>;
|
||||
|
||||
register(
|
||||
_pubKey: BytesLike,
|
||||
_account: BytesLike,
|
||||
args: { pubKey: BytesLike; account: BytesLike },
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
transaction(
|
||||
_proof: BytesLike,
|
||||
_root: BytesLike,
|
||||
_newRoot: BytesLike,
|
||||
_inputNullifiers: BytesLike[],
|
||||
_outputCommitments: [BytesLike, BytesLike],
|
||||
_outPathIndices: BigNumberish,
|
||||
_extAmount: BigNumberish,
|
||||
_fee: BigNumberish,
|
||||
registerAndTransact(
|
||||
_registerArgs: { pubKey: BytesLike; account: BytesLike },
|
||||
_proofArgs: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
_extData: {
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
},
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
transaction(
|
||||
_args: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
_extData: {
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
},
|
||||
_extDataHash: BytesLike,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
|
||||
@ -378,15 +483,17 @@ export class TornadoPool extends BaseContract {
|
||||
verifier2(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
verifyProof(
|
||||
_proof: BytesLike,
|
||||
_root: BytesLike,
|
||||
_newRoot: BytesLike,
|
||||
_inputNullifiers: BytesLike[],
|
||||
_outputCommitments: [BytesLike, BytesLike],
|
||||
_outPathIndices: BigNumberish,
|
||||
_extAmount: BigNumberish,
|
||||
_fee: BigNumberish,
|
||||
_extDataHash: BytesLike,
|
||||
_args: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
overrides?: CallOverrides
|
||||
): Promise<boolean>;
|
||||
};
|
||||
@ -441,27 +548,50 @@ export class TornadoPool extends BaseContract {
|
||||
): Promise<BigNumber>;
|
||||
|
||||
register(
|
||||
_pubKey: BytesLike,
|
||||
_account: BytesLike,
|
||||
args: { pubKey: BytesLike; account: BytesLike },
|
||||
overrides?: Overrides & { from?: string | Promise<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
transaction(
|
||||
_proof: BytesLike,
|
||||
_root: BytesLike,
|
||||
_newRoot: BytesLike,
|
||||
_inputNullifiers: BytesLike[],
|
||||
_outputCommitments: [BytesLike, BytesLike],
|
||||
_outPathIndices: BigNumberish,
|
||||
_extAmount: BigNumberish,
|
||||
_fee: BigNumberish,
|
||||
registerAndTransact(
|
||||
_registerArgs: { pubKey: BytesLike; account: BytesLike },
|
||||
_proofArgs: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
_extData: {
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
},
|
||||
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
transaction(
|
||||
_args: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
_extData: {
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
},
|
||||
_extDataHash: BytesLike,
|
||||
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
||||
): Promise<BigNumber>;
|
||||
|
||||
@ -470,15 +600,17 @@ export class TornadoPool extends BaseContract {
|
||||
verifier2(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
verifyProof(
|
||||
_proof: BytesLike,
|
||||
_root: BytesLike,
|
||||
_newRoot: BytesLike,
|
||||
_inputNullifiers: BytesLike[],
|
||||
_outputCommitments: [BytesLike, BytesLike],
|
||||
_outPathIndices: BigNumberish,
|
||||
_extAmount: BigNumberish,
|
||||
_fee: BigNumberish,
|
||||
_extDataHash: BytesLike,
|
||||
_args: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
@ -510,27 +642,50 @@ export class TornadoPool extends BaseContract {
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
register(
|
||||
_pubKey: BytesLike,
|
||||
_account: BytesLike,
|
||||
args: { pubKey: BytesLike; account: BytesLike },
|
||||
overrides?: Overrides & { from?: string | Promise<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
transaction(
|
||||
_proof: BytesLike,
|
||||
_root: BytesLike,
|
||||
_newRoot: BytesLike,
|
||||
_inputNullifiers: BytesLike[],
|
||||
_outputCommitments: [BytesLike, BytesLike],
|
||||
_outPathIndices: BigNumberish,
|
||||
_extAmount: BigNumberish,
|
||||
_fee: BigNumberish,
|
||||
registerAndTransact(
|
||||
_registerArgs: { pubKey: BytesLike; account: BytesLike },
|
||||
_proofArgs: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
_extData: {
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
},
|
||||
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
transaction(
|
||||
_args: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
_extData: {
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
},
|
||||
_extDataHash: BytesLike,
|
||||
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
@ -539,15 +694,17 @@ export class TornadoPool extends BaseContract {
|
||||
verifier2(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
verifyProof(
|
||||
_proof: BytesLike,
|
||||
_root: BytesLike,
|
||||
_newRoot: BytesLike,
|
||||
_inputNullifiers: BytesLike[],
|
||||
_outputCommitments: [BytesLike, BytesLike],
|
||||
_outPathIndices: BigNumberish,
|
||||
_extAmount: BigNumberish,
|
||||
_fee: BigNumberish,
|
||||
_extDataHash: BytesLike,
|
||||
_args: {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: BytesLike[];
|
||||
outputCommitments: [BytesLike, BytesLike];
|
||||
outPathIndices: BigNumberish;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: BytesLike;
|
||||
},
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
};
|
||||
|
@ -216,14 +216,21 @@ const _abi = [
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "_pubKey",
|
||||
type: "bytes",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "_account",
|
||||
type: "bytes",
|
||||
components: [
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "pubKey",
|
||||
type: "bytes",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "account",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct TornadoPool.Register",
|
||||
name: "args",
|
||||
type: "tuple",
|
||||
},
|
||||
],
|
||||
name: "register",
|
||||
@ -234,44 +241,73 @@ const _abi = [
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "_proof",
|
||||
type: "bytes",
|
||||
components: [
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "pubKey",
|
||||
type: "bytes",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "account",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct TornadoPool.Register",
|
||||
name: "_registerArgs",
|
||||
type: "tuple",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "_root",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "_newRoot",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[]",
|
||||
name: "_inputNullifiers",
|
||||
type: "bytes32[]",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[2]",
|
||||
name: "_outputCommitments",
|
||||
type: "bytes32[2]",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_outPathIndices",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_extAmount",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_fee",
|
||||
type: "uint256",
|
||||
components: [
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "proof",
|
||||
type: "bytes",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "root",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "newRoot",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[]",
|
||||
name: "inputNullifiers",
|
||||
type: "bytes32[]",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[2]",
|
||||
name: "outputCommitments",
|
||||
type: "bytes32[2]",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "outPathIndices",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "extAmount",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "fee",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "extDataHash",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
internalType: "struct TornadoPool.Proof",
|
||||
name: "_proofArgs",
|
||||
type: "tuple",
|
||||
},
|
||||
{
|
||||
components: [
|
||||
@ -300,10 +336,92 @@ const _abi = [
|
||||
name: "_extData",
|
||||
type: "tuple",
|
||||
},
|
||||
],
|
||||
name: "registerAndTransact",
|
||||
outputs: [],
|
||||
stateMutability: "payable",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "_extDataHash",
|
||||
type: "bytes32",
|
||||
components: [
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "proof",
|
||||
type: "bytes",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "root",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "newRoot",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[]",
|
||||
name: "inputNullifiers",
|
||||
type: "bytes32[]",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[2]",
|
||||
name: "outputCommitments",
|
||||
type: "bytes32[2]",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "outPathIndices",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "extAmount",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "fee",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "extDataHash",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
internalType: "struct TornadoPool.Proof",
|
||||
name: "_args",
|
||||
type: "tuple",
|
||||
},
|
||||
{
|
||||
components: [
|
||||
{
|
||||
internalType: "address payable",
|
||||
name: "recipient",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "address payable",
|
||||
name: "relayer",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "encryptedOutput1",
|
||||
type: "bytes",
|
||||
},
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "encryptedOutput2",
|
||||
type: "bytes",
|
||||
},
|
||||
],
|
||||
internalType: "struct TornadoPool.ExtData",
|
||||
name: "_extData",
|
||||
type: "tuple",
|
||||
},
|
||||
],
|
||||
name: "transaction",
|
||||
@ -340,49 +458,56 @@ const _abi = [
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "_proof",
|
||||
type: "bytes",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "_root",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "_newRoot",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[]",
|
||||
name: "_inputNullifiers",
|
||||
type: "bytes32[]",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[2]",
|
||||
name: "_outputCommitments",
|
||||
type: "bytes32[2]",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_outPathIndices",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_extAmount",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "_fee",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "_extDataHash",
|
||||
type: "bytes32",
|
||||
components: [
|
||||
{
|
||||
internalType: "bytes",
|
||||
name: "proof",
|
||||
type: "bytes",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "root",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "newRoot",
|
||||
type: "bytes32",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[]",
|
||||
name: "inputNullifiers",
|
||||
type: "bytes32[]",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32[2]",
|
||||
name: "outputCommitments",
|
||||
type: "bytes32[2]",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "outPathIndices",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "extAmount",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "fee",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "bytes32",
|
||||
name: "extDataHash",
|
||||
type: "bytes32",
|
||||
},
|
||||
],
|
||||
internalType: "struct TornadoPool.Proof",
|
||||
name: "_args",
|
||||
type: "tuple",
|
||||
},
|
||||
],
|
||||
name: "verifyProof",
|
||||
|
@ -2,15 +2,12 @@ import { ChainId } from '@/types';
|
||||
|
||||
export const CONTRACT_NETWORKS: { [chainId in ChainId]: string } = {
|
||||
[ChainId.MAINNET]: '0x8Bfac9EF3d73cE08C7CEC339C0fE3B2e57814c1E',
|
||||
[ChainId.GOERLI]: '0x20a2D506cf52453D681F9E8E814A3437c6242B9e',
|
||||
[ChainId.OPTIMISM]: '0x1Ed4dcDB4b78985008199f451E88C6448C4EDd94',
|
||||
[ChainId.GOERLI]: '0x5900e35C0ED9807d36d6b9b06701e2004194fd5A',
|
||||
[ChainId.OPTIMISM]: '0xa7727c7807f401FF83a5F96D8b5C4E591b3B0E28',
|
||||
};
|
||||
|
||||
export const RPC_LIST: { [chainId in ChainId]: string } = {
|
||||
[ChainId.MAINNET]:
|
||||
'https://mainnet.infura.io/v3/eb6a84e726614079948e0b1efce5baa5',
|
||||
[ChainId.GOERLI]:
|
||||
'https://eth-goerli.alchemyapi.io/v2/hlSj0EqPUuLGyyTExs6UqFKnXDrc_eOh',
|
||||
[ChainId.OPTIMISM]:
|
||||
'https://optimism-kovan.infura.io/v3/8f786b96d16046b78e0287fa61c6fcf8',
|
||||
[ChainId.MAINNET]: 'https://mainnet.infura.io/v3/eb6a84e726614079948e0b1efce5baa5',
|
||||
[ChainId.GOERLI]: 'https://eth-goerli.alchemyapi.io/v2/hlSj0EqPUuLGyyTExs6UqFKnXDrc_eOh',
|
||||
[ChainId.OPTIMISM]: 'https://optimism-kovan.infura.io/v3/8f786b96d16046b78e0287fa61c6fcf8',
|
||||
};
|
||||
|
@ -22,7 +22,7 @@ const numbers = {
|
||||
TWO: 2,
|
||||
SECOND: 1000,
|
||||
ETH_DECIMALS: 18,
|
||||
MERKLE_TREE_HEIGHT: 32,
|
||||
MERKLE_TREE_HEIGHT: 23,
|
||||
};
|
||||
|
||||
const BG_ZERO = BigNumber.from(numbers.ZERO);
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { Job, Queue } from 'bull';
|
||||
import { BigNumber } from 'ethers';
|
||||
import { BigNumber, BigNumberish } from 'ethers';
|
||||
import { BytesLike } from '@ethersproject/bytes';
|
||||
import { TxManager } from 'tx-manager';
|
||||
|
||||
import { Injectable } from '@nestjs/common';
|
||||
@ -13,9 +14,28 @@ import txMangerConfig from '@/config/txManager.config';
|
||||
import { BaseProcessor } from './base.processor';
|
||||
import { ChainId } from '@/types';
|
||||
|
||||
export type ExtData = {
|
||||
recipient: string;
|
||||
relayer: string;
|
||||
encryptedOutput1: BytesLike;
|
||||
encryptedOutput2: BytesLike;
|
||||
};
|
||||
|
||||
export type ArgsProof = {
|
||||
proof: BytesLike;
|
||||
root: BytesLike;
|
||||
newRoot: BytesLike;
|
||||
inputNullifiers: string[];
|
||||
outputCommitments: BytesLike[];
|
||||
outPathIndices: string;
|
||||
extAmount: BigNumberish;
|
||||
fee: BigNumberish;
|
||||
extDataHash: string;
|
||||
};
|
||||
|
||||
export interface Withdrawal {
|
||||
args: string[];
|
||||
proof: string;
|
||||
extData: ExtData;
|
||||
args: ArgsProof;
|
||||
amount: string;
|
||||
txHash: string;
|
||||
status: string;
|
||||
@ -90,20 +110,18 @@ export class WithdrawalProcessor extends BaseProcessor<Withdrawal> {
|
||||
}
|
||||
}
|
||||
|
||||
async prepareTransaction({ proof, args }) {
|
||||
async prepareTransaction({ extData, args }) {
|
||||
const { chainId, address } = this.configService.get('base');
|
||||
|
||||
const contract = this.providerService.getTornadoPool();
|
||||
|
||||
// @ts-ignore
|
||||
const data = contract.interface.encodeFunctionData('transaction', [proof, ...args]);
|
||||
const data = contract.interface.encodeFunctionData('transaction', [args, extData]);
|
||||
|
||||
let gasLimit = this.configService.get<BigNumber>('base.gasLimit');
|
||||
|
||||
// need because optimism has dynamic gas limit
|
||||
if (chainId === ChainId.OPTIMISM) {
|
||||
// @ts-ignore
|
||||
gasLimit = await contract.estimateGas.transaction(proof, ...args, {
|
||||
gasLimit = await contract.estimateGas.transaction(args, extData, {
|
||||
from: address,
|
||||
value: BigNumber.from(0)._hex,
|
||||
gasPrice: toWei('0.015', 'gwei'),
|
||||
|
Loading…
Reference in New Issue
Block a user