From dfbd1d0afa5369c3858006e79d86beecd0d9bdfe Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Fri, 23 Aug 2024 15:40:50 -0400 Subject: [PATCH 1/8] Add conditions around solidity failure cases for hardhat network only Signed-off-by: Jim Zhang --- solidity/test/lib/deploy.ts | 9 + solidity/test/zeto_anon.ts | 86 +++---- solidity/test/zeto_anon_enc.ts | 79 ++++--- solidity/test/zeto_anon_enc_nullifier.ts | 201 ++++++++-------- ...zeto_anon_enc_nullifier_non_repudiation.ts | 204 +++++++++-------- solidity/test/zeto_anon_nullifier.ts | 214 +++++++++--------- solidity/test/zeto_anon_nullifier_kyc.ts | 20 +- solidity/test/zeto_nf_anon.ts | 49 ++-- solidity/test/zeto_nf_anon_nullifier.ts | 73 +++--- solidity/test/zkDvP.ts | 139 ++++++------ 10 files changed, 574 insertions(+), 500 deletions(-) diff --git a/solidity/test/lib/deploy.ts b/solidity/test/lib/deploy.ts index 26a2ff6..c65713a 100644 --- a/solidity/test/lib/deploy.ts +++ b/solidity/test/lib/deploy.ts @@ -9,6 +9,15 @@ import { ethers } from 'hardhat'; export async function deployZeto(tokenName: string) { let zeto, erc20, deployer; + // for testing with public chains, skip deployment if + // the contract address is provided + if (process.env.ZETO_ADDRESS && process.env.ERC20_ADDRESS) { + zeto = await ethers.getContractAt(tokenName, process.env.ZETO_ADDRESS); + erc20 = await ethers.getContractAt('SampleERC20', process.env.ERC20_ADDRESS); + deployer = (await ethers.getSigners())[0]; + return { deployer, zeto, erc20 }; + } + let isFungible = false; const fungibility = (fungibilities as any)[tokenName]; if (fungibility === 'fungible') { diff --git a/solidity/test/zeto_anon.ts b/solidity/test/zeto_anon.ts index 9d278fa..d3ac214 100644 --- a/solidity/test/zeto_anon.ts +++ b/solidity/test/zeto_anon.ts @@ -14,8 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import hre from 'hardhat'; -const { ethers } = hre; +import { ethers, network } from 'hardhat'; import { Signer, BigNumberish, AddressLike, ZeroAddress } from 'ethers'; import { expect } from 'chai'; import { loadCircuit, encodeProof, Poseidon } from "zeto-js"; @@ -45,6 +44,7 @@ describe("Zeto based fungible token with anonymity without encryption or nullifi let circuit: any, provingKey: any; before(async function () { + this.timeout(600000); let [d, a, b, c] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); @@ -53,9 +53,6 @@ describe("Zeto based fungible token with anonymity without encryption or nullifi ({ deployer, zeto, erc20 } = await deployZeto('Zeto_Anon')); - const tx3 = await zeto.connect(deployer).setERC20(erc20.target); - await tx3.wait(); - circuit = await loadCircuit('anon'); ({ provingKeyFile: provingKey } = loadProvingKeys('anon')); }); @@ -64,7 +61,7 @@ describe("Zeto based fungible token with anonymity without encryption or nullifi const tx = await erc20.connect(deployer).mint(Alice.ethAddress, 100); await tx.wait(); const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.equal(100); + expect(balance).to.be.gte(100); const tx1 = await erc20.connect(Alice.signer).approve(zeto.target, 100); await tx1.wait(); @@ -128,43 +125,52 @@ describe("Zeto based fungible token with anonymity without encryption or nullifi // Alice checks her ERC20 balance const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.equal(80); - }); - - it("Alice attempting to withdraw spent UTXOs should fail", async function () { - // Alice proposes the output ERC20 tokens - const outputCommitment = newUTXO(90, Alice); - - const { inputCommitments, outputCommitments, encodedProof } = await prepareWithdrawProof(Alice, [utxo100, ZERO_UTXO], outputCommitment); - - await expect(zeto.connect(Alice.signer).withdraw(10, inputCommitments, outputCommitments[0], encodedProof)).rejectedWith("UTXOAlreadySpent"); + expect(balance).to.be.gte(80); }); - it("mint existing unspent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo4])).rejectedWith("UTXOAlreadyOwned"); - }); - - it("mint existing spent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadySpent"); - }); - - it("transfer non-existing UTXOs should fail", async function () { - const nonExisting1 = newUTXO(10, Alice); - const nonExisting2 = newUTXO(20, Alice, nonExisting1.salt); - await expect(doTransfer(Alice, [nonExisting1, nonExisting2], [nonExisting1, nonExisting2], [Alice, Alice])).rejectedWith("UTXONotMinted"); - }); - - it("transfer spent UTXOs should fail (double spend protection)", async function () { - // create outputs - const utxo5 = newUTXO(25, Bob); - const utxo6 = newUTXO(5, Alice, utxo5.salt); - await expect(doTransfer(Alice, [utxo1, utxo2], [utxo5, utxo6], [Bob, Alice])).rejectedWith("UTXOAlreadySpent") - }); + describe('failure cases', function () { + // the following failure cases rely on the hardhat network + // to return the details of the errors. This is not possible + // on non-hardhat networks + if (network.name !== 'hardhat') { + return; + } - it("spend by using the same UTXO as both inputs should fail", async function () { - const utxo5 = newUTXO(20, Alice); - const utxo6 = newUTXO(10, Bob, utxo5.salt); - await expect(doTransfer(Bob, [utxo7, utxo7], [utxo5, utxo6], [Alice, Bob])).rejectedWith(`UTXODuplicate(${utxo7.hash.toString()}`); + it("Alice attempting to withdraw spent UTXOs should fail", async function () { + // Alice proposes the output ERC20 tokens + const outputCommitment = newUTXO(90, Alice); + + const { inputCommitments, outputCommitments, encodedProof } = await prepareWithdrawProof(Alice, [utxo100, ZERO_UTXO], outputCommitment); + + await expect(zeto.connect(Alice.signer).withdraw(10, inputCommitments, outputCommitments[0], encodedProof)).rejectedWith("UTXOAlreadySpent"); + }); + + it("mint existing unspent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo4])).rejectedWith("UTXOAlreadyOwned"); + }); + + it("mint existing spent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadySpent"); + }); + + it("transfer non-existing UTXOs should fail", async function () { + const nonExisting1 = newUTXO(10, Alice); + const nonExisting2 = newUTXO(20, Alice, nonExisting1.salt); + await expect(doTransfer(Alice, [nonExisting1, nonExisting2], [nonExisting1, nonExisting2], [Alice, Alice])).rejectedWith("UTXONotMinted"); + }); + + it("transfer spent UTXOs should fail (double spend protection)", async function () { + // create outputs + const utxo5 = newUTXO(25, Bob); + const utxo6 = newUTXO(5, Alice, utxo5.salt); + await expect(doTransfer(Alice, [utxo1, utxo2], [utxo5, utxo6], [Bob, Alice])).rejectedWith("UTXOAlreadySpent") + }); + + it("spend by using the same UTXO as both inputs should fail", async function () { + const utxo5 = newUTXO(20, Alice); + const utxo6 = newUTXO(10, Bob, utxo5.salt); + await expect(doTransfer(Bob, [utxo7, utxo7], [utxo5, utxo6], [Alice, Bob])).rejectedWith(`UTXODuplicate(${utxo7.hash.toString()}`); + }); }); async function doTransfer(signer: User, inputs: UTXO[], outputs: UTXO[], owners: User[]) { diff --git a/solidity/test/zeto_anon_enc.ts b/solidity/test/zeto_anon_enc.ts index 1faf63b..de38ffa 100644 --- a/solidity/test/zeto_anon_enc.ts +++ b/solidity/test/zeto_anon_enc.ts @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ethers } from 'hardhat'; +import { ethers, network } from 'hardhat'; import { ContractTransactionReceipt, Signer, BigNumberish } from 'ethers'; import { expect } from 'chai'; import { loadCircuit, poseidonDecrypt, encodeProof, Poseidon } from "zeto-js"; @@ -41,6 +41,7 @@ describe("Zeto based fungible token with anonymity and encryption", function () let circuit: any, provingKey: any; before(async function () { + this.timeout(600000); let [d, a, b, c] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); @@ -49,9 +50,6 @@ describe("Zeto based fungible token with anonymity and encryption", function () ({ deployer, zeto, erc20 } = await deployZeto('Zeto_AnonEnc')); - const tx4 = await zeto.connect(deployer).setERC20(erc20.target); - await tx4.wait(); - circuit = await loadCircuit('anon_enc'); ({ provingKeyFile: provingKey } = loadProvingKeys('anon_enc')); }); @@ -60,7 +58,7 @@ describe("Zeto based fungible token with anonymity and encryption", function () const tx = await erc20.connect(deployer).mint(Alice.ethAddress, 100); await tx.wait(); const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.equal(100); + expect(balance).to.be.gte(100); const tx1 = await erc20.connect(Alice.signer).approve(zeto.target, 100); await tx1.wait(); @@ -124,47 +122,56 @@ describe("Zeto based fungible token with anonymity and encryption", function () // Alice checks her ERC20 balance const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.equal(80); + expect(balance).to.be.gte(80); }); - it("Alice attempting to withdraw spent UTXOs should fail", async function () { - // Alice proposes the output ERC20 tokens - const outputCommitment = newUTXO(90, Alice); + describe("failure cases", function () { + // the following failure cases rely on the hardhat network + // to return the details of the errors. This is not possible + // on non-hardhat networks + if (network.name !== 'hardhat') { + return; + } - const { inputCommitments, outputCommitments, encodedProof } = await prepareWithdrawProof(Alice, [utxo100, ZERO_UTXO], outputCommitment); + it("Alice attempting to withdraw spent UTXOs should fail", async function () { + // Alice proposes the output ERC20 tokens + const outputCommitment = newUTXO(90, Alice); - await expect(zeto.connect(Alice.signer).withdraw(10, inputCommitments, outputCommitments[0], encodedProof)).rejectedWith("UTXOAlreadySpent"); - }); + const { inputCommitments, outputCommitments, encodedProof } = await prepareWithdrawProof(Alice, [utxo100, ZERO_UTXO], outputCommitment); - it("mint existing unspent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo4])).rejectedWith("UTXOAlreadyOwned"); - }); + await expect(zeto.connect(Alice.signer).withdraw(10, inputCommitments, outputCommitments[0], encodedProof)).rejectedWith("UTXOAlreadySpent"); + }); - it("mint existing spent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadySpent"); - }); + it("mint existing unspent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo4])).rejectedWith("UTXOAlreadyOwned"); + }); - it("transfer non-existing UTXOs should fail", async function () { - const nonExisting1 = newUTXO(10, Alice); - const nonExisting2 = newUTXO(20, Alice, nonExisting1.salt); - await expect(doTransfer(Alice, [nonExisting1, nonExisting2], [nonExisting1, nonExisting2], [Alice, Alice])).rejectedWith("UTXONotMinted"); - }); + it("mint existing spent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadySpent"); + }); - it("transfer spent UTXOs should fail (double spend protection)", async function () { - // create outputs - const _utxo1 = newUTXO(25, Bob); - const _utxo2 = newUTXO(5, Alice); - await expect(doTransfer(Alice, [utxo1, utxo2], [_utxo1, _utxo2], [Bob, Alice])).rejectedWith("UTXOAlreadySpent") - }); + it("transfer non-existing UTXOs should fail", async function () { + const nonExisting1 = newUTXO(10, Alice); + const nonExisting2 = newUTXO(20, Alice, nonExisting1.salt); + await expect(doTransfer(Alice, [nonExisting1, nonExisting2], [nonExisting1, nonExisting2], [Alice, Alice])).rejectedWith("UTXONotMinted"); + }); + + it("transfer spent UTXOs should fail (double spend protection)", async function () { + // create outputs + const _utxo1 = newUTXO(25, Bob); + const _utxo2 = newUTXO(5, Alice); + await expect(doTransfer(Alice, [utxo1, utxo2], [_utxo1, _utxo2], [Bob, Alice])).rejectedWith("UTXOAlreadySpent") + }); - it("spend by using the same UTXO as both inputs should fail", async function () { - // mint a new UTXO to Bob - const _utxo1 = newUTXO(20, Bob); - await doMint(zeto, deployer, [_utxo1]); + it("spend by using the same UTXO as both inputs should fail", async function () { + // mint a new UTXO to Bob + const _utxo1 = newUTXO(20, Bob); + await doMint(zeto, deployer, [_utxo1]); - const _utxo2 = newUTXO(25, Alice); - const _utxo3 = newUTXO(15, Bob); - await expect(doTransfer(Bob, [_utxo1, _utxo1], [_utxo2, _utxo3], [Alice, Bob])).rejectedWith(`UTXODuplicate(${_utxo1.hash.toString()}`); + const _utxo2 = newUTXO(25, Alice); + const _utxo3 = newUTXO(15, Bob); + await expect(doTransfer(Bob, [_utxo1, _utxo1], [_utxo2, _utxo3], [Alice, Bob])).rejectedWith(`UTXODuplicate(${_utxo1.hash.toString()}`); + }); }); async function doTransfer(signer: User, inputs: UTXO[], outputs: UTXO[], owners: User[]) { diff --git a/solidity/test/zeto_anon_enc_nullifier.ts b/solidity/test/zeto_anon_enc_nullifier.ts index 43f1ea9..4d537c3 100644 --- a/solidity/test/zeto_anon_enc_nullifier.ts +++ b/solidity/test/zeto_anon_enc_nullifier.ts @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ethers } from 'hardhat'; +import { ethers, network } from 'hardhat'; import { ContractTransactionReceipt, Signer, BigNumberish } from 'ethers'; import { expect } from 'chai'; import { loadCircuit, poseidonDecrypt, encodeProof } from "zeto-js"; @@ -43,6 +43,7 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti let smtBob: Merkletree; before(async function () { + this.timeout(600000); let [d, a, b, c] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); @@ -51,9 +52,6 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti ({ deployer, zeto, erc20 } = await deployZeto('Zeto_AnonEncNullifier')); - const tx4 = await zeto.connect(deployer).setERC20(erc20.target); - await tx4.wait(); - circuit = await loadCircuit('anon_enc_nullifier'); ({ provingKeyFile: provingKey } = loadProvingKeys('anon_enc_nullifier')); @@ -75,7 +73,7 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti const tx = await erc20.connect(deployer).mint(Alice.ethAddress, 100); await tx.wait(); const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.equal(100); + expect(balance).to.be.gte(100); const tx1 = await erc20.connect(Alice.signer).approve(zeto.target, 100); await tx1.wait(); @@ -198,108 +196,117 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti // Alice checks her ERC20 balance const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.equal(80); + expect(balance).to.be.gte(80); }); - it("Alice attempting to withdraw spent UTXOs should fail", async function () { - // Alice generates the nullifiers for the UTXOs to be spent - const nullifier1 = newNullifier(utxo100, Alice); + describe("failure cases", function () { + // the following failure cases rely on the hardhat network + // to return the details of the errors. This is not possible + // on non-hardhat networks + if (network.name !== 'hardhat') { + return; + } - // Alice generates inclusion proofs for the UTXOs to be spent - let root = await smtAlice.root(); - const proof1 = await smtAlice.generateCircomVerifierProof(utxo100.hash, root); - const proof2 = await smtAlice.generateCircomVerifierProof(0n, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + it("Alice attempting to withdraw spent UTXOs should fail", async function () { + // Alice generates the nullifiers for the UTXOs to be spent + const nullifier1 = newNullifier(utxo100, Alice); - // Alice proposes the output ERC20 tokens - const outputCommitment = newUTXO(90, Alice); + // Alice generates inclusion proofs for the UTXOs to be spent + let root = await smtAlice.root(); + const proof1 = await smtAlice.generateCircomVerifierProof(utxo100.hash, root); + const proof2 = await smtAlice.generateCircomVerifierProof(0n, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; - const { nullifiers, outputCommitments, encodedProof } = await prepareNullifierWithdrawProof(Alice, [utxo100, ZERO_UTXO], [nullifier1, ZERO_UTXO], outputCommitment, root.bigInt(), merkleProofs); + // Alice proposes the output ERC20 tokens + const outputCommitment = newUTXO(90, Alice); - // Alice withdraws her UTXOs to ERC20 tokens - await expect(zeto.connect(Alice.signer).withdraw(10, nullifiers, outputCommitments[0], root.bigInt(), encodedProof)).rejectedWith("UTXOAlreadySpent"); - }); + const { nullifiers, outputCommitments, encodedProof } = await prepareNullifierWithdrawProof(Alice, [utxo100, ZERO_UTXO], [nullifier1, ZERO_UTXO], outputCommitment, root.bigInt(), merkleProofs); - it("mint existing unspent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo4])).rejectedWith("UTXOAlreadyOwned"); - }); - - it("mint existing spent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadyOwned"); - }); - - it("transfer spent UTXOs should fail (double spend protection)", async function () { - // create outputs - const _utxo1 = newUTXO(25, Bob); - const _utxo2 = newUTXO(5, Alice); - - // generate the nullifiers for the UTXOs to be spent - const nullifier1 = newNullifier(utxo1, Alice); - const nullifier2 = newNullifier(utxo2, Alice); - - // generate inclusion proofs for the UTXOs to be spent - let root = await smtAlice.root(); - const proof1 = await smtAlice.generateCircomVerifierProof(utxo1.hash, root); - const proof2 = await smtAlice.generateCircomVerifierProof(utxo2.hash, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; - - await expect(doTransfer(Alice, [utxo1, utxo2], [nullifier1, nullifier2], [_utxo1, _utxo2], root.bigInt(), merkleProofs, [Bob, Alice])).rejectedWith("UTXOAlreadySpent") - }).timeout(600000); - - it("transfer with existing UTXOs in the output should fail (mass conservation protection)", async function () { - // give Bob another UTXO to be able to spend - const _utxo1 = newUTXO(15, Bob); - await doMint(zeto, deployer, [_utxo1]); - await smtBob.add(_utxo1.hash, _utxo1.hash); - - const nullifier1 = newNullifier(utxo7, Bob); - const nullifier2 = newNullifier(_utxo1, Bob); - let root = await smtBob.root(); - const proof1 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); - const proof2 = await smtBob.generateCircomVerifierProof(_utxo1.hash, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; - - await expect(doTransfer(Bob, [utxo7, _utxo1], [nullifier1, nullifier2], [utxo1, utxo2], root.bigInt(), merkleProofs, [Alice, Alice])).rejectedWith("UTXOAlreadyOwned") - }).timeout(600000); - - it("spend by using the same UTXO as both inputs should fail", async function () { - const _utxo1 = newUTXO(20, Alice); - const _utxo2 = newUTXO(10, Bob); - const nullifier1 = newNullifier(utxo7, Bob); - const nullifier2 = newNullifier(utxo7, Bob); - // generate inclusion proofs for the UTXOs to be spent - let root = await smtBob.root(); - const proof1 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); - const proof2 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; - - await expect(doTransfer(Bob, [utxo7, utxo7], [nullifier1, nullifier2], [_utxo1, _utxo2], root.bigInt(), merkleProofs, [Alice, Bob])).rejectedWith(`UTXODuplicate`); - }).timeout(600000); - - it("transfer non-existing UTXOs should fail", async function () { - const nonExisting1 = newUTXO(25, Alice); - const nonExisting2 = newUTXO(20, Alice, nonExisting1.salt); - - // add to our local SMT (but they don't exist on the chain) - await smtAlice.add(nonExisting1.hash, nonExisting1.hash); - await smtAlice.add(nonExisting2.hash, nonExisting2.hash); - - // generate the nullifiers for the UTXOs to be spent - const nullifier1 = newNullifier(nonExisting1, Alice); - const nullifier2 = newNullifier(nonExisting2, Alice); + // Alice withdraws her UTXOs to ERC20 tokens + await expect(zeto.connect(Alice.signer).withdraw(10, nullifiers, outputCommitments[0], root.bigInt(), encodedProof)).rejectedWith("UTXOAlreadySpent"); + }); - // generate inclusion proofs for the UTXOs to be spent - let root = await smtAlice.root(); - const proof1 = await smtAlice.generateCircomVerifierProof(nonExisting1.hash, root); - const proof2 = await smtAlice.generateCircomVerifierProof(nonExisting2.hash, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + it("mint existing unspent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo4])).rejectedWith("UTXOAlreadyOwned"); + }); - // propose the output UTXOs - const _utxo1 = newUTXO(30, Charlie); - utxo7 = newUTXO(15, Bob); + it("mint existing spent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadyOwned"); + }); - await expect(doTransfer(Alice, [nonExisting1, nonExisting2], [nullifier1, nullifier2], [utxo7, _utxo1], root.bigInt(), merkleProofs, [Bob, Charlie])).rejectedWith("UTXORootNotFound"); - }).timeout(600000); + it("transfer spent UTXOs should fail (double spend protection)", async function () { + // create outputs + const _utxo1 = newUTXO(25, Bob); + const _utxo2 = newUTXO(5, Alice); + + // generate the nullifiers for the UTXOs to be spent + const nullifier1 = newNullifier(utxo1, Alice); + const nullifier2 = newNullifier(utxo2, Alice); + + // generate inclusion proofs for the UTXOs to be spent + let root = await smtAlice.root(); + const proof1 = await smtAlice.generateCircomVerifierProof(utxo1.hash, root); + const proof2 = await smtAlice.generateCircomVerifierProof(utxo2.hash, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + await expect(doTransfer(Alice, [utxo1, utxo2], [nullifier1, nullifier2], [_utxo1, _utxo2], root.bigInt(), merkleProofs, [Bob, Alice])).rejectedWith("UTXOAlreadySpent") + }).timeout(600000); + + it("transfer with existing UTXOs in the output should fail (mass conservation protection)", async function () { + // give Bob another UTXO to be able to spend + const _utxo1 = newUTXO(15, Bob); + await doMint(zeto, deployer, [_utxo1]); + await smtBob.add(_utxo1.hash, _utxo1.hash); + + const nullifier1 = newNullifier(utxo7, Bob); + const nullifier2 = newNullifier(_utxo1, Bob); + let root = await smtBob.root(); + const proof1 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); + const proof2 = await smtBob.generateCircomVerifierProof(_utxo1.hash, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + await expect(doTransfer(Bob, [utxo7, _utxo1], [nullifier1, nullifier2], [utxo1, utxo2], root.bigInt(), merkleProofs, [Alice, Alice])).rejectedWith("UTXOAlreadyOwned") + }).timeout(600000); + + it("spend by using the same UTXO as both inputs should fail", async function () { + const _utxo1 = newUTXO(20, Alice); + const _utxo2 = newUTXO(10, Bob); + const nullifier1 = newNullifier(utxo7, Bob); + const nullifier2 = newNullifier(utxo7, Bob); + // generate inclusion proofs for the UTXOs to be spent + let root = await smtBob.root(); + const proof1 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); + const proof2 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + await expect(doTransfer(Bob, [utxo7, utxo7], [nullifier1, nullifier2], [_utxo1, _utxo2], root.bigInt(), merkleProofs, [Alice, Bob])).rejectedWith(`UTXODuplicate`); + }).timeout(600000); + + it("transfer non-existing UTXOs should fail", async function () { + const nonExisting1 = newUTXO(25, Alice); + const nonExisting2 = newUTXO(20, Alice, nonExisting1.salt); + + // add to our local SMT (but they don't exist on the chain) + await smtAlice.add(nonExisting1.hash, nonExisting1.hash); + await smtAlice.add(nonExisting2.hash, nonExisting2.hash); + + // generate the nullifiers for the UTXOs to be spent + const nullifier1 = newNullifier(nonExisting1, Alice); + const nullifier2 = newNullifier(nonExisting2, Alice); + + // generate inclusion proofs for the UTXOs to be spent + let root = await smtAlice.root(); + const proof1 = await smtAlice.generateCircomVerifierProof(nonExisting1.hash, root); + const proof2 = await smtAlice.generateCircomVerifierProof(nonExisting2.hash, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + // propose the output UTXOs + const _utxo1 = newUTXO(30, Charlie); + utxo7 = newUTXO(15, Bob); + + await expect(doTransfer(Alice, [nonExisting1, nonExisting2], [nullifier1, nullifier2], [utxo7, _utxo1], root.bigInt(), merkleProofs, [Bob, Charlie])).rejectedWith("UTXORootNotFound"); + }).timeout(600000); + }); async function doTransfer(signer: User, inputs: UTXO[], _nullifiers: UTXO[], outputs: UTXO[], root: BigInt, merkleProofs: BigInt[][], owners: User[]) { let nullifiers: [BigNumberish, BigNumberish]; diff --git a/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts b/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts index 5752df2..7d0e1f8 100644 --- a/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts +++ b/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ethers } from 'hardhat'; +import { ethers, network } from 'hardhat'; import { ContractTransactionReceipt, Signer, BigNumberish } from 'ethers'; import { expect } from 'chai'; import { loadCircuit, poseidonDecrypt, encodeProof, Poseidon } from "zeto-js"; @@ -44,6 +44,7 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti let smtBob: Merkletree; before(async function () { + this.timeout(600000); let [d, a, b, c, e] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); @@ -53,10 +54,8 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti ({ deployer, zeto, erc20 } = await deployZeto('Zeto_AnonEncNullifierNonRepudiation')); - const tx4 = await zeto.connect(deployer).setERC20(erc20.target); - await tx4.wait(); - const tx5 = await zeto.connect(deployer).setArbiter(Authority.babyJubPublicKey); - await tx5.wait(); + const tx1 = await zeto.connect(deployer).setArbiter(Authority.babyJubPublicKey); + await tx1.wait(); circuit = await loadCircuit('anon_enc_nullifier_non_repudiation'); ({ provingKeyFile: provingKey } = loadProvingKeys('anon_enc_nullifier_non_repudiation')); @@ -79,7 +78,7 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti const tx = await erc20.connect(deployer).mint(Alice.ethAddress, 100); await tx.wait(); const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.equal(100); + expect(balance).to.be.gte(100); const tx1 = await erc20.connect(Alice.signer).approve(zeto.target, 100); await tx1.wait(); @@ -234,108 +233,117 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti // Alice checks her ERC20 balance const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.equal(80); + expect(balance).to.be.gte(80); }); - it("Alice attempting to withdraw spent UTXOs should fail", async function () { - // Alice generates the nullifiers for the UTXOs to be spent - const nullifier1 = newNullifier(utxo100, Alice); - - // Alice generates inclusion proofs for the UTXOs to be spent - let root = await smtAlice.root(); - const proof1 = await smtAlice.generateCircomVerifierProof(utxo100.hash, root); - const proof2 = await smtAlice.generateCircomVerifierProof(0n, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; - - // Alice proposes the output ERC20 tokens - const outputCommitment = newUTXO(20, Alice); - - const { nullifiers, outputCommitments, encodedProof } = await prepareNullifierWithdrawProof(Alice, [utxo100, ZERO_UTXO], [nullifier1, ZERO_UTXO], outputCommitment, root.bigInt(), merkleProofs); - - // Alice withdraws her UTXOs to ERC20 tokens - await expect(zeto.connect(Alice.signer).withdraw(80, nullifiers, outputCommitments[0], root.bigInt(), encodedProof)).rejectedWith("UTXOAlreadySpent"); - }); - - it("mint existing unspent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo4])).rejectedWith("UTXOAlreadyOwned"); - }); - - it("mint existing spent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadyOwned"); - }); - - it("transfer spent UTXOs should fail (double spend protection)", async function () { - // create outputs - const _utxo1 = newUTXO(25, Bob); - const _utxo2 = newUTXO(5, Alice); - - // generate the nullifiers for the UTXOs to be spent - const nullifier1 = newNullifier(utxo1, Alice); - const nullifier2 = newNullifier(utxo2, Alice); - - // generate inclusion proofs for the UTXOs to be spent - let root = await smtAlice.root(); - const proof1 = await smtAlice.generateCircomVerifierProof(utxo1.hash, root); - const proof2 = await smtAlice.generateCircomVerifierProof(utxo2.hash, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + describe.skip("failure cases", function () { + // the following failure cases rely on the hardhat network + // to return the details of the errors. This is not possible + // on non-hardhat networks + if (network.name !== 'hardhat') { + return; + } - await expect(doTransfer(Alice, [utxo1, utxo2], [nullifier1, nullifier2], [_utxo1, _utxo2], root.bigInt(), merkleProofs, [Bob, Alice])).rejectedWith("UTXOAlreadySpent") - }).timeout(600000); + it("Alice attempting to withdraw spent UTXOs should fail", async function () { + // Alice generates the nullifiers for the UTXOs to be spent + const nullifier1 = newNullifier(utxo100, Alice); - it("transfer with existing UTXOs in the output should fail (mass conservation protection)", async function () { - // give Bob another UTXO to be able to spend - const _utxo1 = newUTXO(15, Bob); - await doMint(zeto, deployer, [_utxo1]); - await smtBob.add(_utxo1.hash, _utxo1.hash); - - const nullifier1 = newNullifier(utxo7, Bob); - const nullifier2 = newNullifier(_utxo1, Bob); - let root = await smtBob.root(); - const proof1 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); - const proof2 = await smtBob.generateCircomVerifierProof(_utxo1.hash, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + // Alice generates inclusion proofs for the UTXOs to be spent + let root = await smtAlice.root(); + const proof1 = await smtAlice.generateCircomVerifierProof(utxo100.hash, root); + const proof2 = await smtAlice.generateCircomVerifierProof(0n, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; - await expect(doTransfer(Bob, [utxo7, _utxo1], [nullifier1, nullifier2], [utxo1, utxo2], root.bigInt(), merkleProofs, [Alice, Alice])).rejectedWith("UTXOAlreadyOwned") - }).timeout(600000); + // Alice proposes the output ERC20 tokens + const outputCommitment = newUTXO(20, Alice); - it("spend by using the same UTXO as both inputs should fail", async function () { - const _utxo1 = newUTXO(20, Alice); - const _utxo2 = newUTXO(10, Bob); - const nullifier1 = newNullifier(utxo7, Bob); - const nullifier2 = newNullifier(utxo7, Bob); - // generate inclusion proofs for the UTXOs to be spent - let root = await smtBob.root(); - const proof1 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); - const proof2 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + const { nullifiers, outputCommitments, encodedProof } = await prepareNullifierWithdrawProof(Alice, [utxo100, ZERO_UTXO], [nullifier1, ZERO_UTXO], outputCommitment, root.bigInt(), merkleProofs); - await expect(doTransfer(Bob, [utxo7, utxo7], [nullifier1, nullifier2], [_utxo1, _utxo2], root.bigInt(), merkleProofs, [Alice, Bob])).rejectedWith(`UTXODuplicate`); - }).timeout(600000); - - it("transfer non-existing UTXOs should fail", async function () { - const nonExisting1 = newUTXO(25, Alice); - const nonExisting2 = newUTXO(20, Alice, nonExisting1.salt); - - // add to our local SMT (but they don't exist on the chain) - await smtAlice.add(nonExisting1.hash, nonExisting1.hash); - await smtAlice.add(nonExisting2.hash, nonExisting2.hash); - - // generate the nullifiers for the UTXOs to be spent - const nullifier1 = newNullifier(nonExisting1, Alice); - const nullifier2 = newNullifier(nonExisting2, Alice); + // Alice withdraws her UTXOs to ERC20 tokens + await expect(zeto.connect(Alice.signer).withdraw(80, nullifiers, outputCommitments[0], root.bigInt(), encodedProof)).rejectedWith("UTXOAlreadySpent"); + }); - // generate inclusion proofs for the UTXOs to be spent - let root = await smtAlice.root(); - const proof1 = await smtAlice.generateCircomVerifierProof(nonExisting1.hash, root); - const proof2 = await smtAlice.generateCircomVerifierProof(nonExisting2.hash, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + it("mint existing unspent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo4])).rejectedWith("UTXOAlreadyOwned"); + }); - // propose the output UTXOs - const _utxo1 = newUTXO(30, Charlie); - utxo7 = newUTXO(15, Bob); + it("mint existing spent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadyOwned"); + }); - await expect(doTransfer(Alice, [nonExisting1, nonExisting2], [nullifier1, nullifier2], [utxo7, _utxo1], root.bigInt(), merkleProofs, [Bob, Charlie])).rejectedWith("UTXORootNotFound"); - }).timeout(600000); + it("transfer spent UTXOs should fail (double spend protection)", async function () { + // create outputs + const _utxo1 = newUTXO(25, Bob); + const _utxo2 = newUTXO(5, Alice); + + // generate the nullifiers for the UTXOs to be spent + const nullifier1 = newNullifier(utxo1, Alice); + const nullifier2 = newNullifier(utxo2, Alice); + + // generate inclusion proofs for the UTXOs to be spent + let root = await smtAlice.root(); + const proof1 = await smtAlice.generateCircomVerifierProof(utxo1.hash, root); + const proof2 = await smtAlice.generateCircomVerifierProof(utxo2.hash, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + await expect(doTransfer(Alice, [utxo1, utxo2], [nullifier1, nullifier2], [_utxo1, _utxo2], root.bigInt(), merkleProofs, [Bob, Alice])).rejectedWith("UTXOAlreadySpent") + }).timeout(600000); + + it("transfer with existing UTXOs in the output should fail (mass conservation protection)", async function () { + // give Bob another UTXO to be able to spend + const _utxo1 = newUTXO(15, Bob); + await doMint(zeto, deployer, [_utxo1]); + await smtBob.add(_utxo1.hash, _utxo1.hash); + + const nullifier1 = newNullifier(utxo7, Bob); + const nullifier2 = newNullifier(_utxo1, Bob); + let root = await smtBob.root(); + const proof1 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); + const proof2 = await smtBob.generateCircomVerifierProof(_utxo1.hash, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + await expect(doTransfer(Bob, [utxo7, _utxo1], [nullifier1, nullifier2], [utxo1, utxo2], root.bigInt(), merkleProofs, [Alice, Alice])).rejectedWith("UTXOAlreadyOwned") + }).timeout(600000); + + it("spend by using the same UTXO as both inputs should fail", async function () { + const _utxo1 = newUTXO(20, Alice); + const _utxo2 = newUTXO(10, Bob); + const nullifier1 = newNullifier(utxo7, Bob); + const nullifier2 = newNullifier(utxo7, Bob); + // generate inclusion proofs for the UTXOs to be spent + let root = await smtBob.root(); + const proof1 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); + const proof2 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + await expect(doTransfer(Bob, [utxo7, utxo7], [nullifier1, nullifier2], [_utxo1, _utxo2], root.bigInt(), merkleProofs, [Alice, Bob])).rejectedWith(`UTXODuplicate`); + }).timeout(600000); + + it("transfer non-existing UTXOs should fail", async function () { + const nonExisting1 = newUTXO(25, Alice); + const nonExisting2 = newUTXO(20, Alice, nonExisting1.salt); + + // add to our local SMT (but they don't exist on the chain) + await smtAlice.add(nonExisting1.hash, nonExisting1.hash); + await smtAlice.add(nonExisting2.hash, nonExisting2.hash); + + // generate the nullifiers for the UTXOs to be spent + const nullifier1 = newNullifier(nonExisting1, Alice); + const nullifier2 = newNullifier(nonExisting2, Alice); + + // generate inclusion proofs for the UTXOs to be spent + let root = await smtAlice.root(); + const proof1 = await smtAlice.generateCircomVerifierProof(nonExisting1.hash, root); + const proof2 = await smtAlice.generateCircomVerifierProof(nonExisting2.hash, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + // propose the output UTXOs + const _utxo1 = newUTXO(30, Charlie); + utxo7 = newUTXO(15, Bob); + + await expect(doTransfer(Alice, [nonExisting1, nonExisting2], [nullifier1, nullifier2], [utxo7, _utxo1], root.bigInt(), merkleProofs, [Bob, Charlie])).rejectedWith("UTXORootNotFound"); + }).timeout(600000); + }); async function doTransfer(signer: User, inputs: UTXO[], _nullifiers: UTXO[], outputs: UTXO[], root: BigInt, merkleProofs: BigInt[][], owners: User[]) { let nullifiers: [BigNumberish, BigNumberish]; diff --git a/solidity/test/zeto_anon_nullifier.ts b/solidity/test/zeto_anon_nullifier.ts index f877dd1..3c18f16 100644 --- a/solidity/test/zeto_anon_nullifier.ts +++ b/solidity/test/zeto_anon_nullifier.ts @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ethers } from 'hardhat'; +import { ethers, network } from 'hardhat'; import { ContractTransactionReceipt, Signer, BigNumberish } from 'ethers'; import { expect } from 'chai'; import { loadCircuit, Poseidon, encodeProof } from "zeto-js"; @@ -42,6 +42,8 @@ describe("Zeto based fungible token with anonymity using nullifiers without encr let smtBob: Merkletree; before(async function () { + this.timeout(600000); + let [d, a, b, c] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); @@ -50,9 +52,6 @@ describe("Zeto based fungible token with anonymity using nullifiers without encr ({ deployer, zeto, erc20 } = await deployZeto('Zeto_AnonNullifier')); - const tx4 = await zeto.connect(deployer).setERC20(erc20.target); - await tx4.wait(); - circuit = await loadCircuit('anon_nullifier'); ({ provingKeyFile: provingKey } = loadProvingKeys('anon_nullifier')); @@ -74,7 +73,7 @@ describe("Zeto based fungible token with anonymity using nullifiers without encr const tx = await erc20.connect(deployer).mint(Alice.ethAddress, 100); await tx.wait(); const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.equal(100); + expect(balance).to.be.gte(100); const tx1 = await erc20.connect(Alice.signer).approve(zeto.target, 100); await tx1.wait(); @@ -199,108 +198,117 @@ describe("Zeto based fungible token with anonymity using nullifiers without encr // Alice checks her ERC20 balance const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.equal(80); - }); - - it("Alice attempting to withdraw spent UTXOs should fail", async function () { - // Alice generates the nullifiers for the UTXOs to be spent - const nullifier1 = newNullifier(utxo100, Alice); - - // Alice generates inclusion proofs for the UTXOs to be spent - let root = await smtAlice.root(); - const proof1 = await smtAlice.generateCircomVerifierProof(utxo100.hash, root); - const proof2 = await smtAlice.generateCircomVerifierProof(0n, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; - - // Alice proposes the output ERC20 tokens - const outputCommitment = newUTXO(90, Alice); - - const { nullifiers, outputCommitments, encodedProof } = await prepareNullifierWithdrawProof(Alice, [utxo100, ZERO_UTXO], [nullifier1, ZERO_UTXO], outputCommitment, root.bigInt(), merkleProofs); - - await expect(zeto.connect(Alice.signer).withdraw(10, nullifiers, outputCommitments[0], root.bigInt(), encodedProof)).rejectedWith("UTXOAlreadySpent"); - }); - - it("mint existing unspent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo4])).rejectedWith("UTXOAlreadyOwned"); + expect(balance).to.be.gte(80); }); - it("mint existing spent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadyOwned"); + describe("failure cases", function () { + // the following failure cases rely on the hardhat network + // to return the details of the errors. This is not possible + // on non-hardhat networks + if (network.name !== 'hardhat') { + return; + } + + it("Alice attempting to withdraw spent UTXOs should fail", async function () { + // Alice generates the nullifiers for the UTXOs to be spent + const nullifier1 = newNullifier(utxo100, Alice); + + // Alice generates inclusion proofs for the UTXOs to be spent + let root = await smtAlice.root(); + const proof1 = await smtAlice.generateCircomVerifierProof(utxo100.hash, root); + const proof2 = await smtAlice.generateCircomVerifierProof(0n, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + // Alice proposes the output ERC20 tokens + const outputCommitment = newUTXO(90, Alice); + + const { nullifiers, outputCommitments, encodedProof } = await prepareNullifierWithdrawProof(Alice, [utxo100, ZERO_UTXO], [nullifier1, ZERO_UTXO], outputCommitment, root.bigInt(), merkleProofs); + + await expect(zeto.connect(Alice.signer).withdraw(10, nullifiers, outputCommitments[0], root.bigInt(), encodedProof)).rejectedWith("UTXOAlreadySpent"); + }); + + it("mint existing unspent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo4])).rejectedWith("UTXOAlreadyOwned"); + }); + + it("mint existing spent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadyOwned"); + }); + + it("transfer spent UTXOs should fail (double spend protection)", async function () { + // create outputs + const _utxo1 = newUTXO(25, Bob); + const _utxo2 = newUTXO(5, Alice); + + // generate the nullifiers for the UTXOs to be spent + const nullifier1 = newNullifier(utxo1, Alice); + const nullifier2 = newNullifier(utxo2, Alice); + + // generate inclusion proofs for the UTXOs to be spent + let root = await smtAlice.root(); + const proof1 = await smtAlice.generateCircomVerifierProof(utxo1.hash, root); + const proof2 = await smtAlice.generateCircomVerifierProof(utxo2.hash, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + await expect(doTransfer(Alice, [utxo1, utxo2], [nullifier1, nullifier2], [_utxo1, _utxo2], root.bigInt(), merkleProofs, [Bob, Alice])).rejectedWith("UTXOAlreadySpent") + }).timeout(600000); + + it("transfer with existing UTXOs in the output should fail (mass conservation protection)", async function () { + // give Bob another UTXO to be able to spend + const _utxo1 = newUTXO(15, Bob); + await doMint(zeto, deployer, [_utxo1]); + await smtBob.add(_utxo1.hash, _utxo1.hash); + + const nullifier1 = newNullifier(utxo7, Bob); + const nullifier2 = newNullifier(_utxo1, Bob); + let root = await smtBob.root(); + const proof1 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); + const proof2 = await smtBob.generateCircomVerifierProof(_utxo1.hash, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + await expect(doTransfer(Bob, [utxo7, _utxo1], [nullifier1, nullifier2], [utxo1, utxo2], root.bigInt(), merkleProofs, [Alice, Alice])).rejectedWith("UTXOAlreadyOwned") + }).timeout(600000); + + it("spend by using the same UTXO as both inputs should fail", async function () { + const _utxo1 = newUTXO(20, Alice); + const _utxo2 = newUTXO(10, Bob); + const nullifier1 = newNullifier(utxo7, Bob); + const nullifier2 = newNullifier(utxo7, Bob); + // generate inclusion proofs for the UTXOs to be spent + let root = await smtBob.root(); + const proof1 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); + const proof2 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + await expect(doTransfer(Bob, [utxo7, utxo7], [nullifier1, nullifier2], [_utxo1, _utxo2], root.bigInt(), merkleProofs, [Alice, Bob])).rejectedWith(`UTXODuplicate`); + }).timeout(600000); + + it("transfer non-existing UTXOs should fail", async function () { + const nonExisting1 = newUTXO(25, Alice); + const nonExisting2 = newUTXO(20, Alice, nonExisting1.salt); + + // add to our local SMT (but they don't exist on the chain) + await smtAlice.add(nonExisting1.hash, nonExisting1.hash); + await smtAlice.add(nonExisting2.hash, nonExisting2.hash); + + // generate the nullifiers for the UTXOs to be spent + const nullifier1 = newNullifier(nonExisting1, Alice); + const nullifier2 = newNullifier(nonExisting2, Alice); + + // generate inclusion proofs for the UTXOs to be spent + let root = await smtAlice.root(); + const proof1 = await smtAlice.generateCircomVerifierProof(nonExisting1.hash, root); + const proof2 = await smtAlice.generateCircomVerifierProof(nonExisting2.hash, root); + const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; + + // propose the output UTXOs + const _utxo1 = newUTXO(30, Charlie); + utxo7 = newUTXO(15, Bob); + + await expect(doTransfer(Alice, [nonExisting1, nonExisting2], [nullifier1, nullifier2], [utxo7, _utxo1], root.bigInt(), merkleProofs, [Bob, Charlie])).rejectedWith("UTXORootNotFound"); + }).timeout(600000); }); - it("transfer spent UTXOs should fail (double spend protection)", async function () { - // create outputs - const _utxo1 = newUTXO(25, Bob); - const _utxo2 = newUTXO(5, Alice); - - // generate the nullifiers for the UTXOs to be spent - const nullifier1 = newNullifier(utxo1, Alice); - const nullifier2 = newNullifier(utxo2, Alice); - - // generate inclusion proofs for the UTXOs to be spent - let root = await smtAlice.root(); - const proof1 = await smtAlice.generateCircomVerifierProof(utxo1.hash, root); - const proof2 = await smtAlice.generateCircomVerifierProof(utxo2.hash, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; - - await expect(doTransfer(Alice, [utxo1, utxo2], [nullifier1, nullifier2], [_utxo1, _utxo2], root.bigInt(), merkleProofs, [Bob, Alice])).rejectedWith("UTXOAlreadySpent") - }).timeout(600000); - - it("transfer with existing UTXOs in the output should fail (mass conservation protection)", async function () { - // give Bob another UTXO to be able to spend - const _utxo1 = newUTXO(15, Bob); - await doMint(zeto, deployer, [_utxo1]); - await smtBob.add(_utxo1.hash, _utxo1.hash); - - const nullifier1 = newNullifier(utxo7, Bob); - const nullifier2 = newNullifier(_utxo1, Bob); - let root = await smtBob.root(); - const proof1 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); - const proof2 = await smtBob.generateCircomVerifierProof(_utxo1.hash, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; - - await expect(doTransfer(Bob, [utxo7, _utxo1], [nullifier1, nullifier2], [utxo1, utxo2], root.bigInt(), merkleProofs, [Alice, Alice])).rejectedWith("UTXOAlreadyOwned") - }).timeout(600000); - - it("spend by using the same UTXO as both inputs should fail", async function () { - const _utxo1 = newUTXO(20, Alice); - const _utxo2 = newUTXO(10, Bob); - const nullifier1 = newNullifier(utxo7, Bob); - const nullifier2 = newNullifier(utxo7, Bob); - // generate inclusion proofs for the UTXOs to be spent - let root = await smtBob.root(); - const proof1 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); - const proof2 = await smtBob.generateCircomVerifierProof(utxo7.hash, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; - - await expect(doTransfer(Bob, [utxo7, utxo7], [nullifier1, nullifier2], [_utxo1, _utxo2], root.bigInt(), merkleProofs, [Alice, Bob])).rejectedWith(`UTXODuplicate`); - }).timeout(600000); - - it("transfer non-existing UTXOs should fail", async function () { - const nonExisting1 = newUTXO(25, Alice); - const nonExisting2 = newUTXO(20, Alice, nonExisting1.salt); - - // add to our local SMT (but they don't exist on the chain) - await smtAlice.add(nonExisting1.hash, nonExisting1.hash); - await smtAlice.add(nonExisting2.hash, nonExisting2.hash); - - // generate the nullifiers for the UTXOs to be spent - const nullifier1 = newNullifier(nonExisting1, Alice); - const nullifier2 = newNullifier(nonExisting2, Alice); - - // generate inclusion proofs for the UTXOs to be spent - let root = await smtAlice.root(); - const proof1 = await smtAlice.generateCircomVerifierProof(nonExisting1.hash, root); - const proof2 = await smtAlice.generateCircomVerifierProof(nonExisting2.hash, root); - const merkleProofs = [proof1.siblings.map((s) => s.bigInt()), proof2.siblings.map((s) => s.bigInt())]; - - // propose the output UTXOs - const _utxo1 = newUTXO(30, Charlie); - utxo7 = newUTXO(15, Bob); - - await expect(doTransfer(Alice, [nonExisting1, nonExisting2], [nullifier1, nullifier2], [utxo7, _utxo1], root.bigInt(), merkleProofs, [Bob, Charlie])).rejectedWith("UTXORootNotFound"); - }).timeout(600000); - async function doTransfer(signer: User, inputs: UTXO[], _nullifiers: UTXO[], outputs: UTXO[], root: BigInt, merkleProofs: BigInt[][], owners: User[]) { let nullifiers: [BigNumberish, BigNumberish]; let outputCommitments: [BigNumberish, BigNumberish]; diff --git a/solidity/test/zeto_anon_nullifier_kyc.ts b/solidity/test/zeto_anon_nullifier_kyc.ts index d192087..b2e0e70 100644 --- a/solidity/test/zeto_anon_nullifier_kyc.ts +++ b/solidity/test/zeto_anon_nullifier_kyc.ts @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ethers } from 'hardhat'; +import { ethers, network } from 'hardhat'; import { ContractTransactionReceipt, Signer, BigNumberish } from 'ethers'; import { expect } from 'chai'; import { loadCircuit, Poseidon, encodeProof, kycHash } from "zeto-js"; @@ -47,6 +47,7 @@ describe("Zeto based fungible token with anonymity, KYC, using nullifiers withou let smtKyc: Merkletree; before(async function () { + this.timeout(600000); let [d, a, b, c, e] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); @@ -56,9 +57,6 @@ describe("Zeto based fungible token with anonymity, KYC, using nullifiers withou ({ deployer, zeto, erc20 } = await deployZeto('Zeto_AnonNullifierKyc')); - const tx1 = await zeto.connect(deployer).setERC20(erc20.target); - await tx1.wait(); - const tx2 = await zeto.connect(deployer).register(Alice.babyJubPublicKey); const result1 = await tx2.wait(); const tx3 = await zeto.connect(deployer).register(Bob.babyJubPublicKey); @@ -97,7 +95,7 @@ describe("Zeto based fungible token with anonymity, KYC, using nullifiers withou const tx = await erc20.connect(deployer).mint(Alice.ethAddress, 100); await tx.wait(); const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.equal(100); + expect(balance).to.be.gte(100); const tx1 = await erc20.connect(Alice.signer).approve(zeto.target, 100); await tx1.wait(); @@ -244,7 +242,7 @@ describe("Zeto based fungible token with anonymity, KYC, using nullifiers withou // Alice checks her ERC20 balance const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.equal(80); + expect(balance).to.be.gte(80); }); describe("unregistered user flows", function () { @@ -322,11 +320,17 @@ describe("Zeto based fungible token with anonymity, KYC, using nullifiers withou // unregistered user checks her ERC20 balance const balance = await erc20.balanceOf(unregistered.ethAddress); - expect(balance).to.equal(100); + expect(balance).to.be.gte(100); }); }); - describe("failure flows", function () { + describe.skip("failure cases", function () { + // the following failure cases rely on the hardhat network + // to return the details of the errors. This is not possible + // on non-hardhat networks + if (network.name !== 'hardhat') { + return; + } it("Alice attempting to withdraw spent UTXOs should fail", async function () { // Alice generates the nullifiers for the UTXOs to be spent diff --git a/solidity/test/zeto_nf_anon.ts b/solidity/test/zeto_nf_anon.ts index b1994ec..ef393b6 100644 --- a/solidity/test/zeto_nf_anon.ts +++ b/solidity/test/zeto_nf_anon.ts @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ethers } from 'hardhat'; +import { ethers, network } from 'hardhat'; import { Signer, BigNumberish, AddressLike } from 'ethers'; import { expect } from 'chai'; import { loadCircuit, tokenUriHash, encodeProof } from "zeto-js"; @@ -72,25 +72,34 @@ describe("Zeto based non-fungible token with anonymity without encryption or nul await doTransfer(Bob, utxo2, utxo3, Charlie); }); - it("mint existing unspent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo3])).rejectedWith("UTXOAlreadyOwned"); - }); - - it("mint existing spent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadySpent"); - }); - - it("transfer non-existing UTXOs should fail", async function () { - const nonExisting1 = newAssetUTXO(1002, 'http://ipfs.io/file-hash-2', Alice); - const nonExisting2 = newAssetUTXO(1002, 'http://ipfs.io/file-hash-2', Bob); - - await expect(doTransfer(Alice, nonExisting1, nonExisting2, Bob)).rejectedWith("UTXONotMinted"); - }); - - it("transfer spent UTXOs should fail (double spend protection)", async function () { - // create outputs - const _utxo4 = newAssetUTXO(utxo1.tokenId!, utxo1.uri!, Bob); - await expect(doTransfer(Alice, utxo1, _utxo4, Bob)).rejectedWith("UTXOAlreadySpent") + describe("failure cases", function () { + // the following failure cases rely on the hardhat network + // to return the details of the errors. This is not possible + // on non-hardhat networks + if (network.name !== 'hardhat') { + return; + } + + it("mint existing unspent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo3])).rejectedWith("UTXOAlreadyOwned"); + }); + + it("mint existing spent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadySpent"); + }); + + it("transfer non-existing UTXOs should fail", async function () { + const nonExisting1 = newAssetUTXO(1002, 'http://ipfs.io/file-hash-2', Alice); + const nonExisting2 = newAssetUTXO(1002, 'http://ipfs.io/file-hash-2', Bob); + + await expect(doTransfer(Alice, nonExisting1, nonExisting2, Bob)).rejectedWith("UTXONotMinted"); + }); + + it("transfer spent UTXOs should fail (double spend protection)", async function () { + // create outputs + const _utxo4 = newAssetUTXO(utxo1.tokenId!, utxo1.uri!, Bob); + await expect(doTransfer(Alice, utxo1, _utxo4, Bob)).rejectedWith("UTXOAlreadySpent") + }); }); async function doTransfer(signer: User, input: UTXO, output: UTXO, to: User) { diff --git a/solidity/test/zeto_nf_anon_nullifier.ts b/solidity/test/zeto_nf_anon_nullifier.ts index 9829a31..03940e2 100644 --- a/solidity/test/zeto_nf_anon_nullifier.ts +++ b/solidity/test/zeto_nf_anon_nullifier.ts @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ethers } from 'hardhat'; +import { ethers, network } from 'hardhat'; import { ContractTransactionReceipt, Signer, BigNumberish } from 'ethers'; import { expect } from 'chai'; import { loadCircuit, Poseidon, encodeProof, tokenUriHash } from "zeto-js"; @@ -143,48 +143,57 @@ describe("Zeto based non-fungible token with anonymity using nullifiers without await smtAlice.add(events[0].outputs[0], events[0].outputs[0]); }).timeout(600000); - it("mint existing unspent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo3])).rejectedWith("UTXOAlreadyOwned"); - }); + describe("failure cases", function () { + // the following failure cases rely on the hardhat network + // to return the details of the errors. This is not possible + // on non-hardhat networks + if (network.name !== 'hardhat') { + return; + } - it("mint existing spent UTXOs should fail", async function () { - await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadyOwned"); - }); + it("mint existing unspent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo3])).rejectedWith("UTXOAlreadyOwned"); + }); - it("transfer spent UTXOs should fail (double spend protection)", async function () { - // Alice create outputs in an attempt to send to Charlie an already spent asset - const _utxo1 = newAssetUTXO(utxo1.tokenId!, utxo1.uri!, Charlie); + it("mint existing spent UTXOs should fail", async function () { + await expect(doMint(zeto, deployer, [utxo1])).rejectedWith("UTXOAlreadyOwned"); + }); - // generate the nullifiers for the UTXOs to be spent - const nullifier1 = newAssetNullifier(utxo1, Alice); + it("transfer spent UTXOs should fail (double spend protection)", async function () { + // Alice create outputs in an attempt to send to Charlie an already spent asset + const _utxo1 = newAssetUTXO(utxo1.tokenId!, utxo1.uri!, Charlie); - // generate inclusion proofs for the UTXOs to be spent - let root = await smtAlice.root(); - const proof1 = await smtAlice.generateCircomVerifierProof(utxo1.hash, root); - const merkleProof = proof1.siblings.map((s) => s.bigInt()); + // generate the nullifiers for the UTXOs to be spent + const nullifier1 = newAssetNullifier(utxo1, Alice); - await expect(doTransfer(Alice, utxo1, nullifier1, _utxo1, root.bigInt(), merkleProof, Charlie)).rejectedWith("UTXOAlreadySpent") - }).timeout(600000); + // generate inclusion proofs for the UTXOs to be spent + let root = await smtAlice.root(); + const proof1 = await smtAlice.generateCircomVerifierProof(utxo1.hash, root); + const merkleProof = proof1.siblings.map((s) => s.bigInt()); - it("transfer non-existing UTXOs should fail", async function () { - const nonExisting1 = newAssetUTXO(1002, 'http://ipfs.io/file-hash-2', Alice); + await expect(doTransfer(Alice, utxo1, nullifier1, _utxo1, root.bigInt(), merkleProof, Charlie)).rejectedWith("UTXOAlreadySpent") + }).timeout(600000); - // add to our local SMT (but they don't exist on the chain) - await smtAlice.add(nonExisting1.hash, nonExisting1.hash); + it("transfer non-existing UTXOs should fail", async function () { + const nonExisting1 = newAssetUTXO(1002, 'http://ipfs.io/file-hash-2', Alice); - // generate the nullifiers for the UTXOs to be spent - const nullifier1 = newAssetNullifier(nonExisting1, Alice); + // add to our local SMT (but they don't exist on the chain) + await smtAlice.add(nonExisting1.hash, nonExisting1.hash); - // generate inclusion proofs for the UTXOs to be spent - let root = await smtAlice.root(); - const proof1 = await smtAlice.generateCircomVerifierProof(nonExisting1.hash, root); - const merkleProof = proof1.siblings.map((s) => s.bigInt()); + // generate the nullifiers for the UTXOs to be spent + const nullifier1 = newAssetNullifier(nonExisting1, Alice); - // propose the output UTXOs - const _utxo1 = newAssetUTXO(nonExisting1.tokenId!, nonExisting1.uri!, Charlie); + // generate inclusion proofs for the UTXOs to be spent + let root = await smtAlice.root(); + const proof1 = await smtAlice.generateCircomVerifierProof(nonExisting1.hash, root); + const merkleProof = proof1.siblings.map((s) => s.bigInt()); - await expect(doTransfer(Alice, nonExisting1, nullifier1, _utxo1, root.bigInt(), merkleProof, Charlie)).rejectedWith("UTXORootNotFound"); - }).timeout(600000); + // propose the output UTXOs + const _utxo1 = newAssetUTXO(nonExisting1.tokenId!, nonExisting1.uri!, Charlie); + + await expect(doTransfer(Alice, nonExisting1, nullifier1, _utxo1, root.bigInt(), merkleProof, Charlie)).rejectedWith("UTXORootNotFound"); + }).timeout(600000); + }); async function doTransfer(signer: User, input: UTXO, _nullifier: UTXO, output: UTXO, root: BigInt, merkleProof: BigInt[], owner: User) { let nullifier: BigNumberish; diff --git a/solidity/test/zkDvP.ts b/solidity/test/zkDvP.ts index 897c102..1016cee 100644 --- a/solidity/test/zkDvP.ts +++ b/solidity/test/zkDvP.ts @@ -14,12 +14,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ethers, ignition } from 'hardhat'; -import { Signer, BigNumberish, encodeBytes32String, ZeroHash } from 'ethers'; +import { ethers, ignition, network } from 'hardhat'; +import { Signer, encodeBytes32String, ZeroHash } from 'ethers'; import { expect } from 'chai'; import { loadCircuit, getProofHash } from "zeto-js"; -import zetoAnonModule from '../ignition/modules/zeto_anon'; -import zetoNFAnonModule from '../ignition/modules/zeto_nf_anon'; import zkDvPModule from '../ignition/modules/zkDvP'; import zetoAnonTests from './zeto_anon'; import zetoNFAnonTests from './zeto_nf_anon'; @@ -49,6 +47,7 @@ describe("DvP flows between fungible and non-fungible tokens based on Zeto with let deployer: Signer; before(async function () { + this.timeout(600000); let [d, a, b, c] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); @@ -85,29 +84,6 @@ describe("DvP flows between fungible and non-fungible tokens based on Zeto with expect(event.args.outputs[1].toString()).to.equal(asset2.hash.toString()); }); - it("Initiating a DvP transaction without payment input or asset input should fail", async function () { - await expect(zkDvP.connect(Alice.signer).initiateTrade([0, 0], [0, 0], ZeroHash, 0, 0, ZeroHash)).rejectedWith("Payment inputs and asset input cannot be zero at the same time"); - }); - - it("Initiating a DvP transaction with payment input but no payment output should fail", async function () { - const utxo1 = newUTXO(10, Alice); - const utxo2 = newUTXO(20, Alice); - await expect(zkDvP.connect(Alice.signer).initiateTrade([utxo1.hash, utxo2.hash], [0, 0], ZeroHash, 0, 0, ZeroHash)).rejectedWith("Payment outputs cannot be zero when payment inputs are non-zero"); - }); - - it("Initiating a DvP transaction with payment inputs and asset inputs should fail", async function () { - const utxo1 = newUTXO(10, Alice); - const utxo2 = newUTXO(20, Alice); - const utxo3 = newUTXO(25, Bob); - const utxo4 = newUTXO(5, Alice); - await expect(zkDvP.connect(Alice.signer).initiateTrade([utxo1.hash, utxo2.hash], [utxo3.hash, utxo4.hash], ZeroHash, utxo3.hash, 0, ZeroHash)).rejectedWith("Payment inputs and asset input cannot be provided at the same time"); - }); - - it("Initiating a DvP transaction with asset input but no asset output should fail", async function () { - const utxo1 = newUTXO(10, Alice); - await expect(zkDvP.connect(Alice.signer).initiateTrade([0, 0], [0, 0], ZeroHash, utxo1.hash, 0, ZeroHash)).rejectedWith("Asset output cannot be zero when asset input is non-zero"); - }); - it("Initiating a successful DvP transaction with payment inputs", async function () { const utxo1 = newUTXO(10, Alice); const utxo2 = newUTXO(20, Alice); @@ -122,45 +98,6 @@ describe("DvP flows between fungible and non-fungible tokens based on Zeto with await expect(zkDvP.connect(Alice.signer).initiateTrade([0, 0], [0, 0], ZeroHash, utxo1.hash, utxo2.hash, ZeroHash)).fulfilled; }); - it("Accepting a trade using an invalid trade ID should fail", async function () { - await expect(zkDvP.connect(Bob.signer).acceptTrade(1000, [0, 0], [0, 0], ZeroHash, 0, 0, ZeroHash)).rejectedWith("Trade does not exist"); - }); - - it("Failing cases for accepting a trade with payment terms", async function () { - const mockProofHash = encodeBytes32String("moch proof hash"); - const utxo1 = newUTXO(20, Alice); - const utxo2 = newUTXO(20, Bob); - const tx1 = await zkDvP.connect(Alice.signer).initiateTrade([utxo1.hash, 0], [utxo2.hash, 0], mockProofHash, 0, 0, mockProofHash); - const result = await tx1.wait(); - const event = zkDvP.interface.parseLog(result.logs[0]); - const tradeId = event.args.tradeId; - - const utxo3 = newAssetUTXO(25, "http://ipfs.io/file-hash-1", Bob); - await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [utxo1.hash, 0], [0, 0], mockProofHash, 0, 0, mockProofHash)).rejectedWith("Payment inputs already provided by the trade initiator"); - await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [0, 0], [utxo2.hash, 0], mockProofHash, 0, 0, mockProofHash)).rejectedWith("Payment outputs already provided by the trade initiator"); - await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [0, 0], [0, 0], mockProofHash, 0, 0, mockProofHash)).rejectedWith("Asset input must be provided to accept the trade"); - await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [0, 0], [0, 0], mockProofHash, utxo3.hash, 0, mockProofHash)).rejectedWith("Asset output must be provided to accept the trade"); - }); - - it("Failing cases for accepting a trade with asset terms", async function () { - const mockProofHash = encodeBytes32String("mock proof hash"); - const utxo1 = newAssetUTXO(100, "http://ipfs.io/file-hash-1", Alice); - const utxo2 = newAssetUTXO(202, "http://ipfs.io/file-hash-2", Bob); - const tx1 = await zkDvP.connect(Alice.signer).initiateTrade([0, 0], [0, 0], ZeroHash, utxo1.hash, utxo2.hash, mockProofHash); - const result = await tx1.wait(); - const event = zkDvP.interface.parseLog(result.logs[0]); - const tradeId = event.args.tradeId; - - const utxo3 = newUTXO(10, Bob); - const utxo4 = newUTXO(20, Bob); - const utxo5 = newUTXO(25, Alice); - const utxo6 = newUTXO(5, Bob); - await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [utxo3.hash, utxo4.hash], [utxo5.hash, utxo6.hash], mockProofHash, utxo1.hash, utxo2.hash, mockProofHash)).rejectedWith("Asset inputs already provided by the trade initiator"); - await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [utxo3.hash, utxo4.hash], [utxo5.hash, utxo6.hash], mockProofHash, 0, utxo2.hash, mockProofHash)).rejectedWith("Asset outputs already provided by the trade initiator"); - await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [0, 0], [0, 0], mockProofHash, 0, 0, mockProofHash)).rejectedWith("Payment inputs must be provided to accept the trade"); - await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [utxo3.hash, utxo4.hash], [0, 0], mockProofHash, 0, 0, mockProofHash)).rejectedWith("Payment outputs must be provided to accept the trade"); - }); - it("Initiating a successful DvP transaction with payment inputs and accepting by specifying asset inputs", async function () { // the authority mints some payment tokens to Alice const _utxo1 = newUTXO(100, Alice); @@ -210,5 +147,75 @@ describe("DvP flows between fungible and non-fungible tokens based on Zeto with expect(events[0].tradeId).to.equal(tradeId); expect(events[0].trade.status).to.equal(2n); // enum for TradeStatus.Completed }); + describe("failure cases", function () { + // the following failure cases rely on the hardhat network + // to return the details of the errors. This is not possible + // on non-hardhat networks + if (network.name !== 'hardhat') { + return; + } + + it("Initiating a DvP transaction without payment input or asset input should fail", async function () { + await expect(zkDvP.connect(Alice.signer).initiateTrade([0, 0], [0, 0], ZeroHash, 0, 0, ZeroHash)).rejectedWith("Payment inputs and asset input cannot be zero at the same time"); + }); + + it("Initiating a DvP transaction with payment input but no payment output should fail", async function () { + const utxo1 = newUTXO(10, Alice); + const utxo2 = newUTXO(20, Alice); + await expect(zkDvP.connect(Alice.signer).initiateTrade([utxo1.hash, utxo2.hash], [0, 0], ZeroHash, 0, 0, ZeroHash)).rejectedWith("Payment outputs cannot be zero when payment inputs are non-zero"); + }); + + it("Initiating a DvP transaction with payment inputs and asset inputs should fail", async function () { + const utxo1 = newUTXO(10, Alice); + const utxo2 = newUTXO(20, Alice); + const utxo3 = newUTXO(25, Bob); + const utxo4 = newUTXO(5, Alice); + await expect(zkDvP.connect(Alice.signer).initiateTrade([utxo1.hash, utxo2.hash], [utxo3.hash, utxo4.hash], ZeroHash, utxo3.hash, 0, ZeroHash)).rejectedWith("Payment inputs and asset input cannot be provided at the same time"); + }); + + it("Initiating a DvP transaction with asset input but no asset output should fail", async function () { + const utxo1 = newUTXO(10, Alice); + await expect(zkDvP.connect(Alice.signer).initiateTrade([0, 0], [0, 0], ZeroHash, utxo1.hash, 0, ZeroHash)).rejectedWith("Asset output cannot be zero when asset input is non-zero"); + }); + + it("Accepting a trade using an invalid trade ID should fail", async function () { + await expect(zkDvP.connect(Bob.signer).acceptTrade(1000, [0, 0], [0, 0], ZeroHash, 0, 0, ZeroHash)).rejectedWith("Trade does not exist"); + }); + + it("Failing cases for accepting a trade with payment terms", async function () { + const mockProofHash = encodeBytes32String("moch proof hash"); + const utxo1 = newUTXO(20, Alice); + const utxo2 = newUTXO(20, Bob); + const tx1 = await zkDvP.connect(Alice.signer).initiateTrade([utxo1.hash, 0], [utxo2.hash, 0], mockProofHash, 0, 0, mockProofHash); + const result = await tx1.wait(); + const event = zkDvP.interface.parseLog(result.logs[0]); + const tradeId = event.args.tradeId; + + const utxo3 = newAssetUTXO(25, "http://ipfs.io/file-hash-1", Bob); + await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [utxo1.hash, 0], [0, 0], mockProofHash, 0, 0, mockProofHash)).rejectedWith("Payment inputs already provided by the trade initiator"); + await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [0, 0], [utxo2.hash, 0], mockProofHash, 0, 0, mockProofHash)).rejectedWith("Payment outputs already provided by the trade initiator"); + await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [0, 0], [0, 0], mockProofHash, 0, 0, mockProofHash)).rejectedWith("Asset input must be provided to accept the trade"); + await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [0, 0], [0, 0], mockProofHash, utxo3.hash, 0, mockProofHash)).rejectedWith("Asset output must be provided to accept the trade"); + }); + + it("Failing cases for accepting a trade with asset terms", async function () { + const mockProofHash = encodeBytes32String("mock proof hash"); + const utxo1 = newAssetUTXO(100, "http://ipfs.io/file-hash-1", Alice); + const utxo2 = newAssetUTXO(202, "http://ipfs.io/file-hash-2", Bob); + const tx1 = await zkDvP.connect(Alice.signer).initiateTrade([0, 0], [0, 0], ZeroHash, utxo1.hash, utxo2.hash, mockProofHash); + const result = await tx1.wait(); + const event = zkDvP.interface.parseLog(result.logs[0]); + const tradeId = event.args.tradeId; + + const utxo3 = newUTXO(10, Bob); + const utxo4 = newUTXO(20, Bob); + const utxo5 = newUTXO(25, Alice); + const utxo6 = newUTXO(5, Bob); + await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [utxo3.hash, utxo4.hash], [utxo5.hash, utxo6.hash], mockProofHash, utxo1.hash, utxo2.hash, mockProofHash)).rejectedWith("Asset inputs already provided by the trade initiator"); + await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [utxo3.hash, utxo4.hash], [utxo5.hash, utxo6.hash], mockProofHash, 0, utxo2.hash, mockProofHash)).rejectedWith("Asset outputs already provided by the trade initiator"); + await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [0, 0], [0, 0], mockProofHash, 0, 0, mockProofHash)).rejectedWith("Payment inputs must be provided to accept the trade"); + await expect(zkDvP.connect(Bob.signer).acceptTrade(tradeId, [utxo3.hash, utxo4.hash], [0, 0], mockProofHash, 0, 0, mockProofHash)).rejectedWith("Payment outputs must be provided to accept the trade"); + }); + }); }).timeout(600000); From 9158c94af350adb40aea9f9a87d7cb0d1427c772 Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Fri, 23 Aug 2024 17:26:54 -0400 Subject: [PATCH 2/8] Minor updates to remove debugging logs Signed-off-by: Jim Zhang --- .../zeto_anon_enc_nullifier_non_repudiation.ts | 2 +- solidity/test/zeto_anon_nullifier_kyc.ts | 2 +- .../anon_enc_nullifier_non_repudiation.js | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts b/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts index 7d0e1f8..d3f27f1 100644 --- a/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts +++ b/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts @@ -236,7 +236,7 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti expect(balance).to.be.gte(80); }); - describe.skip("failure cases", function () { + describe("failure cases", function () { // the following failure cases rely on the hardhat network // to return the details of the errors. This is not possible // on non-hardhat networks diff --git a/solidity/test/zeto_anon_nullifier_kyc.ts b/solidity/test/zeto_anon_nullifier_kyc.ts index b2e0e70..90ac51e 100644 --- a/solidity/test/zeto_anon_nullifier_kyc.ts +++ b/solidity/test/zeto_anon_nullifier_kyc.ts @@ -324,7 +324,7 @@ describe("Zeto based fungible token with anonymity, KYC, using nullifiers withou }); }); - describe.skip("failure cases", function () { + describe("failure cases", function () { // the following failure cases rely on the hardhat network // to return the details of the errors. This is not possible // on non-hardhat networks diff --git a/zkp/js/integration-test/anon_enc_nullifier_non_repudiation.js b/zkp/js/integration-test/anon_enc_nullifier_non_repudiation.js index 8e7b5ac..4fdb71c 100644 --- a/zkp/js/integration-test/anon_enc_nullifier_non_repudiation.js +++ b/zkp/js/integration-test/anon_enc_nullifier_non_repudiation.js @@ -119,13 +119,13 @@ describe('main circuit tests for Zeto fungible tokens with encryption fro non-re console.log('Proving time: ', (Date.now() - startTime) / 1000, 's'); const success = await groth16.verify(verificationKey, publicSignals, proof); - console.log('nullifiers', nullifiers); - console.log('inputCommitments', inputCommitments); - console.log('outputCommitments', outputCommitments); - console.log('root', proof1.root.bigInt()); - console.log('encryptionNonce', encryptionNonce); - console.log('authorityPublicKey', Regulator.pubKey); - console.log('publicSignals', publicSignals); + // console.log('nullifiers', nullifiers); + // console.log('inputCommitments', inputCommitments); + // console.log('outputCommitments', outputCommitments); + // console.log('root', proof1.root.bigInt()); + // console.log('encryptionNonce', encryptionNonce); + // console.log('authorityPublicKey', Regulator.pubKey); + // console.log('publicSignals', publicSignals); expect(success, true); }).timeout(600000); }); From 8d0c25ff093d508e2dd076f5599dc5afb6c49374 Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Sun, 25 Aug 2024 22:43:12 -0400 Subject: [PATCH 3/8] Add setERC20() calls in cloneable contract deploy scripts Signed-off-by: Jim Zhang --- solidity/scripts/deploy_cloneable.ts | 15 +++------------ solidity/test/lib/deploy.ts | 5 +++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/solidity/scripts/deploy_cloneable.ts b/solidity/scripts/deploy_cloneable.ts index efa4756..54af872 100644 --- a/solidity/scripts/deploy_cloneable.ts +++ b/solidity/scripts/deploy_cloneable.ts @@ -8,14 +8,8 @@ export async function deployFungible(tokenName: string) { const { deployer, args, libraries } = await verifiersDeployer.deployDependencies(); let zetoFactory; - const opts = { - kind: 'uups', - initializer: 'initialize', - unsafeAllow: ['delegatecall'] - }; if (libraries) { zetoFactory = await getLinkedContractFactory(tokenName, libraries); - opts.unsafeAllow.push('external-library-linking'); } else { zetoFactory = await ethers.getContractFactory(tokenName) } @@ -24,6 +18,9 @@ export async function deployFungible(tokenName: string) { await zetoImpl.waitForDeployment(); await zetoImpl.connect(deployer).initialize(...args); + const tx3 = await zetoImpl.connect(deployer).setERC20(erc20.target); + await tx3.wait(); + console.log(`ERC20 deployed: ${erc20.target}`); console.log(`ZetoToken deployed: ${zetoImpl.target}`); @@ -36,14 +33,8 @@ export async function deployNonFungible(tokenName: string) { const { args, libraries } = await verifiersDeployer.deployDependencies(); let zetoFactory; - const opts = { - kind: 'uups', - initializer: 'initialize', - unsafeAllow: ['delegatecall'] - }; if (libraries) { zetoFactory = await getLinkedContractFactory(tokenName, libraries); - opts.unsafeAllow.push('external-library-linking'); } else { zetoFactory = await ethers.getContractFactory(tokenName) } diff --git a/solidity/test/lib/deploy.ts b/solidity/test/lib/deploy.ts index c65713a..d90b771 100644 --- a/solidity/test/lib/deploy.ts +++ b/solidity/test/lib/deploy.ts @@ -37,6 +37,8 @@ export async function deployZeto(tokenName: string) { const result = await deployFunc(tokenName); ({ deployer, zetoImpl, erc20, args } = result as any); + // we want to test the effectiveness of the factory contract + // to create clones of the Zeto implementation contract const Factory = await ethers.getContractFactory("ZetoTokenFactory"); const factory = await Factory.deploy(); await factory.waitForDeployment(); @@ -58,6 +60,9 @@ export async function deployZeto(tokenName: string) { } } zeto = await ethers.getContractAt(tokenName, zetoAddress); + + const tx3 = await zeto.connect(deployer).setERC20(erc20.target); + await tx3.wait(); } return { deployer, zeto, erc20 }; From b3b8e8084835f54b3b6ffbd655417c87c414132f Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Sun, 25 Aug 2024 23:06:42 -0400 Subject: [PATCH 4/8] Only call setERC20() for fungible tokens Signed-off-by: Jim Zhang --- solidity/test/lib/deploy.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/solidity/test/lib/deploy.ts b/solidity/test/lib/deploy.ts index d90b771..aa751b9 100644 --- a/solidity/test/lib/deploy.ts +++ b/solidity/test/lib/deploy.ts @@ -61,8 +61,11 @@ export async function deployZeto(tokenName: string) { } zeto = await ethers.getContractAt(tokenName, zetoAddress); - const tx3 = await zeto.connect(deployer).setERC20(erc20.target); - await tx3.wait(); + // set the ERC20 token for the fungible Zeto token + if (isFungible) { + const tx3 = await zeto.connect(deployer).setERC20(erc20.target); + await tx3.wait(); + } } return { deployer, zeto, erc20 }; From fcf39b6c8a837146c03f5403fa6ce92dfa730d31 Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Mon, 26 Aug 2024 10:40:12 -0400 Subject: [PATCH 5/8] Add more unit test for go-sdk Signed-off-by: Jim Zhang --- .../internal/sparse-merkle-tree/smt/errors.go | 4 +- .../sparse-merkle-tree/smt/merkletree.go | 4 +- .../sparse-merkle-tree/smt/merkletree_test.go | 67 +++++++++++++++++++ 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 go-sdk/internal/sparse-merkle-tree/smt/merkletree_test.go diff --git a/go-sdk/internal/sparse-merkle-tree/smt/errors.go b/go-sdk/internal/sparse-merkle-tree/smt/errors.go index 5a799d0..43cce56 100644 --- a/go-sdk/internal/sparse-merkle-tree/smt/errors.go +++ b/go-sdk/internal/sparse-merkle-tree/smt/errors.go @@ -19,8 +19,8 @@ package smt import "errors" var ( - // ErrMaxLevelsExceeded is used when a level is larger than the max - ErrMaxLevelsExceeded = errors.New("tree height is larger than max allowed (256)") + // ErrMaxLevelsNotInRange is used when a level is larger than the max + ErrMaxLevelsNotInRange = errors.New("tree height must be larger than zero and less than max allowed (256)") // ErrNodeIndexAlreadyExists is used when a node index already exists. ErrNodeIndexAlreadyExists = errors.New("key already exists") // ErrKeyNotFound is used when a key is not found in the MerkleTree. diff --git a/go-sdk/internal/sparse-merkle-tree/smt/merkletree.go b/go-sdk/internal/sparse-merkle-tree/smt/merkletree.go index 4b6a5f9..e1f0a8b 100644 --- a/go-sdk/internal/sparse-merkle-tree/smt/merkletree.go +++ b/go-sdk/internal/sparse-merkle-tree/smt/merkletree.go @@ -38,8 +38,8 @@ type sparseMerkleTree struct { } func NewMerkleTree(db core.Storage, maxLevels int) (core.SparseMerkleTree, error) { - if maxLevels > MAX_TREE_HEIGHT { - return nil, ErrMaxLevelsExceeded + if maxLevels <= 0 || maxLevels > MAX_TREE_HEIGHT { + return nil, ErrMaxLevelsNotInRange } mt := sparseMerkleTree{db: db, maxLevels: maxLevels} diff --git a/go-sdk/internal/sparse-merkle-tree/smt/merkletree_test.go b/go-sdk/internal/sparse-merkle-tree/smt/merkletree_test.go new file mode 100644 index 0000000..5df24f3 --- /dev/null +++ b/go-sdk/internal/sparse-merkle-tree/smt/merkletree_test.go @@ -0,0 +1,67 @@ +// Copyright © 2024 Kaleido, Inc. +// +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package smt + +import ( + "fmt" + "testing" + + "github.com/hyperledger-labs/zeto/go-sdk/internal/sparse-merkle-tree/storage" + "github.com/hyperledger-labs/zeto/go-sdk/pkg/sparse-merkle-tree/core" + "github.com/stretchr/testify/assert" +) + +type mockStorage struct { + GetRootNodeIndex_customError bool +} + +func (ms *mockStorage) GetRootNodeIndex() (core.NodeIndex, error) { + if ms.GetRootNodeIndex_customError { + return nil, fmt.Errorf("nasty error in get root") + } + return nil, storage.ErrNotFound +} +func (ms *mockStorage) UpsertRootNodeIndex(core.NodeIndex) error { + return fmt.Errorf("nasty error in upsert root") +} +func (ms *mockStorage) GetNode(core.NodeIndex) (core.Node, error) { + return nil, nil +} +func (ms *mockStorage) InsertNode(core.Node) error { + return nil +} +func (ms *mockStorage) Close() {} + +func TestNewMerkleTreeFailures(t *testing.T) { + db := &mockStorage{} + mt, err := NewMerkleTree(db, 0) + assert.EqualError(t, err, ErrMaxLevelsNotInRange.Error()) + assert.Nil(t, mt) + + mt, err = NewMerkleTree(nil, 257) + assert.Error(t, err, ErrMaxLevelsNotInRange.Error()) + assert.Nil(t, mt) + + mt, err = NewMerkleTree(db, 64) + assert.EqualError(t, err, "nasty error in upsert root") + assert.Nil(t, mt) + + db.GetRootNodeIndex_customError = true + mt, err = NewMerkleTree(db, 64) + assert.EqualError(t, err, "nasty error in get root") + assert.Nil(t, mt) +} From f2bf6189e4b4ba61737a85a950873c7ebf41909e Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Tue, 27 Aug 2024 10:04:29 -0400 Subject: [PATCH 6/8] Address review comments Signed-off-by: Jim Zhang --- solidity/.openzeppelin/unknown-1337.json | 345 +++ solidity/.openzeppelin/unknown-59141.json | 685 +++++ solidity/.openzeppelin/unknown-80002.json | 2245 +++++++++++++++++ solidity/test/zeto_anon.ts | 5 +- solidity/test/zeto_anon_enc.ts | 5 +- solidity/test/zeto_anon_enc_nullifier.ts | 5 +- ...zeto_anon_enc_nullifier_non_repudiation.ts | 5 +- solidity/test/zeto_anon_nullifier.ts | 5 +- solidity/test/zeto_anon_nullifier_kyc.ts | 5 +- solidity/test/zeto_nf_anon.ts | 4 + solidity/test/zeto_nf_anon_nullifier.ts | 4 + solidity/test/zkDvP.ts | 5 +- 12 files changed, 3311 insertions(+), 7 deletions(-) create mode 100644 solidity/.openzeppelin/unknown-1337.json create mode 100644 solidity/.openzeppelin/unknown-59141.json create mode 100644 solidity/.openzeppelin/unknown-80002.json diff --git a/solidity/.openzeppelin/unknown-1337.json b/solidity/.openzeppelin/unknown-1337.json new file mode 100644 index 0000000..2719633 --- /dev/null +++ b/solidity/.openzeppelin/unknown-1337.json @@ -0,0 +1,345 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0xf8AD579928Ca0E41FddB95Ce16FFFf6E5C8C742D", + "txHash": "0x882bd16240765b2b2dde017b893f7e790edaa863ace12c0f602429e6a4ede639", + "kind": "uups" + }, + { + "address": "0xA52F9928409Cb15F2e1a220CF86D56D7dcbCE917", + "txHash": "0x0034c2278e6d952815dd5fa7abc8991a3b7a963a19ee1f9a6dd27b43d6d3a780", + "kind": "uups" + }, + { + "address": "0xcD420d9fE00C78820EB1EcE7241a9608519589c1", + "txHash": "0xc660bc1e81f02255834d68df4037a6c9fbbd85deaaebdf6ecdc58ead92a67a59", + "kind": "uups" + }, + { + "address": "0xe36a3d4b5B55c6F8FeA0Ffe95444772a0ed4091a", + "txHash": "0x1e14cf679484b6200e27498d65c4dd352a926c11451e8911b0d26aa888a48c6d", + "kind": "uups" + }, + { + "address": "0x55019bC141a29c0Fb77A35951625666bc375cC76", + "txHash": "0x272e428542cce5f7e1f66ff13478f3ce00149f10627cca3ee5d6ec7241efa0f3", + "kind": "uups" + }, + { + "address": "0x6165E50070494A547e7cc1e86739F3645Feb0453", + "txHash": "0x3d95cd6d932e3fcb2410a18bb9037a6a1cd05f070c855ece6a86f72ea211114b", + "kind": "uups" + } + ], + "impls": { + "d1f8a292f5a7ed6e35483f0f170b39434ed5090fa54bfaeaec7a5e097529e8e2": { + "address": "0xc5119e3e608fE6AE471567B9170671015228A31e", + "txHash": "0x011c26d9bcd6eb9f4371199841b744e3df64d404186699e25419d4e783b0bd85", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_utxos", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_enum(UTXOStatus)6682)", + "contract": "ZetoBase", + "src": "contracts/lib/zeto_base.sol:36" + }, + { + "label": "depositVerifier", + "offset": 0, + "slot": "2", + "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:31" + }, + { + "label": "erc20", + "offset": 0, + "slot": "3", + "type": "t_contract(IERC20)4041", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:33" + }, + { + "label": "withdrawVerifier", + "offset": 0, + "slot": "4", + "type": "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318", + "contract": "ZetoFungibleWithdraw", + "src": "contracts/lib/zeto_fungible_withdraw.sol:31" + }, + { + "label": "verifier", + "offset": 0, + "slot": "5", + "type": "t_contract(Groth16Verifier_Anon)5249", + "contract": "Zeto_Anon", + "src": "contracts/zeto_anon.sol:38" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_Anon)5249": { + "label": "contract Groth16Verifier_Anon", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckHashesValue)6203": { + "label": "contract Groth16Verifier_CheckHashesValue", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318": { + "label": "contract Groth16Verifier_CheckInputsOutputsValue", + "numberOfBytes": "20" + }, + "t_contract(IERC20)4041": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_enum(UTXOStatus)6682": { + "label": "enum ZetoBase.UTXOStatus", + "members": [ + "UNKNOWN", + "UNSPENT", + "SPENT" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_enum(UTXOStatus)6682)": { + "label": "mapping(uint256 => enum ZetoBase.UTXOStatus)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + }, + "ff52d8def6e74418ef76c250bb2cc04a90f26ad4106ab5c59f453ed30cf1e2a1": { + "address": "0xf1edb0d4CacC0F524851c28FAdA9547a967f7886", + "txHash": "0x70728bae15390b5359d6da865c790730b7b7b4cc5a9d40dc397707a3bdb38fd2", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_utxos", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_enum(UTXOStatus)6682)", + "contract": "ZetoBase", + "src": "contracts/lib/zeto_base.sol:36" + }, + { + "label": "verifier", + "offset": 0, + "slot": "2", + "type": "t_contract(Groth16Verifier_NfAnon)6554", + "contract": "Zeto_NfAnon", + "src": "contracts/zeto_nf_anon.sol:33" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_NfAnon)6554": { + "label": "contract Groth16Verifier_NfAnon", + "numberOfBytes": "20" + }, + "t_enum(UTXOStatus)6682": { + "label": "enum ZetoBase.UTXOStatus", + "members": [ + "UNKNOWN", + "UNSPENT", + "SPENT" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_enum(UTXOStatus)6682)": { + "label": "mapping(uint256 => enum ZetoBase.UTXOStatus)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + } + } +} diff --git a/solidity/.openzeppelin/unknown-59141.json b/solidity/.openzeppelin/unknown-59141.json new file mode 100644 index 0000000..320c923 --- /dev/null +++ b/solidity/.openzeppelin/unknown-59141.json @@ -0,0 +1,685 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0x83aee81113f035C3Ff1995E7BBfC53D2557F181b", + "txHash": "0xd86135f29abfee931c48f1dda5408f3cd1c5b2b94ff9b82b9e8306aa2ee12706", + "kind": "uups" + }, + { + "address": "0x12F24b2fB5B46Bae7f65763cC42cb1C7c9958dbD", + "txHash": "0x46645f66bf79dd16912d174143439d8c615d798d086bab12658511b98e515fd9", + "kind": "uups" + }, + { + "address": "0x35A705A2B700bd4C0A91Fd1898e4a68b1A6A1331", + "txHash": "0xc79020cd1ad1fdfbcb539038a56cc2238c31d0d36bc683dbf0039376ab8eef18", + "kind": "uups" + }, + { + "address": "0xFB37591aCf5E05Fd1E4aAAE3c317d20165358135", + "txHash": "0x591ab6fe6c4d8447e7e0420a5eb60cd74df66ebb3e044690a62d349e6bfaf055", + "kind": "uups" + } + ], + "impls": { + "d1f8a292f5a7ed6e35483f0f170b39434ed5090fa54bfaeaec7a5e097529e8e2": { + "address": "0x06aEF0D58799B1Ad153268938C7cF32A8Ba4C88a", + "txHash": "0xd55c9e7819d081e3419e59904aa9b36c8ac4a9904b312254656e22bf5ab5f7d2", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_utxos", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_enum(UTXOStatus)6682)", + "contract": "ZetoBase", + "src": "contracts/lib/zeto_base.sol:36" + }, + { + "label": "depositVerifier", + "offset": 0, + "slot": "2", + "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:31" + }, + { + "label": "erc20", + "offset": 0, + "slot": "3", + "type": "t_contract(IERC20)4041", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:33" + }, + { + "label": "withdrawVerifier", + "offset": 0, + "slot": "4", + "type": "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318", + "contract": "ZetoFungibleWithdraw", + "src": "contracts/lib/zeto_fungible_withdraw.sol:31" + }, + { + "label": "verifier", + "offset": 0, + "slot": "5", + "type": "t_contract(Groth16Verifier_Anon)5249", + "contract": "Zeto_Anon", + "src": "contracts/zeto_anon.sol:38" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_Anon)5249": { + "label": "contract Groth16Verifier_Anon", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckHashesValue)6203": { + "label": "contract Groth16Verifier_CheckHashesValue", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318": { + "label": "contract Groth16Verifier_CheckInputsOutputsValue", + "numberOfBytes": "20" + }, + "t_contract(IERC20)4041": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_enum(UTXOStatus)6682": { + "label": "enum ZetoBase.UTXOStatus", + "members": [ + "UNKNOWN", + "UNSPENT", + "SPENT" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_enum(UTXOStatus)6682)": { + "label": "mapping(uint256 => enum ZetoBase.UTXOStatus)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + }, + "8306fe5a8c2ee21c4a175a64f864c1966cc993766f6c6cceab1668c19137cea4": { + "address": "0x48A8420938cF153503b0fE4594Ae3066F547d91D", + "txHash": "0x9dff89042197c404e7463b998c12cf072d9dfee781a773a246e86d292bf43c6f", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_utxos", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_enum(UTXOStatus)5064)", + "contract": "ZetoBase", + "src": "contracts/lib/zeto_base.sol:36" + }, + { + "label": "depositVerifier", + "offset": 0, + "slot": "2", + "type": "t_contract(Groth16Verifier_CheckHashesValue)4797", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:31" + }, + { + "label": "erc20", + "offset": 0, + "slot": "3", + "type": "t_contract(IERC20)3304", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:33" + }, + { + "label": "withdrawVerifier", + "offset": 0, + "slot": "4", + "type": "t_contract(Groth16Verifier_CheckInputsOutputsValue)4912", + "contract": "ZetoFungibleWithdraw", + "src": "contracts/lib/zeto_fungible_withdraw.sol:31" + }, + { + "label": "verifier", + "offset": 0, + "slot": "5", + "type": "t_contract(Groth16Verifier_AnonEnc)4296", + "contract": "Zeto_AnonEnc", + "src": "contracts/zeto_anon_enc.sol:40" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_AnonEnc)4296": { + "label": "contract Groth16Verifier_AnonEnc", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckHashesValue)4797": { + "label": "contract Groth16Verifier_CheckHashesValue", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckInputsOutputsValue)4912": { + "label": "contract Groth16Verifier_CheckInputsOutputsValue", + "numberOfBytes": "20" + }, + "t_contract(IERC20)3304": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_enum(UTXOStatus)5064": { + "label": "enum ZetoBase.UTXOStatus", + "members": [ + "UNKNOWN", + "UNSPENT", + "SPENT" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_enum(UTXOStatus)5064)": { + "label": "mapping(uint256 => enum ZetoBase.UTXOStatus)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + }, + "31fd9e229f4302a5969e7fa1d78403d954c6792cdeeb0b8414ceb2b083eaf81c": { + "address": "0x66Cc1f498D972Ec2C787a24ffe14f28e0Ee60917", + "txHash": "0x885004ea49db032822333a65514a5112a685c44e483630ef5f01d0e8582936f8", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_commitmentsTree", + "offset": 0, + "slot": "1", + "type": "t_struct(Data)402_storage", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:31" + }, + { + "label": "_nullifiers", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_uint256,t_bool)", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:33" + }, + { + "label": "depositVerifier", + "offset": 0, + "slot": "52", + "type": "t_contract(Groth16Verifier_CheckHashesValue)4797", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:31" + }, + { + "label": "erc20", + "offset": 0, + "slot": "53", + "type": "t_contract(IERC20)3304", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:33" + }, + { + "label": "withdrawVerifier", + "offset": 0, + "slot": "54", + "type": "t_contract(Groth16Verifier_CheckNullifierValue)5045", + "contract": "ZetoFungibleWithdrawWithNullifiers", + "src": "contracts/lib/zeto_fungible_withdraw_nullifier.sol:32" + }, + { + "label": "verifier", + "offset": 0, + "slot": "55", + "type": "t_contract(Groth16Verifier_AnonEncNullifierNonRepudiation)4694", + "contract": "Zeto_AnonEncNullifierNonRepudiation", + "src": "contracts/zeto_anon_enc_nullifier_non_repudiation.sol:51" + }, + { + "label": "arbiter", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)2_storage", + "contract": "Zeto_AnonEncNullifierNonRepudiation", + "src": "contracts/zeto_anon_enc_nullifier_non_repudiation.sol:54" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_array(t_struct(RootEntry)429_storage)dyn_storage": { + "label": "struct SmtLib.RootEntry[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)2_storage": { + "label": "uint256[2]", + "numberOfBytes": "64" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)dyn_storage": { + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_AnonEncNullifierNonRepudiation)4694": { + "label": "contract Groth16Verifier_AnonEncNullifierNonRepudiation", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckHashesValue)4797": { + "label": "contract Groth16Verifier_CheckHashesValue", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckNullifierValue)5045": { + "label": "contract Groth16Verifier_CheckNullifierValue", + "numberOfBytes": "20" + }, + "t_contract(IERC20)3304": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_enum(NodeType)378": { + "label": "enum SmtLib.NodeType", + "members": [ + "EMPTY", + "LEAF", + "MIDDLE" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { + "label": "mapping(uint256 => uint256[])", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_bool)": { + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Node)456_storage)": { + "label": "mapping(uint256 => struct SmtLib.Node)", + "numberOfBytes": "32" + }, + "t_struct(Data)402_storage": { + "label": "struct SmtLib.Data", + "members": [ + { + "label": "nodes", + "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", + "offset": 0, + "slot": "0" + }, + { + "label": "rootEntries", + "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", + "offset": 0, + "slot": "1" + }, + { + "label": "rootIndexes", + "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", + "offset": 0, + "slot": "2" + }, + { + "label": "maxDepth", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "4" + }, + { + "label": "__gap", + "type": "t_array(t_uint256)45_storage", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "1600" + }, + "t_struct(Node)456_storage": { + "label": "struct SmtLib.Node", + "members": [ + { + "label": "nodeType", + "type": "t_enum(NodeType)378", + "offset": 0, + "slot": "0" + }, + { + "label": "childLeft", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "childRight", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "index", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "value", + "type": "t_uint256", + "offset": 0, + "slot": "4" + } + ], + "numberOfBytes": "160" + }, + "t_struct(RootEntry)429_storage": { + "label": "struct SmtLib.RootEntry", + "members": [ + { + "label": "root", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "createdAtTimestamp", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "createdAtBlock", + "type": "t_uint256", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + } + } +} diff --git a/solidity/.openzeppelin/unknown-80002.json b/solidity/.openzeppelin/unknown-80002.json new file mode 100644 index 0000000..0c7a500 --- /dev/null +++ b/solidity/.openzeppelin/unknown-80002.json @@ -0,0 +1,2245 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0x06aEF0D58799B1Ad153268938C7cF32A8Ba4C88a", + "txHash": "0xff5a66b1dc2662580c3c329161ac06b150166af3fc91b78745e68323792ad33a", + "kind": "uups" + }, + { + "address": "0xb98AACd711077640b9795A16AC4B31fbb6D66321", + "txHash": "0xe128eba150539aac7d710c4deb5fa4a8528d70fd2a7ff4daf64d2f53755472ef", + "kind": "uups" + }, + { + "address": "0x9e22DCf8D020D97abc7Db6BDcF1eCbAa49853276", + "txHash": "0x250dc060159586ca652e62637f08479f74e1b1c051a77d4cb4c7aabb663468e5", + "kind": "uups" + }, + { + "address": "0x22b38d8E7B626c645db33c3D8d261C0658caD86B", + "txHash": "0x590237cc8a9872ed8a3429a81dca64430725b8fa128cca16403a0510b2849d6c", + "kind": "uups" + }, + { + "address": "0x23f7e5B8Da26052eB47841154579b9f9d8058d8F", + "txHash": "0xb597f1a10dca3e6bd38b5982817805bcba57ae214ec219031885fe212d33a822", + "kind": "uups" + }, + { + "address": "0x3cA36a4c7f5EDd213abAF03Bc59a6C000d86ed63", + "txHash": "0xbfa69b1be8a292613902cba2fe47f790401ed6c8c05ebb1d47d0852c9a30b2ac", + "kind": "uups" + }, + { + "address": "0x038916B5E6Dd0A5f902c06374cF2c3Cb11ba0955", + "txHash": "0xae819227c29b10b7c1f2a15c307572baefdc76deb83793fbf1a71a9e7d6694cc", + "kind": "uups" + }, + { + "address": "0x20F4a08286f1ecD5561862e3e962074979fc8195", + "txHash": "0xffb3804142941625d59f05fa3cbfd6847ed3b49404c273e52e41e33393f588f4", + "kind": "uups" + }, + { + "address": "0x1cEa9581fe5DfF15a4a8E34Ac456A8090424C75d", + "txHash": "0xf067d4c7c98ab4d1a30f6e122f466f4f30548c2061ea948186257f3235c6a379", + "kind": "uups" + }, + { + "address": "0xCd04fB366830439d50D422A4439D455F83FDEb25", + "txHash": "0x9d47029fb685e4be2e51967b2eb3aca5fc86de47c85a106f1e16a937afdfd12e", + "kind": "uups" + }, + { + "address": "0xf11ADf0865a2f18Ee132c7aC060E9657da187A6d", + "txHash": "0x6196e6052059911f3e1b2b60fa978b2d6a5bfb7a5e93ea19f0fbbb7205cfdb5c", + "kind": "uups" + }, + { + "address": "0x6b50360040fCC90661D74912d9f8edba951E2389", + "txHash": "0x3002ea6895577c2efd5a2c354d4707db3b94e396d3d07f4b8d6ef7558993f0bd", + "kind": "uups" + }, + { + "address": "0xCf2Bc469CC2F57220e49921F1F314F28bD35a9D5", + "txHash": "0xb84de947ab39421dd9430181eb1a604805c2fe0ee380bf64abcc9664e963bdbe", + "kind": "uups" + }, + { + "address": "0x960cAAEB3cC772A7e73da5b4d42F843154D40058", + "txHash": "0x418ccc7f9871c0274b01de9df38aaec4fa080f78da55555e627c79e4ac0fce3b", + "kind": "uups" + }, + { + "address": "0x6D3524ED0d59De124f1601beDFe843f022439cB5", + "txHash": "0x3287f9126a9950f8801a60ba0e3d6d76ea8fede05edb1e0dd1f09dfb761df073", + "kind": "uups" + }, + { + "address": "0xe77d135cee739AAC1Fa992E4710bb8DdB8DeB18b", + "txHash": "0x39ca830c79b9f5ab102d7865af0c6f2a5397a6cc3f904123a23c4d1b9b554ff0", + "kind": "uups" + }, + { + "address": "0xF93F7D7cA3D4eF8b1984A5100d816288A6362825", + "txHash": "0x2b939907076334d00c8f78887ad3e452baacb80e426103dceae90c69aa9e03b8", + "kind": "uups" + }, + { + "address": "0x0f77445fD4CFdeD1947656C68a2143CF10Ca3e07", + "txHash": "0x084b1f4dfc233f7d58ef7d2e4511f7c20cc9bb5bf67d44c099a322ac283ef973", + "kind": "uups" + } + ], + "impls": { + "d1f8a292f5a7ed6e35483f0f170b39434ed5090fa54bfaeaec7a5e097529e8e2": { + "address": "0xb847436394418DF05406949A4ebBdc6148Be5EB1", + "txHash": "0x787d50e2a771e0f152598befe26764951c008182da2d03eac3c05d1d153af03c", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_utxos", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_enum(UTXOStatus)6682)", + "contract": "ZetoBase", + "src": "contracts/lib/zeto_base.sol:36" + }, + { + "label": "depositVerifier", + "offset": 0, + "slot": "2", + "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:31" + }, + { + "label": "erc20", + "offset": 0, + "slot": "3", + "type": "t_contract(IERC20)4041", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:33" + }, + { + "label": "withdrawVerifier", + "offset": 0, + "slot": "4", + "type": "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318", + "contract": "ZetoFungibleWithdraw", + "src": "contracts/lib/zeto_fungible_withdraw.sol:31" + }, + { + "label": "verifier", + "offset": 0, + "slot": "5", + "type": "t_contract(Groth16Verifier_Anon)5249", + "contract": "Zeto_Anon", + "src": "contracts/zeto_anon.sol:38" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_Anon)5249": { + "label": "contract Groth16Verifier_Anon", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckHashesValue)6203": { + "label": "contract Groth16Verifier_CheckHashesValue", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318": { + "label": "contract Groth16Verifier_CheckInputsOutputsValue", + "numberOfBytes": "20" + }, + "t_contract(IERC20)4041": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_enum(UTXOStatus)6682": { + "label": "enum ZetoBase.UTXOStatus", + "members": [ + "UNKNOWN", + "UNSPENT", + "SPENT" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_enum(UTXOStatus)6682)": { + "label": "mapping(uint256 => enum ZetoBase.UTXOStatus)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + }, + "6616fb519a5bacf608d6e6cd1ab224306ff18371d36f2ed116c80df3cd212caf": { + "address": "0x800B0C29A58efA7A2e2d53f4DA9461943A83501c", + "txHash": "0xa04e3253b082265f1e4c11e61fb10e9b35d7799e9a591fb61d9891199b40aa32", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_utxos", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_enum(UTXOStatus)6682)", + "contract": "ZetoBase", + "src": "contracts/lib/zeto_base.sol:36" + }, + { + "label": "depositVerifier", + "offset": 0, + "slot": "2", + "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:31" + }, + { + "label": "erc20", + "offset": 0, + "slot": "3", + "type": "t_contract(IERC20)4041", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:33" + }, + { + "label": "withdrawVerifier", + "offset": 0, + "slot": "4", + "type": "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318", + "contract": "ZetoFungibleWithdraw", + "src": "contracts/lib/zeto_fungible_withdraw.sol:31" + }, + { + "label": "verifier", + "offset": 0, + "slot": "5", + "type": "t_contract(Groth16Verifier_AnonEnc)5394", + "contract": "Zeto_AnonEnc", + "src": "contracts/zeto_anon_enc.sol:40" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_AnonEnc)5394": { + "label": "contract Groth16Verifier_AnonEnc", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckHashesValue)6203": { + "label": "contract Groth16Verifier_CheckHashesValue", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318": { + "label": "contract Groth16Verifier_CheckInputsOutputsValue", + "numberOfBytes": "20" + }, + "t_contract(IERC20)4041": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_enum(UTXOStatus)6682": { + "label": "enum ZetoBase.UTXOStatus", + "members": [ + "UNKNOWN", + "UNSPENT", + "SPENT" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_enum(UTXOStatus)6682)": { + "label": "mapping(uint256 => enum ZetoBase.UTXOStatus)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + }, + "dbd37499cacb81d5cfa9721c9f68dca8084a7ef482b73e7020f6f876855744c1": { + "address": "0xC94190c28A442069d7A1900d78Cd379E562cce48", + "txHash": "0x3fcdc80add70ef07734348aa47d1f0d05116881eaeb7e29d9899940571304194", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_commitmentsTree", + "offset": 0, + "slot": "1", + "type": "t_struct(Data)402_storage", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:31" + }, + { + "label": "_nullifiers", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_uint256,t_bool)", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:33" + }, + { + "label": "depositVerifier", + "offset": 0, + "slot": "52", + "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:31" + }, + { + "label": "erc20", + "offset": 0, + "slot": "53", + "type": "t_contract(IERC20)4041", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:33" + }, + { + "label": "withdrawVerifier", + "offset": 0, + "slot": "54", + "type": "t_contract(Groth16Verifier_CheckNullifierValue)6451", + "contract": "ZetoFungibleWithdrawWithNullifiers", + "src": "contracts/lib/zeto_fungible_withdraw_nullifier.sol:32" + }, + { + "label": "verifier", + "offset": 0, + "slot": "55", + "type": "t_contract(Groth16Verifier_AnonNullifier)5961", + "contract": "Zeto_AnonNullifier", + "src": "contracts/zeto_anon_nullifier.sol:46" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_array(t_struct(RootEntry)429_storage)dyn_storage": { + "label": "struct SmtLib.RootEntry[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)dyn_storage": { + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_AnonNullifier)5961": { + "label": "contract Groth16Verifier_AnonNullifier", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckHashesValue)6203": { + "label": "contract Groth16Verifier_CheckHashesValue", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckNullifierValue)6451": { + "label": "contract Groth16Verifier_CheckNullifierValue", + "numberOfBytes": "20" + }, + "t_contract(IERC20)4041": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_enum(NodeType)378": { + "label": "enum SmtLib.NodeType", + "members": [ + "EMPTY", + "LEAF", + "MIDDLE" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { + "label": "mapping(uint256 => uint256[])", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_bool)": { + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Node)456_storage)": { + "label": "mapping(uint256 => struct SmtLib.Node)", + "numberOfBytes": "32" + }, + "t_struct(Data)402_storage": { + "label": "struct SmtLib.Data", + "members": [ + { + "label": "nodes", + "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", + "offset": 0, + "slot": "0" + }, + { + "label": "rootEntries", + "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", + "offset": 0, + "slot": "1" + }, + { + "label": "rootIndexes", + "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", + "offset": 0, + "slot": "2" + }, + { + "label": "maxDepth", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "4" + }, + { + "label": "__gap", + "type": "t_array(t_uint256)45_storage", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "1600" + }, + "t_struct(Node)456_storage": { + "label": "struct SmtLib.Node", + "members": [ + { + "label": "nodeType", + "type": "t_enum(NodeType)378", + "offset": 0, + "slot": "0" + }, + { + "label": "childLeft", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "childRight", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "index", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "value", + "type": "t_uint256", + "offset": 0, + "slot": "4" + } + ], + "numberOfBytes": "160" + }, + "t_struct(RootEntry)429_storage": { + "label": "struct SmtLib.RootEntry", + "members": [ + { + "label": "root", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "createdAtTimestamp", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "createdAtBlock", + "type": "t_uint256", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + }, + "059994426b39217c4f62861f1056e9b51d4df785d0172cd9b8d94b7d2624ab5d": { + "address": "0x625aFFb57723192599EFD025bBfD0492382Bb300", + "txHash": "0x4e91cf17be11d5bdf1e4f5bb28ce55739e4672c02db886a41570f7a4ecfc268d", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_commitmentsTree", + "offset": 0, + "slot": "1", + "type": "t_struct(Data)402_storage", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:31" + }, + { + "label": "_nullifiers", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_uint256,t_bool)", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:33" + }, + { + "label": "depositVerifier", + "offset": 0, + "slot": "52", + "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:31" + }, + { + "label": "erc20", + "offset": 0, + "slot": "53", + "type": "t_contract(IERC20)4041", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:33" + }, + { + "label": "withdrawVerifier", + "offset": 0, + "slot": "54", + "type": "t_contract(Groth16Verifier_CheckNullifierValue)6451", + "contract": "ZetoFungibleWithdrawWithNullifiers", + "src": "contracts/lib/zeto_fungible_withdraw_nullifier.sol:32" + }, + { + "label": "verifier", + "offset": 0, + "slot": "55", + "type": "t_contract(Groth16Verifier_AnonEncNullifier)5557", + "contract": "Zeto_AnonEncNullifier", + "src": "contracts/zeto_anon_enc_nullifier.sol:42" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_array(t_struct(RootEntry)429_storage)dyn_storage": { + "label": "struct SmtLib.RootEntry[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)dyn_storage": { + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_AnonEncNullifier)5557": { + "label": "contract Groth16Verifier_AnonEncNullifier", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckHashesValue)6203": { + "label": "contract Groth16Verifier_CheckHashesValue", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckNullifierValue)6451": { + "label": "contract Groth16Verifier_CheckNullifierValue", + "numberOfBytes": "20" + }, + "t_contract(IERC20)4041": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_enum(NodeType)378": { + "label": "enum SmtLib.NodeType", + "members": [ + "EMPTY", + "LEAF", + "MIDDLE" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { + "label": "mapping(uint256 => uint256[])", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_bool)": { + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Node)456_storage)": { + "label": "mapping(uint256 => struct SmtLib.Node)", + "numberOfBytes": "32" + }, + "t_struct(Data)402_storage": { + "label": "struct SmtLib.Data", + "members": [ + { + "label": "nodes", + "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", + "offset": 0, + "slot": "0" + }, + { + "label": "rootEntries", + "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", + "offset": 0, + "slot": "1" + }, + { + "label": "rootIndexes", + "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", + "offset": 0, + "slot": "2" + }, + { + "label": "maxDepth", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "4" + }, + { + "label": "__gap", + "type": "t_array(t_uint256)45_storage", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "1600" + }, + "t_struct(Node)456_storage": { + "label": "struct SmtLib.Node", + "members": [ + { + "label": "nodeType", + "type": "t_enum(NodeType)378", + "offset": 0, + "slot": "0" + }, + { + "label": "childLeft", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "childRight", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "index", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "value", + "type": "t_uint256", + "offset": 0, + "slot": "4" + } + ], + "numberOfBytes": "160" + }, + "t_struct(RootEntry)429_storage": { + "label": "struct SmtLib.RootEntry", + "members": [ + { + "label": "root", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "createdAtTimestamp", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "createdAtBlock", + "type": "t_uint256", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + }, + "e5b45452ea2cd1bbb89427d7270275d63cc4d4519d426765853e84facd9d11d2": { + "address": "0x77F070a1ae3D9208A95F889a819f45F82ef406b6", + "txHash": "0xcca346f680ce2d41d35b54a5ce57d1a03558692ec1834e621cfecc3fe7040a47", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_commitmentsTree", + "offset": 0, + "slot": "1", + "type": "t_struct(Data)402_storage", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:31" + }, + { + "label": "_nullifiers", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_uint256,t_bool)", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:33" + }, + { + "label": "depositVerifier", + "offset": 0, + "slot": "52", + "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:31" + }, + { + "label": "erc20", + "offset": 0, + "slot": "53", + "type": "t_contract(IERC20)4041", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:33" + }, + { + "label": "withdrawVerifier", + "offset": 0, + "slot": "54", + "type": "t_contract(Groth16Verifier_CheckNullifierValue)6451", + "contract": "ZetoFungibleWithdrawWithNullifiers", + "src": "contracts/lib/zeto_fungible_withdraw_nullifier.sol:32" + }, + { + "label": "verifier", + "offset": 0, + "slot": "55", + "type": "t_contract(Groth16Verifier_AnonEncNullifierNonRepudiation)5828", + "contract": "Zeto_AnonEncNullifierNonRepudiation", + "src": "contracts/zeto_anon_enc_nullifier_non_repudiation.sol:51" + }, + { + "label": "arbiter", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)2_storage", + "contract": "Zeto_AnonEncNullifierNonRepudiation", + "src": "contracts/zeto_anon_enc_nullifier_non_repudiation.sol:54" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_array(t_struct(RootEntry)429_storage)dyn_storage": { + "label": "struct SmtLib.RootEntry[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)2_storage": { + "label": "uint256[2]", + "numberOfBytes": "64" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)dyn_storage": { + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_AnonEncNullifierNonRepudiation)5828": { + "label": "contract Groth16Verifier_AnonEncNullifierNonRepudiation", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckHashesValue)6203": { + "label": "contract Groth16Verifier_CheckHashesValue", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckNullifierValue)6451": { + "label": "contract Groth16Verifier_CheckNullifierValue", + "numberOfBytes": "20" + }, + "t_contract(IERC20)4041": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_enum(NodeType)378": { + "label": "enum SmtLib.NodeType", + "members": [ + "EMPTY", + "LEAF", + "MIDDLE" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { + "label": "mapping(uint256 => uint256[])", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_bool)": { + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Node)456_storage)": { + "label": "mapping(uint256 => struct SmtLib.Node)", + "numberOfBytes": "32" + }, + "t_struct(Data)402_storage": { + "label": "struct SmtLib.Data", + "members": [ + { + "label": "nodes", + "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", + "offset": 0, + "slot": "0" + }, + { + "label": "rootEntries", + "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", + "offset": 0, + "slot": "1" + }, + { + "label": "rootIndexes", + "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", + "offset": 0, + "slot": "2" + }, + { + "label": "maxDepth", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "4" + }, + { + "label": "__gap", + "type": "t_array(t_uint256)45_storage", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "1600" + }, + "t_struct(Node)456_storage": { + "label": "struct SmtLib.Node", + "members": [ + { + "label": "nodeType", + "type": "t_enum(NodeType)378", + "offset": 0, + "slot": "0" + }, + { + "label": "childLeft", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "childRight", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "index", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "value", + "type": "t_uint256", + "offset": 0, + "slot": "4" + } + ], + "numberOfBytes": "160" + }, + "t_struct(RootEntry)429_storage": { + "label": "struct SmtLib.RootEntry", + "members": [ + { + "label": "root", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "createdAtTimestamp", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "createdAtBlock", + "type": "t_uint256", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + }, + "159105749ed78f6656dc0644309eea7afd0d70970e4e963f5be8f3a5870fbac7": { + "address": "0x59FdC29dC8387fAe8BFFE185b8A9c9BA0eB77Da3", + "txHash": "0xc9ad6b5fdd875c6ca7a6ec6f19192e5be19b25746d81e57e189ca433d11371ae", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_commitmentsTree", + "offset": 0, + "slot": "1", + "type": "t_struct(Data)402_storage", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:31" + }, + { + "label": "_nullifiers", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_uint256,t_bool)", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:33" + }, + { + "label": "depositVerifier", + "offset": 0, + "slot": "52", + "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:31" + }, + { + "label": "erc20", + "offset": 0, + "slot": "53", + "type": "t_contract(IERC20)4041", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:33" + }, + { + "label": "withdrawVerifier", + "offset": 0, + "slot": "54", + "type": "t_contract(Groth16Verifier_CheckNullifierValue)6451", + "contract": "ZetoFungibleWithdrawWithNullifiers", + "src": "contracts/lib/zeto_fungible_withdraw_nullifier.sol:32" + }, + { + "label": "_publicKeysTree", + "offset": 0, + "slot": "55", + "type": "t_struct(Data)402_storage", + "contract": "Registry", + "src": "contracts/lib/registry.sol:33" + }, + { + "label": "verifier", + "offset": 0, + "slot": "105", + "type": "t_contract(Groth16Verifier_AnonNullifierKyc)6100", + "contract": "Zeto_AnonNullifierKyc", + "src": "contracts/zeto_anon_nullifier_kyc.sol:47" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_array(t_struct(RootEntry)429_storage)dyn_storage": { + "label": "struct SmtLib.RootEntry[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)dyn_storage": { + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_AnonNullifierKyc)6100": { + "label": "contract Groth16Verifier_AnonNullifierKyc", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckHashesValue)6203": { + "label": "contract Groth16Verifier_CheckHashesValue", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckNullifierValue)6451": { + "label": "contract Groth16Verifier_CheckNullifierValue", + "numberOfBytes": "20" + }, + "t_contract(IERC20)4041": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_enum(NodeType)378": { + "label": "enum SmtLib.NodeType", + "members": [ + "EMPTY", + "LEAF", + "MIDDLE" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { + "label": "mapping(uint256 => uint256[])", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_bool)": { + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Node)456_storage)": { + "label": "mapping(uint256 => struct SmtLib.Node)", + "numberOfBytes": "32" + }, + "t_struct(Data)402_storage": { + "label": "struct SmtLib.Data", + "members": [ + { + "label": "nodes", + "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", + "offset": 0, + "slot": "0" + }, + { + "label": "rootEntries", + "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", + "offset": 0, + "slot": "1" + }, + { + "label": "rootIndexes", + "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", + "offset": 0, + "slot": "2" + }, + { + "label": "maxDepth", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "4" + }, + { + "label": "__gap", + "type": "t_array(t_uint256)45_storage", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "1600" + }, + "t_struct(Node)456_storage": { + "label": "struct SmtLib.Node", + "members": [ + { + "label": "nodeType", + "type": "t_enum(NodeType)378", + "offset": 0, + "slot": "0" + }, + { + "label": "childLeft", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "childRight", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "index", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "value", + "type": "t_uint256", + "offset": 0, + "slot": "4" + } + ], + "numberOfBytes": "160" + }, + "t_struct(RootEntry)429_storage": { + "label": "struct SmtLib.RootEntry", + "members": [ + { + "label": "root", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "createdAtTimestamp", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "createdAtBlock", + "type": "t_uint256", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + }, + "dd9d43aaa857387431e896435e3e161a9e1da817a46a8d56fa3a0d08c6da0f2c": { + "address": "0xe3D7501A8d10d1029976ee24E7082D273bbCd6C1", + "txHash": "0x747cf1de08143a6a452ad4fca2290a629ed7065e9fbdcb87512be6ef4ad96ea9", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_commitmentsTree", + "offset": 0, + "slot": "1", + "type": "t_struct(Data)402_storage", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:31" + }, + { + "label": "_nullifiers", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_uint256,t_bool)", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:33" + }, + { + "label": "depositVerifier", + "offset": 0, + "slot": "52", + "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:31" + }, + { + "label": "erc20", + "offset": 0, + "slot": "53", + "type": "t_contract(IERC20)4041", + "contract": "ZetoFungible", + "src": "contracts/lib/zeto_fungible.sol:33" + }, + { + "label": "withdrawVerifier", + "offset": 0, + "slot": "54", + "type": "t_contract(Groth16Verifier_CheckNullifierValue)6451", + "contract": "ZetoFungibleWithdrawWithNullifiers", + "src": "contracts/lib/zeto_fungible_withdraw_nullifier.sol:32" + }, + { + "label": "_publicKeysTree", + "offset": 0, + "slot": "55", + "type": "t_struct(Data)402_storage", + "contract": "Registry", + "src": "contracts/lib/registry.sol:33" + }, + { + "label": "verifier", + "offset": 0, + "slot": "105", + "type": "t_contract(Groth16Verifier_AnonNullifierKyc)6100", + "contract": "Zeto_AnonNullifierKyc", + "src": "contracts/zeto_anon_nullifier_kyc.sol:47" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_array(t_struct(RootEntry)429_storage)dyn_storage": { + "label": "struct SmtLib.RootEntry[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)dyn_storage": { + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_AnonNullifierKyc)6100": { + "label": "contract Groth16Verifier_AnonNullifierKyc", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckHashesValue)6203": { + "label": "contract Groth16Verifier_CheckHashesValue", + "numberOfBytes": "20" + }, + "t_contract(Groth16Verifier_CheckNullifierValue)6451": { + "label": "contract Groth16Verifier_CheckNullifierValue", + "numberOfBytes": "20" + }, + "t_contract(IERC20)4041": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_enum(NodeType)378": { + "label": "enum SmtLib.NodeType", + "members": [ + "EMPTY", + "LEAF", + "MIDDLE" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { + "label": "mapping(uint256 => uint256[])", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_bool)": { + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Node)456_storage)": { + "label": "mapping(uint256 => struct SmtLib.Node)", + "numberOfBytes": "32" + }, + "t_struct(Data)402_storage": { + "label": "struct SmtLib.Data", + "members": [ + { + "label": "nodes", + "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", + "offset": 0, + "slot": "0" + }, + { + "label": "rootEntries", + "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", + "offset": 0, + "slot": "1" + }, + { + "label": "rootIndexes", + "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", + "offset": 0, + "slot": "2" + }, + { + "label": "maxDepth", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "4" + }, + { + "label": "__gap", + "type": "t_array(t_uint256)45_storage", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "1600" + }, + "t_struct(Node)456_storage": { + "label": "struct SmtLib.Node", + "members": [ + { + "label": "nodeType", + "type": "t_enum(NodeType)378", + "offset": 0, + "slot": "0" + }, + { + "label": "childLeft", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "childRight", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "index", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "value", + "type": "t_uint256", + "offset": 0, + "slot": "4" + } + ], + "numberOfBytes": "160" + }, + "t_struct(RootEntry)429_storage": { + "label": "struct SmtLib.RootEntry", + "members": [ + { + "label": "root", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "createdAtTimestamp", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "createdAtBlock", + "type": "t_uint256", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + }, + "62e5095beb8b073eaac406d1e2deaf2ca025949018ad99acded252a8b01f744b": { + "address": "0xfc65fa598D58AAf95051a7E05eC6617A7D720796", + "txHash": "0x83b747fd71c95ee0bc85ab0766cc0c5bf4633e6d45ff7c007b2940010e9d5a2e", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "lockedProofs", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_address)", + "contract": "ZetoCommon", + "src": "contracts/lib/zeto_common.sol:53" + }, + { + "label": "_commitmentsTree", + "offset": 0, + "slot": "1", + "type": "t_struct(Data)402_storage", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:31" + }, + { + "label": "_nullifiers", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_uint256,t_bool)", + "contract": "ZetoNullifier", + "src": "contracts/lib/zeto_nullifier.sol:33" + }, + { + "label": "verifier", + "offset": 0, + "slot": "52", + "type": "t_contract(Groth16Verifier_NfAnonNullifier)6663", + "contract": "Zeto_NfAnonNullifier", + "src": "contracts/zeto_nf_anon_nullifier.sol:39" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)687_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)620_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_array(t_struct(RootEntry)429_storage)dyn_storage": { + "label": "struct SmtLib.RootEntry[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)dyn_storage": { + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(Groth16Verifier_NfAnonNullifier)6663": { + "label": "contract Groth16Verifier_NfAnonNullifier", + "numberOfBytes": "20" + }, + "t_enum(NodeType)378": { + "label": "enum SmtLib.NodeType", + "members": [ + "EMPTY", + "LEAF", + "MIDDLE" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_bytes32,t_address)": { + "label": "mapping(bytes32 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { + "label": "mapping(uint256 => uint256[])", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_bool)": { + "label": "mapping(uint256 => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Node)456_storage)": { + "label": "mapping(uint256 => struct SmtLib.Node)", + "numberOfBytes": "32" + }, + "t_struct(Data)402_storage": { + "label": "struct SmtLib.Data", + "members": [ + { + "label": "nodes", + "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", + "offset": 0, + "slot": "0" + }, + { + "label": "rootEntries", + "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", + "offset": 0, + "slot": "1" + }, + { + "label": "rootIndexes", + "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", + "offset": 0, + "slot": "2" + }, + { + "label": "maxDepth", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "initialized", + "type": "t_bool", + "offset": 0, + "slot": "4" + }, + { + "label": "__gap", + "type": "t_array(t_uint256)45_storage", + "offset": 0, + "slot": "5" + } + ], + "numberOfBytes": "1600" + }, + "t_struct(Node)456_storage": { + "label": "struct SmtLib.Node", + "members": [ + { + "label": "nodeType", + "type": "t_enum(NodeType)378", + "offset": 0, + "slot": "0" + }, + { + "label": "childLeft", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "childRight", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "index", + "type": "t_uint256", + "offset": 0, + "slot": "3" + }, + { + "label": "value", + "type": "t_uint256", + "offset": 0, + "slot": "4" + } + ], + "numberOfBytes": "160" + }, + "t_struct(RootEntry)429_storage": { + "label": "struct SmtLib.RootEntry", + "members": [ + { + "label": "root", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "createdAtTimestamp", + "type": "t_uint256", + "offset": 0, + "slot": "1" + }, + { + "label": "createdAtBlock", + "type": "t_uint256", + "offset": 0, + "slot": "2" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + } + } +} diff --git a/solidity/test/zeto_anon.ts b/solidity/test/zeto_anon.ts index d3ac214..425abed 100644 --- a/solidity/test/zeto_anon.ts +++ b/solidity/test/zeto_anon.ts @@ -44,7 +44,10 @@ describe("Zeto based fungible token with anonymity without encryption or nullifi let circuit: any, provingKey: any; before(async function () { - this.timeout(600000); + if (network.name !== 'hardhat') { + // accommodate for longer block times on public networks + this.timeout(120000); + } let [d, a, b, c] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); diff --git a/solidity/test/zeto_anon_enc.ts b/solidity/test/zeto_anon_enc.ts index de38ffa..cab7dcd 100644 --- a/solidity/test/zeto_anon_enc.ts +++ b/solidity/test/zeto_anon_enc.ts @@ -41,7 +41,10 @@ describe("Zeto based fungible token with anonymity and encryption", function () let circuit: any, provingKey: any; before(async function () { - this.timeout(600000); + if (network.name !== 'hardhat') { + // accommodate for longer block times on public networks + this.timeout(120000); + } let [d, a, b, c] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); diff --git a/solidity/test/zeto_anon_enc_nullifier.ts b/solidity/test/zeto_anon_enc_nullifier.ts index 4d537c3..bd418c0 100644 --- a/solidity/test/zeto_anon_enc_nullifier.ts +++ b/solidity/test/zeto_anon_enc_nullifier.ts @@ -43,7 +43,10 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti let smtBob: Merkletree; before(async function () { - this.timeout(600000); + if (network.name !== 'hardhat') { + // accommodate for longer block times on public networks + this.timeout(120000); + } let [d, a, b, c] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); diff --git a/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts b/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts index d3f27f1..f743b20 100644 --- a/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts +++ b/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts @@ -44,7 +44,10 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti let smtBob: Merkletree; before(async function () { - this.timeout(600000); + if (network.name !== 'hardhat') { + // accommodate for longer block times on public networks + this.timeout(120000); + } let [d, a, b, c, e] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); diff --git a/solidity/test/zeto_anon_nullifier.ts b/solidity/test/zeto_anon_nullifier.ts index 3c18f16..fca3025 100644 --- a/solidity/test/zeto_anon_nullifier.ts +++ b/solidity/test/zeto_anon_nullifier.ts @@ -42,7 +42,10 @@ describe("Zeto based fungible token with anonymity using nullifiers without encr let smtBob: Merkletree; before(async function () { - this.timeout(600000); + if (network.name !== 'hardhat') { + // accommodate for longer block times on public networks + this.timeout(120000); + } let [d, a, b, c] = await ethers.getSigners(); deployer = d; diff --git a/solidity/test/zeto_anon_nullifier_kyc.ts b/solidity/test/zeto_anon_nullifier_kyc.ts index 90ac51e..393d586 100644 --- a/solidity/test/zeto_anon_nullifier_kyc.ts +++ b/solidity/test/zeto_anon_nullifier_kyc.ts @@ -47,7 +47,10 @@ describe("Zeto based fungible token with anonymity, KYC, using nullifiers withou let smtKyc: Merkletree; before(async function () { - this.timeout(600000); + if (network.name !== 'hardhat') { + // accommodate for longer block times on public networks + this.timeout(120000); + } let [d, a, b, c, e] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); diff --git a/solidity/test/zeto_nf_anon.ts b/solidity/test/zeto_nf_anon.ts index ef393b6..543fae0 100644 --- a/solidity/test/zeto_nf_anon.ts +++ b/solidity/test/zeto_nf_anon.ts @@ -36,6 +36,10 @@ describe("Zeto based non-fungible token with anonymity without encryption or nul let circuit: any, provingKey: any; before(async function () { + if (network.name !== 'hardhat') { + // accommodate for longer block times on public networks + this.timeout(120000); + } let [d, a, b, c] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); diff --git a/solidity/test/zeto_nf_anon_nullifier.ts b/solidity/test/zeto_nf_anon_nullifier.ts index 03940e2..8b2a33f 100644 --- a/solidity/test/zeto_nf_anon_nullifier.ts +++ b/solidity/test/zeto_nf_anon_nullifier.ts @@ -37,6 +37,10 @@ describe("Zeto based non-fungible token with anonymity using nullifiers without let smtBob: Merkletree; before(async function () { + if (network.name !== 'hardhat') { + // accommodate for longer block times on public networks + this.timeout(120000); + } let [d, a, b, c] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); diff --git a/solidity/test/zkDvP.ts b/solidity/test/zkDvP.ts index 1016cee..9159fe4 100644 --- a/solidity/test/zkDvP.ts +++ b/solidity/test/zkDvP.ts @@ -47,7 +47,10 @@ describe("DvP flows between fungible and non-fungible tokens based on Zeto with let deployer: Signer; before(async function () { - this.timeout(600000); + if (network.name !== 'hardhat') { + // accommodate for longer block times on public networks + this.timeout(120000); + } let [d, a, b, c] = await ethers.getSigners(); deployer = d; Alice = await newUser(a); From 6fb652cb5ada6699bd6803b207703c61c6084105 Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Tue, 27 Aug 2024 10:06:41 -0400 Subject: [PATCH 7/8] Remove .openzeppelin metadata Signed-off-by: Jim Zhang --- solidity/.gitignore | 3 +- solidity/.openzeppelin/unknown-1337.json | 345 ---- solidity/.openzeppelin/unknown-59141.json | 685 ------- solidity/.openzeppelin/unknown-80002.json | 2245 --------------------- 4 files changed, 2 insertions(+), 3276 deletions(-) delete mode 100644 solidity/.openzeppelin/unknown-1337.json delete mode 100644 solidity/.openzeppelin/unknown-59141.json delete mode 100644 solidity/.openzeppelin/unknown-80002.json diff --git a/solidity/.gitignore b/solidity/.gitignore index 63b34f4..7e3df9d 100644 --- a/solidity/.gitignore +++ b/solidity/.gitignore @@ -3,4 +3,5 @@ node_modules artifacts cache typechain-types -ignition/deployments \ No newline at end of file +ignition/deployments +.openzeppelin \ No newline at end of file diff --git a/solidity/.openzeppelin/unknown-1337.json b/solidity/.openzeppelin/unknown-1337.json deleted file mode 100644 index 2719633..0000000 --- a/solidity/.openzeppelin/unknown-1337.json +++ /dev/null @@ -1,345 +0,0 @@ -{ - "manifestVersion": "3.2", - "proxies": [ - { - "address": "0xf8AD579928Ca0E41FddB95Ce16FFFf6E5C8C742D", - "txHash": "0x882bd16240765b2b2dde017b893f7e790edaa863ace12c0f602429e6a4ede639", - "kind": "uups" - }, - { - "address": "0xA52F9928409Cb15F2e1a220CF86D56D7dcbCE917", - "txHash": "0x0034c2278e6d952815dd5fa7abc8991a3b7a963a19ee1f9a6dd27b43d6d3a780", - "kind": "uups" - }, - { - "address": "0xcD420d9fE00C78820EB1EcE7241a9608519589c1", - "txHash": "0xc660bc1e81f02255834d68df4037a6c9fbbd85deaaebdf6ecdc58ead92a67a59", - "kind": "uups" - }, - { - "address": "0xe36a3d4b5B55c6F8FeA0Ffe95444772a0ed4091a", - "txHash": "0x1e14cf679484b6200e27498d65c4dd352a926c11451e8911b0d26aa888a48c6d", - "kind": "uups" - }, - { - "address": "0x55019bC141a29c0Fb77A35951625666bc375cC76", - "txHash": "0x272e428542cce5f7e1f66ff13478f3ce00149f10627cca3ee5d6ec7241efa0f3", - "kind": "uups" - }, - { - "address": "0x6165E50070494A547e7cc1e86739F3645Feb0453", - "txHash": "0x3d95cd6d932e3fcb2410a18bb9037a6a1cd05f070c855ece6a86f72ea211114b", - "kind": "uups" - } - ], - "impls": { - "d1f8a292f5a7ed6e35483f0f170b39434ed5090fa54bfaeaec7a5e097529e8e2": { - "address": "0xc5119e3e608fE6AE471567B9170671015228A31e", - "txHash": "0x011c26d9bcd6eb9f4371199841b744e3df64d404186699e25419d4e783b0bd85", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_utxos", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_enum(UTXOStatus)6682)", - "contract": "ZetoBase", - "src": "contracts/lib/zeto_base.sol:36" - }, - { - "label": "depositVerifier", - "offset": 0, - "slot": "2", - "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:31" - }, - { - "label": "erc20", - "offset": 0, - "slot": "3", - "type": "t_contract(IERC20)4041", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:33" - }, - { - "label": "withdrawVerifier", - "offset": 0, - "slot": "4", - "type": "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318", - "contract": "ZetoFungibleWithdraw", - "src": "contracts/lib/zeto_fungible_withdraw.sol:31" - }, - { - "label": "verifier", - "offset": 0, - "slot": "5", - "type": "t_contract(Groth16Verifier_Anon)5249", - "contract": "Zeto_Anon", - "src": "contracts/zeto_anon.sol:38" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_Anon)5249": { - "label": "contract Groth16Verifier_Anon", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckHashesValue)6203": { - "label": "contract Groth16Verifier_CheckHashesValue", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318": { - "label": "contract Groth16Verifier_CheckInputsOutputsValue", - "numberOfBytes": "20" - }, - "t_contract(IERC20)4041": { - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_enum(UTXOStatus)6682": { - "label": "enum ZetoBase.UTXOStatus", - "members": [ - "UNKNOWN", - "UNSPENT", - "SPENT" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_enum(UTXOStatus)6682)": { - "label": "mapping(uint256 => enum ZetoBase.UTXOStatus)", - "numberOfBytes": "32" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - }, - "ff52d8def6e74418ef76c250bb2cc04a90f26ad4106ab5c59f453ed30cf1e2a1": { - "address": "0xf1edb0d4CacC0F524851c28FAdA9547a967f7886", - "txHash": "0x70728bae15390b5359d6da865c790730b7b7b4cc5a9d40dc397707a3bdb38fd2", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_utxos", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_enum(UTXOStatus)6682)", - "contract": "ZetoBase", - "src": "contracts/lib/zeto_base.sol:36" - }, - { - "label": "verifier", - "offset": 0, - "slot": "2", - "type": "t_contract(Groth16Verifier_NfAnon)6554", - "contract": "Zeto_NfAnon", - "src": "contracts/zeto_nf_anon.sol:33" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_NfAnon)6554": { - "label": "contract Groth16Verifier_NfAnon", - "numberOfBytes": "20" - }, - "t_enum(UTXOStatus)6682": { - "label": "enum ZetoBase.UTXOStatus", - "members": [ - "UNKNOWN", - "UNSPENT", - "SPENT" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_enum(UTXOStatus)6682)": { - "label": "mapping(uint256 => enum ZetoBase.UTXOStatus)", - "numberOfBytes": "32" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - } - } -} diff --git a/solidity/.openzeppelin/unknown-59141.json b/solidity/.openzeppelin/unknown-59141.json deleted file mode 100644 index 320c923..0000000 --- a/solidity/.openzeppelin/unknown-59141.json +++ /dev/null @@ -1,685 +0,0 @@ -{ - "manifestVersion": "3.2", - "proxies": [ - { - "address": "0x83aee81113f035C3Ff1995E7BBfC53D2557F181b", - "txHash": "0xd86135f29abfee931c48f1dda5408f3cd1c5b2b94ff9b82b9e8306aa2ee12706", - "kind": "uups" - }, - { - "address": "0x12F24b2fB5B46Bae7f65763cC42cb1C7c9958dbD", - "txHash": "0x46645f66bf79dd16912d174143439d8c615d798d086bab12658511b98e515fd9", - "kind": "uups" - }, - { - "address": "0x35A705A2B700bd4C0A91Fd1898e4a68b1A6A1331", - "txHash": "0xc79020cd1ad1fdfbcb539038a56cc2238c31d0d36bc683dbf0039376ab8eef18", - "kind": "uups" - }, - { - "address": "0xFB37591aCf5E05Fd1E4aAAE3c317d20165358135", - "txHash": "0x591ab6fe6c4d8447e7e0420a5eb60cd74df66ebb3e044690a62d349e6bfaf055", - "kind": "uups" - } - ], - "impls": { - "d1f8a292f5a7ed6e35483f0f170b39434ed5090fa54bfaeaec7a5e097529e8e2": { - "address": "0x06aEF0D58799B1Ad153268938C7cF32A8Ba4C88a", - "txHash": "0xd55c9e7819d081e3419e59904aa9b36c8ac4a9904b312254656e22bf5ab5f7d2", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_utxos", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_enum(UTXOStatus)6682)", - "contract": "ZetoBase", - "src": "contracts/lib/zeto_base.sol:36" - }, - { - "label": "depositVerifier", - "offset": 0, - "slot": "2", - "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:31" - }, - { - "label": "erc20", - "offset": 0, - "slot": "3", - "type": "t_contract(IERC20)4041", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:33" - }, - { - "label": "withdrawVerifier", - "offset": 0, - "slot": "4", - "type": "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318", - "contract": "ZetoFungibleWithdraw", - "src": "contracts/lib/zeto_fungible_withdraw.sol:31" - }, - { - "label": "verifier", - "offset": 0, - "slot": "5", - "type": "t_contract(Groth16Verifier_Anon)5249", - "contract": "Zeto_Anon", - "src": "contracts/zeto_anon.sol:38" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_Anon)5249": { - "label": "contract Groth16Verifier_Anon", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckHashesValue)6203": { - "label": "contract Groth16Verifier_CheckHashesValue", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318": { - "label": "contract Groth16Verifier_CheckInputsOutputsValue", - "numberOfBytes": "20" - }, - "t_contract(IERC20)4041": { - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_enum(UTXOStatus)6682": { - "label": "enum ZetoBase.UTXOStatus", - "members": [ - "UNKNOWN", - "UNSPENT", - "SPENT" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_enum(UTXOStatus)6682)": { - "label": "mapping(uint256 => enum ZetoBase.UTXOStatus)", - "numberOfBytes": "32" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - }, - "8306fe5a8c2ee21c4a175a64f864c1966cc993766f6c6cceab1668c19137cea4": { - "address": "0x48A8420938cF153503b0fE4594Ae3066F547d91D", - "txHash": "0x9dff89042197c404e7463b998c12cf072d9dfee781a773a246e86d292bf43c6f", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_utxos", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_enum(UTXOStatus)5064)", - "contract": "ZetoBase", - "src": "contracts/lib/zeto_base.sol:36" - }, - { - "label": "depositVerifier", - "offset": 0, - "slot": "2", - "type": "t_contract(Groth16Verifier_CheckHashesValue)4797", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:31" - }, - { - "label": "erc20", - "offset": 0, - "slot": "3", - "type": "t_contract(IERC20)3304", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:33" - }, - { - "label": "withdrawVerifier", - "offset": 0, - "slot": "4", - "type": "t_contract(Groth16Verifier_CheckInputsOutputsValue)4912", - "contract": "ZetoFungibleWithdraw", - "src": "contracts/lib/zeto_fungible_withdraw.sol:31" - }, - { - "label": "verifier", - "offset": 0, - "slot": "5", - "type": "t_contract(Groth16Verifier_AnonEnc)4296", - "contract": "Zeto_AnonEnc", - "src": "contracts/zeto_anon_enc.sol:40" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_AnonEnc)4296": { - "label": "contract Groth16Verifier_AnonEnc", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckHashesValue)4797": { - "label": "contract Groth16Verifier_CheckHashesValue", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckInputsOutputsValue)4912": { - "label": "contract Groth16Verifier_CheckInputsOutputsValue", - "numberOfBytes": "20" - }, - "t_contract(IERC20)3304": { - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_enum(UTXOStatus)5064": { - "label": "enum ZetoBase.UTXOStatus", - "members": [ - "UNKNOWN", - "UNSPENT", - "SPENT" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_enum(UTXOStatus)5064)": { - "label": "mapping(uint256 => enum ZetoBase.UTXOStatus)", - "numberOfBytes": "32" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - }, - "31fd9e229f4302a5969e7fa1d78403d954c6792cdeeb0b8414ceb2b083eaf81c": { - "address": "0x66Cc1f498D972Ec2C787a24ffe14f28e0Ee60917", - "txHash": "0x885004ea49db032822333a65514a5112a685c44e483630ef5f01d0e8582936f8", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_commitmentsTree", - "offset": 0, - "slot": "1", - "type": "t_struct(Data)402_storage", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:31" - }, - { - "label": "_nullifiers", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_uint256,t_bool)", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:33" - }, - { - "label": "depositVerifier", - "offset": 0, - "slot": "52", - "type": "t_contract(Groth16Verifier_CheckHashesValue)4797", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:31" - }, - { - "label": "erc20", - "offset": 0, - "slot": "53", - "type": "t_contract(IERC20)3304", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:33" - }, - { - "label": "withdrawVerifier", - "offset": 0, - "slot": "54", - "type": "t_contract(Groth16Verifier_CheckNullifierValue)5045", - "contract": "ZetoFungibleWithdrawWithNullifiers", - "src": "contracts/lib/zeto_fungible_withdraw_nullifier.sol:32" - }, - { - "label": "verifier", - "offset": 0, - "slot": "55", - "type": "t_contract(Groth16Verifier_AnonEncNullifierNonRepudiation)4694", - "contract": "Zeto_AnonEncNullifierNonRepudiation", - "src": "contracts/zeto_anon_enc_nullifier_non_repudiation.sol:51" - }, - { - "label": "arbiter", - "offset": 0, - "slot": "56", - "type": "t_array(t_uint256)2_storage", - "contract": "Zeto_AnonEncNullifierNonRepudiation", - "src": "contracts/zeto_anon_enc_nullifier_non_repudiation.sol:54" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_array(t_struct(RootEntry)429_storage)dyn_storage": { - "label": "struct SmtLib.RootEntry[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)2_storage": { - "label": "uint256[2]", - "numberOfBytes": "64" - }, - "t_array(t_uint256)45_storage": { - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)dyn_storage": { - "label": "uint256[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_AnonEncNullifierNonRepudiation)4694": { - "label": "contract Groth16Verifier_AnonEncNullifierNonRepudiation", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckHashesValue)4797": { - "label": "contract Groth16Verifier_CheckHashesValue", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckNullifierValue)5045": { - "label": "contract Groth16Verifier_CheckNullifierValue", - "numberOfBytes": "20" - }, - "t_contract(IERC20)3304": { - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_enum(NodeType)378": { - "label": "enum SmtLib.NodeType", - "members": [ - "EMPTY", - "LEAF", - "MIDDLE" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { - "label": "mapping(uint256 => uint256[])", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_bool)": { - "label": "mapping(uint256 => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_struct(Node)456_storage)": { - "label": "mapping(uint256 => struct SmtLib.Node)", - "numberOfBytes": "32" - }, - "t_struct(Data)402_storage": { - "label": "struct SmtLib.Data", - "members": [ - { - "label": "nodes", - "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", - "offset": 0, - "slot": "0" - }, - { - "label": "rootEntries", - "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", - "offset": 0, - "slot": "1" - }, - { - "label": "rootIndexes", - "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", - "offset": 0, - "slot": "2" - }, - { - "label": "maxDepth", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "initialized", - "type": "t_bool", - "offset": 0, - "slot": "4" - }, - { - "label": "__gap", - "type": "t_array(t_uint256)45_storage", - "offset": 0, - "slot": "5" - } - ], - "numberOfBytes": "1600" - }, - "t_struct(Node)456_storage": { - "label": "struct SmtLib.Node", - "members": [ - { - "label": "nodeType", - "type": "t_enum(NodeType)378", - "offset": 0, - "slot": "0" - }, - { - "label": "childLeft", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "childRight", - "type": "t_uint256", - "offset": 0, - "slot": "2" - }, - { - "label": "index", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "value", - "type": "t_uint256", - "offset": 0, - "slot": "4" - } - ], - "numberOfBytes": "160" - }, - "t_struct(RootEntry)429_storage": { - "label": "struct SmtLib.RootEntry", - "members": [ - { - "label": "root", - "type": "t_uint256", - "offset": 0, - "slot": "0" - }, - { - "label": "createdAtTimestamp", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "createdAtBlock", - "type": "t_uint256", - "offset": 0, - "slot": "2" - } - ], - "numberOfBytes": "96" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - } - } -} diff --git a/solidity/.openzeppelin/unknown-80002.json b/solidity/.openzeppelin/unknown-80002.json deleted file mode 100644 index 0c7a500..0000000 --- a/solidity/.openzeppelin/unknown-80002.json +++ /dev/null @@ -1,2245 +0,0 @@ -{ - "manifestVersion": "3.2", - "proxies": [ - { - "address": "0x06aEF0D58799B1Ad153268938C7cF32A8Ba4C88a", - "txHash": "0xff5a66b1dc2662580c3c329161ac06b150166af3fc91b78745e68323792ad33a", - "kind": "uups" - }, - { - "address": "0xb98AACd711077640b9795A16AC4B31fbb6D66321", - "txHash": "0xe128eba150539aac7d710c4deb5fa4a8528d70fd2a7ff4daf64d2f53755472ef", - "kind": "uups" - }, - { - "address": "0x9e22DCf8D020D97abc7Db6BDcF1eCbAa49853276", - "txHash": "0x250dc060159586ca652e62637f08479f74e1b1c051a77d4cb4c7aabb663468e5", - "kind": "uups" - }, - { - "address": "0x22b38d8E7B626c645db33c3D8d261C0658caD86B", - "txHash": "0x590237cc8a9872ed8a3429a81dca64430725b8fa128cca16403a0510b2849d6c", - "kind": "uups" - }, - { - "address": "0x23f7e5B8Da26052eB47841154579b9f9d8058d8F", - "txHash": "0xb597f1a10dca3e6bd38b5982817805bcba57ae214ec219031885fe212d33a822", - "kind": "uups" - }, - { - "address": "0x3cA36a4c7f5EDd213abAF03Bc59a6C000d86ed63", - "txHash": "0xbfa69b1be8a292613902cba2fe47f790401ed6c8c05ebb1d47d0852c9a30b2ac", - "kind": "uups" - }, - { - "address": "0x038916B5E6Dd0A5f902c06374cF2c3Cb11ba0955", - "txHash": "0xae819227c29b10b7c1f2a15c307572baefdc76deb83793fbf1a71a9e7d6694cc", - "kind": "uups" - }, - { - "address": "0x20F4a08286f1ecD5561862e3e962074979fc8195", - "txHash": "0xffb3804142941625d59f05fa3cbfd6847ed3b49404c273e52e41e33393f588f4", - "kind": "uups" - }, - { - "address": "0x1cEa9581fe5DfF15a4a8E34Ac456A8090424C75d", - "txHash": "0xf067d4c7c98ab4d1a30f6e122f466f4f30548c2061ea948186257f3235c6a379", - "kind": "uups" - }, - { - "address": "0xCd04fB366830439d50D422A4439D455F83FDEb25", - "txHash": "0x9d47029fb685e4be2e51967b2eb3aca5fc86de47c85a106f1e16a937afdfd12e", - "kind": "uups" - }, - { - "address": "0xf11ADf0865a2f18Ee132c7aC060E9657da187A6d", - "txHash": "0x6196e6052059911f3e1b2b60fa978b2d6a5bfb7a5e93ea19f0fbbb7205cfdb5c", - "kind": "uups" - }, - { - "address": "0x6b50360040fCC90661D74912d9f8edba951E2389", - "txHash": "0x3002ea6895577c2efd5a2c354d4707db3b94e396d3d07f4b8d6ef7558993f0bd", - "kind": "uups" - }, - { - "address": "0xCf2Bc469CC2F57220e49921F1F314F28bD35a9D5", - "txHash": "0xb84de947ab39421dd9430181eb1a604805c2fe0ee380bf64abcc9664e963bdbe", - "kind": "uups" - }, - { - "address": "0x960cAAEB3cC772A7e73da5b4d42F843154D40058", - "txHash": "0x418ccc7f9871c0274b01de9df38aaec4fa080f78da55555e627c79e4ac0fce3b", - "kind": "uups" - }, - { - "address": "0x6D3524ED0d59De124f1601beDFe843f022439cB5", - "txHash": "0x3287f9126a9950f8801a60ba0e3d6d76ea8fede05edb1e0dd1f09dfb761df073", - "kind": "uups" - }, - { - "address": "0xe77d135cee739AAC1Fa992E4710bb8DdB8DeB18b", - "txHash": "0x39ca830c79b9f5ab102d7865af0c6f2a5397a6cc3f904123a23c4d1b9b554ff0", - "kind": "uups" - }, - { - "address": "0xF93F7D7cA3D4eF8b1984A5100d816288A6362825", - "txHash": "0x2b939907076334d00c8f78887ad3e452baacb80e426103dceae90c69aa9e03b8", - "kind": "uups" - }, - { - "address": "0x0f77445fD4CFdeD1947656C68a2143CF10Ca3e07", - "txHash": "0x084b1f4dfc233f7d58ef7d2e4511f7c20cc9bb5bf67d44c099a322ac283ef973", - "kind": "uups" - } - ], - "impls": { - "d1f8a292f5a7ed6e35483f0f170b39434ed5090fa54bfaeaec7a5e097529e8e2": { - "address": "0xb847436394418DF05406949A4ebBdc6148Be5EB1", - "txHash": "0x787d50e2a771e0f152598befe26764951c008182da2d03eac3c05d1d153af03c", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_utxos", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_enum(UTXOStatus)6682)", - "contract": "ZetoBase", - "src": "contracts/lib/zeto_base.sol:36" - }, - { - "label": "depositVerifier", - "offset": 0, - "slot": "2", - "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:31" - }, - { - "label": "erc20", - "offset": 0, - "slot": "3", - "type": "t_contract(IERC20)4041", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:33" - }, - { - "label": "withdrawVerifier", - "offset": 0, - "slot": "4", - "type": "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318", - "contract": "ZetoFungibleWithdraw", - "src": "contracts/lib/zeto_fungible_withdraw.sol:31" - }, - { - "label": "verifier", - "offset": 0, - "slot": "5", - "type": "t_contract(Groth16Verifier_Anon)5249", - "contract": "Zeto_Anon", - "src": "contracts/zeto_anon.sol:38" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_Anon)5249": { - "label": "contract Groth16Verifier_Anon", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckHashesValue)6203": { - "label": "contract Groth16Verifier_CheckHashesValue", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318": { - "label": "contract Groth16Verifier_CheckInputsOutputsValue", - "numberOfBytes": "20" - }, - "t_contract(IERC20)4041": { - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_enum(UTXOStatus)6682": { - "label": "enum ZetoBase.UTXOStatus", - "members": [ - "UNKNOWN", - "UNSPENT", - "SPENT" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_enum(UTXOStatus)6682)": { - "label": "mapping(uint256 => enum ZetoBase.UTXOStatus)", - "numberOfBytes": "32" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - }, - "6616fb519a5bacf608d6e6cd1ab224306ff18371d36f2ed116c80df3cd212caf": { - "address": "0x800B0C29A58efA7A2e2d53f4DA9461943A83501c", - "txHash": "0xa04e3253b082265f1e4c11e61fb10e9b35d7799e9a591fb61d9891199b40aa32", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_utxos", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_enum(UTXOStatus)6682)", - "contract": "ZetoBase", - "src": "contracts/lib/zeto_base.sol:36" - }, - { - "label": "depositVerifier", - "offset": 0, - "slot": "2", - "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:31" - }, - { - "label": "erc20", - "offset": 0, - "slot": "3", - "type": "t_contract(IERC20)4041", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:33" - }, - { - "label": "withdrawVerifier", - "offset": 0, - "slot": "4", - "type": "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318", - "contract": "ZetoFungibleWithdraw", - "src": "contracts/lib/zeto_fungible_withdraw.sol:31" - }, - { - "label": "verifier", - "offset": 0, - "slot": "5", - "type": "t_contract(Groth16Verifier_AnonEnc)5394", - "contract": "Zeto_AnonEnc", - "src": "contracts/zeto_anon_enc.sol:40" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_AnonEnc)5394": { - "label": "contract Groth16Verifier_AnonEnc", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckHashesValue)6203": { - "label": "contract Groth16Verifier_CheckHashesValue", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckInputsOutputsValue)6318": { - "label": "contract Groth16Verifier_CheckInputsOutputsValue", - "numberOfBytes": "20" - }, - "t_contract(IERC20)4041": { - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_enum(UTXOStatus)6682": { - "label": "enum ZetoBase.UTXOStatus", - "members": [ - "UNKNOWN", - "UNSPENT", - "SPENT" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_enum(UTXOStatus)6682)": { - "label": "mapping(uint256 => enum ZetoBase.UTXOStatus)", - "numberOfBytes": "32" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - }, - "dbd37499cacb81d5cfa9721c9f68dca8084a7ef482b73e7020f6f876855744c1": { - "address": "0xC94190c28A442069d7A1900d78Cd379E562cce48", - "txHash": "0x3fcdc80add70ef07734348aa47d1f0d05116881eaeb7e29d9899940571304194", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_commitmentsTree", - "offset": 0, - "slot": "1", - "type": "t_struct(Data)402_storage", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:31" - }, - { - "label": "_nullifiers", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_uint256,t_bool)", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:33" - }, - { - "label": "depositVerifier", - "offset": 0, - "slot": "52", - "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:31" - }, - { - "label": "erc20", - "offset": 0, - "slot": "53", - "type": "t_contract(IERC20)4041", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:33" - }, - { - "label": "withdrawVerifier", - "offset": 0, - "slot": "54", - "type": "t_contract(Groth16Verifier_CheckNullifierValue)6451", - "contract": "ZetoFungibleWithdrawWithNullifiers", - "src": "contracts/lib/zeto_fungible_withdraw_nullifier.sol:32" - }, - { - "label": "verifier", - "offset": 0, - "slot": "55", - "type": "t_contract(Groth16Verifier_AnonNullifier)5961", - "contract": "Zeto_AnonNullifier", - "src": "contracts/zeto_anon_nullifier.sol:46" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_array(t_struct(RootEntry)429_storage)dyn_storage": { - "label": "struct SmtLib.RootEntry[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)45_storage": { - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)dyn_storage": { - "label": "uint256[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_AnonNullifier)5961": { - "label": "contract Groth16Verifier_AnonNullifier", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckHashesValue)6203": { - "label": "contract Groth16Verifier_CheckHashesValue", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckNullifierValue)6451": { - "label": "contract Groth16Verifier_CheckNullifierValue", - "numberOfBytes": "20" - }, - "t_contract(IERC20)4041": { - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_enum(NodeType)378": { - "label": "enum SmtLib.NodeType", - "members": [ - "EMPTY", - "LEAF", - "MIDDLE" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { - "label": "mapping(uint256 => uint256[])", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_bool)": { - "label": "mapping(uint256 => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_struct(Node)456_storage)": { - "label": "mapping(uint256 => struct SmtLib.Node)", - "numberOfBytes": "32" - }, - "t_struct(Data)402_storage": { - "label": "struct SmtLib.Data", - "members": [ - { - "label": "nodes", - "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", - "offset": 0, - "slot": "0" - }, - { - "label": "rootEntries", - "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", - "offset": 0, - "slot": "1" - }, - { - "label": "rootIndexes", - "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", - "offset": 0, - "slot": "2" - }, - { - "label": "maxDepth", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "initialized", - "type": "t_bool", - "offset": 0, - "slot": "4" - }, - { - "label": "__gap", - "type": "t_array(t_uint256)45_storage", - "offset": 0, - "slot": "5" - } - ], - "numberOfBytes": "1600" - }, - "t_struct(Node)456_storage": { - "label": "struct SmtLib.Node", - "members": [ - { - "label": "nodeType", - "type": "t_enum(NodeType)378", - "offset": 0, - "slot": "0" - }, - { - "label": "childLeft", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "childRight", - "type": "t_uint256", - "offset": 0, - "slot": "2" - }, - { - "label": "index", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "value", - "type": "t_uint256", - "offset": 0, - "slot": "4" - } - ], - "numberOfBytes": "160" - }, - "t_struct(RootEntry)429_storage": { - "label": "struct SmtLib.RootEntry", - "members": [ - { - "label": "root", - "type": "t_uint256", - "offset": 0, - "slot": "0" - }, - { - "label": "createdAtTimestamp", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "createdAtBlock", - "type": "t_uint256", - "offset": 0, - "slot": "2" - } - ], - "numberOfBytes": "96" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - }, - "059994426b39217c4f62861f1056e9b51d4df785d0172cd9b8d94b7d2624ab5d": { - "address": "0x625aFFb57723192599EFD025bBfD0492382Bb300", - "txHash": "0x4e91cf17be11d5bdf1e4f5bb28ce55739e4672c02db886a41570f7a4ecfc268d", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_commitmentsTree", - "offset": 0, - "slot": "1", - "type": "t_struct(Data)402_storage", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:31" - }, - { - "label": "_nullifiers", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_uint256,t_bool)", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:33" - }, - { - "label": "depositVerifier", - "offset": 0, - "slot": "52", - "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:31" - }, - { - "label": "erc20", - "offset": 0, - "slot": "53", - "type": "t_contract(IERC20)4041", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:33" - }, - { - "label": "withdrawVerifier", - "offset": 0, - "slot": "54", - "type": "t_contract(Groth16Verifier_CheckNullifierValue)6451", - "contract": "ZetoFungibleWithdrawWithNullifiers", - "src": "contracts/lib/zeto_fungible_withdraw_nullifier.sol:32" - }, - { - "label": "verifier", - "offset": 0, - "slot": "55", - "type": "t_contract(Groth16Verifier_AnonEncNullifier)5557", - "contract": "Zeto_AnonEncNullifier", - "src": "contracts/zeto_anon_enc_nullifier.sol:42" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_array(t_struct(RootEntry)429_storage)dyn_storage": { - "label": "struct SmtLib.RootEntry[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)45_storage": { - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)dyn_storage": { - "label": "uint256[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_AnonEncNullifier)5557": { - "label": "contract Groth16Verifier_AnonEncNullifier", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckHashesValue)6203": { - "label": "contract Groth16Verifier_CheckHashesValue", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckNullifierValue)6451": { - "label": "contract Groth16Verifier_CheckNullifierValue", - "numberOfBytes": "20" - }, - "t_contract(IERC20)4041": { - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_enum(NodeType)378": { - "label": "enum SmtLib.NodeType", - "members": [ - "EMPTY", - "LEAF", - "MIDDLE" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { - "label": "mapping(uint256 => uint256[])", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_bool)": { - "label": "mapping(uint256 => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_struct(Node)456_storage)": { - "label": "mapping(uint256 => struct SmtLib.Node)", - "numberOfBytes": "32" - }, - "t_struct(Data)402_storage": { - "label": "struct SmtLib.Data", - "members": [ - { - "label": "nodes", - "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", - "offset": 0, - "slot": "0" - }, - { - "label": "rootEntries", - "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", - "offset": 0, - "slot": "1" - }, - { - "label": "rootIndexes", - "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", - "offset": 0, - "slot": "2" - }, - { - "label": "maxDepth", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "initialized", - "type": "t_bool", - "offset": 0, - "slot": "4" - }, - { - "label": "__gap", - "type": "t_array(t_uint256)45_storage", - "offset": 0, - "slot": "5" - } - ], - "numberOfBytes": "1600" - }, - "t_struct(Node)456_storage": { - "label": "struct SmtLib.Node", - "members": [ - { - "label": "nodeType", - "type": "t_enum(NodeType)378", - "offset": 0, - "slot": "0" - }, - { - "label": "childLeft", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "childRight", - "type": "t_uint256", - "offset": 0, - "slot": "2" - }, - { - "label": "index", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "value", - "type": "t_uint256", - "offset": 0, - "slot": "4" - } - ], - "numberOfBytes": "160" - }, - "t_struct(RootEntry)429_storage": { - "label": "struct SmtLib.RootEntry", - "members": [ - { - "label": "root", - "type": "t_uint256", - "offset": 0, - "slot": "0" - }, - { - "label": "createdAtTimestamp", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "createdAtBlock", - "type": "t_uint256", - "offset": 0, - "slot": "2" - } - ], - "numberOfBytes": "96" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - }, - "e5b45452ea2cd1bbb89427d7270275d63cc4d4519d426765853e84facd9d11d2": { - "address": "0x77F070a1ae3D9208A95F889a819f45F82ef406b6", - "txHash": "0xcca346f680ce2d41d35b54a5ce57d1a03558692ec1834e621cfecc3fe7040a47", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_commitmentsTree", - "offset": 0, - "slot": "1", - "type": "t_struct(Data)402_storage", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:31" - }, - { - "label": "_nullifiers", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_uint256,t_bool)", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:33" - }, - { - "label": "depositVerifier", - "offset": 0, - "slot": "52", - "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:31" - }, - { - "label": "erc20", - "offset": 0, - "slot": "53", - "type": "t_contract(IERC20)4041", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:33" - }, - { - "label": "withdrawVerifier", - "offset": 0, - "slot": "54", - "type": "t_contract(Groth16Verifier_CheckNullifierValue)6451", - "contract": "ZetoFungibleWithdrawWithNullifiers", - "src": "contracts/lib/zeto_fungible_withdraw_nullifier.sol:32" - }, - { - "label": "verifier", - "offset": 0, - "slot": "55", - "type": "t_contract(Groth16Verifier_AnonEncNullifierNonRepudiation)5828", - "contract": "Zeto_AnonEncNullifierNonRepudiation", - "src": "contracts/zeto_anon_enc_nullifier_non_repudiation.sol:51" - }, - { - "label": "arbiter", - "offset": 0, - "slot": "56", - "type": "t_array(t_uint256)2_storage", - "contract": "Zeto_AnonEncNullifierNonRepudiation", - "src": "contracts/zeto_anon_enc_nullifier_non_repudiation.sol:54" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_array(t_struct(RootEntry)429_storage)dyn_storage": { - "label": "struct SmtLib.RootEntry[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)2_storage": { - "label": "uint256[2]", - "numberOfBytes": "64" - }, - "t_array(t_uint256)45_storage": { - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)dyn_storage": { - "label": "uint256[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_AnonEncNullifierNonRepudiation)5828": { - "label": "contract Groth16Verifier_AnonEncNullifierNonRepudiation", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckHashesValue)6203": { - "label": "contract Groth16Verifier_CheckHashesValue", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckNullifierValue)6451": { - "label": "contract Groth16Verifier_CheckNullifierValue", - "numberOfBytes": "20" - }, - "t_contract(IERC20)4041": { - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_enum(NodeType)378": { - "label": "enum SmtLib.NodeType", - "members": [ - "EMPTY", - "LEAF", - "MIDDLE" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { - "label": "mapping(uint256 => uint256[])", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_bool)": { - "label": "mapping(uint256 => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_struct(Node)456_storage)": { - "label": "mapping(uint256 => struct SmtLib.Node)", - "numberOfBytes": "32" - }, - "t_struct(Data)402_storage": { - "label": "struct SmtLib.Data", - "members": [ - { - "label": "nodes", - "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", - "offset": 0, - "slot": "0" - }, - { - "label": "rootEntries", - "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", - "offset": 0, - "slot": "1" - }, - { - "label": "rootIndexes", - "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", - "offset": 0, - "slot": "2" - }, - { - "label": "maxDepth", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "initialized", - "type": "t_bool", - "offset": 0, - "slot": "4" - }, - { - "label": "__gap", - "type": "t_array(t_uint256)45_storage", - "offset": 0, - "slot": "5" - } - ], - "numberOfBytes": "1600" - }, - "t_struct(Node)456_storage": { - "label": "struct SmtLib.Node", - "members": [ - { - "label": "nodeType", - "type": "t_enum(NodeType)378", - "offset": 0, - "slot": "0" - }, - { - "label": "childLeft", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "childRight", - "type": "t_uint256", - "offset": 0, - "slot": "2" - }, - { - "label": "index", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "value", - "type": "t_uint256", - "offset": 0, - "slot": "4" - } - ], - "numberOfBytes": "160" - }, - "t_struct(RootEntry)429_storage": { - "label": "struct SmtLib.RootEntry", - "members": [ - { - "label": "root", - "type": "t_uint256", - "offset": 0, - "slot": "0" - }, - { - "label": "createdAtTimestamp", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "createdAtBlock", - "type": "t_uint256", - "offset": 0, - "slot": "2" - } - ], - "numberOfBytes": "96" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - }, - "159105749ed78f6656dc0644309eea7afd0d70970e4e963f5be8f3a5870fbac7": { - "address": "0x59FdC29dC8387fAe8BFFE185b8A9c9BA0eB77Da3", - "txHash": "0xc9ad6b5fdd875c6ca7a6ec6f19192e5be19b25746d81e57e189ca433d11371ae", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_commitmentsTree", - "offset": 0, - "slot": "1", - "type": "t_struct(Data)402_storage", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:31" - }, - { - "label": "_nullifiers", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_uint256,t_bool)", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:33" - }, - { - "label": "depositVerifier", - "offset": 0, - "slot": "52", - "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:31" - }, - { - "label": "erc20", - "offset": 0, - "slot": "53", - "type": "t_contract(IERC20)4041", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:33" - }, - { - "label": "withdrawVerifier", - "offset": 0, - "slot": "54", - "type": "t_contract(Groth16Verifier_CheckNullifierValue)6451", - "contract": "ZetoFungibleWithdrawWithNullifiers", - "src": "contracts/lib/zeto_fungible_withdraw_nullifier.sol:32" - }, - { - "label": "_publicKeysTree", - "offset": 0, - "slot": "55", - "type": "t_struct(Data)402_storage", - "contract": "Registry", - "src": "contracts/lib/registry.sol:33" - }, - { - "label": "verifier", - "offset": 0, - "slot": "105", - "type": "t_contract(Groth16Verifier_AnonNullifierKyc)6100", - "contract": "Zeto_AnonNullifierKyc", - "src": "contracts/zeto_anon_nullifier_kyc.sol:47" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_array(t_struct(RootEntry)429_storage)dyn_storage": { - "label": "struct SmtLib.RootEntry[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)45_storage": { - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)dyn_storage": { - "label": "uint256[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_AnonNullifierKyc)6100": { - "label": "contract Groth16Verifier_AnonNullifierKyc", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckHashesValue)6203": { - "label": "contract Groth16Verifier_CheckHashesValue", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckNullifierValue)6451": { - "label": "contract Groth16Verifier_CheckNullifierValue", - "numberOfBytes": "20" - }, - "t_contract(IERC20)4041": { - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_enum(NodeType)378": { - "label": "enum SmtLib.NodeType", - "members": [ - "EMPTY", - "LEAF", - "MIDDLE" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { - "label": "mapping(uint256 => uint256[])", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_bool)": { - "label": "mapping(uint256 => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_struct(Node)456_storage)": { - "label": "mapping(uint256 => struct SmtLib.Node)", - "numberOfBytes": "32" - }, - "t_struct(Data)402_storage": { - "label": "struct SmtLib.Data", - "members": [ - { - "label": "nodes", - "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", - "offset": 0, - "slot": "0" - }, - { - "label": "rootEntries", - "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", - "offset": 0, - "slot": "1" - }, - { - "label": "rootIndexes", - "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", - "offset": 0, - "slot": "2" - }, - { - "label": "maxDepth", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "initialized", - "type": "t_bool", - "offset": 0, - "slot": "4" - }, - { - "label": "__gap", - "type": "t_array(t_uint256)45_storage", - "offset": 0, - "slot": "5" - } - ], - "numberOfBytes": "1600" - }, - "t_struct(Node)456_storage": { - "label": "struct SmtLib.Node", - "members": [ - { - "label": "nodeType", - "type": "t_enum(NodeType)378", - "offset": 0, - "slot": "0" - }, - { - "label": "childLeft", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "childRight", - "type": "t_uint256", - "offset": 0, - "slot": "2" - }, - { - "label": "index", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "value", - "type": "t_uint256", - "offset": 0, - "slot": "4" - } - ], - "numberOfBytes": "160" - }, - "t_struct(RootEntry)429_storage": { - "label": "struct SmtLib.RootEntry", - "members": [ - { - "label": "root", - "type": "t_uint256", - "offset": 0, - "slot": "0" - }, - { - "label": "createdAtTimestamp", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "createdAtBlock", - "type": "t_uint256", - "offset": 0, - "slot": "2" - } - ], - "numberOfBytes": "96" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - }, - "dd9d43aaa857387431e896435e3e161a9e1da817a46a8d56fa3a0d08c6da0f2c": { - "address": "0xe3D7501A8d10d1029976ee24E7082D273bbCd6C1", - "txHash": "0x747cf1de08143a6a452ad4fca2290a629ed7065e9fbdcb87512be6ef4ad96ea9", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_commitmentsTree", - "offset": 0, - "slot": "1", - "type": "t_struct(Data)402_storage", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:31" - }, - { - "label": "_nullifiers", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_uint256,t_bool)", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:33" - }, - { - "label": "depositVerifier", - "offset": 0, - "slot": "52", - "type": "t_contract(Groth16Verifier_CheckHashesValue)6203", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:31" - }, - { - "label": "erc20", - "offset": 0, - "slot": "53", - "type": "t_contract(IERC20)4041", - "contract": "ZetoFungible", - "src": "contracts/lib/zeto_fungible.sol:33" - }, - { - "label": "withdrawVerifier", - "offset": 0, - "slot": "54", - "type": "t_contract(Groth16Verifier_CheckNullifierValue)6451", - "contract": "ZetoFungibleWithdrawWithNullifiers", - "src": "contracts/lib/zeto_fungible_withdraw_nullifier.sol:32" - }, - { - "label": "_publicKeysTree", - "offset": 0, - "slot": "55", - "type": "t_struct(Data)402_storage", - "contract": "Registry", - "src": "contracts/lib/registry.sol:33" - }, - { - "label": "verifier", - "offset": 0, - "slot": "105", - "type": "t_contract(Groth16Verifier_AnonNullifierKyc)6100", - "contract": "Zeto_AnonNullifierKyc", - "src": "contracts/zeto_anon_nullifier_kyc.sol:47" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_array(t_struct(RootEntry)429_storage)dyn_storage": { - "label": "struct SmtLib.RootEntry[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)45_storage": { - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)dyn_storage": { - "label": "uint256[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_AnonNullifierKyc)6100": { - "label": "contract Groth16Verifier_AnonNullifierKyc", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckHashesValue)6203": { - "label": "contract Groth16Verifier_CheckHashesValue", - "numberOfBytes": "20" - }, - "t_contract(Groth16Verifier_CheckNullifierValue)6451": { - "label": "contract Groth16Verifier_CheckNullifierValue", - "numberOfBytes": "20" - }, - "t_contract(IERC20)4041": { - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_enum(NodeType)378": { - "label": "enum SmtLib.NodeType", - "members": [ - "EMPTY", - "LEAF", - "MIDDLE" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { - "label": "mapping(uint256 => uint256[])", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_bool)": { - "label": "mapping(uint256 => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_struct(Node)456_storage)": { - "label": "mapping(uint256 => struct SmtLib.Node)", - "numberOfBytes": "32" - }, - "t_struct(Data)402_storage": { - "label": "struct SmtLib.Data", - "members": [ - { - "label": "nodes", - "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", - "offset": 0, - "slot": "0" - }, - { - "label": "rootEntries", - "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", - "offset": 0, - "slot": "1" - }, - { - "label": "rootIndexes", - "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", - "offset": 0, - "slot": "2" - }, - { - "label": "maxDepth", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "initialized", - "type": "t_bool", - "offset": 0, - "slot": "4" - }, - { - "label": "__gap", - "type": "t_array(t_uint256)45_storage", - "offset": 0, - "slot": "5" - } - ], - "numberOfBytes": "1600" - }, - "t_struct(Node)456_storage": { - "label": "struct SmtLib.Node", - "members": [ - { - "label": "nodeType", - "type": "t_enum(NodeType)378", - "offset": 0, - "slot": "0" - }, - { - "label": "childLeft", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "childRight", - "type": "t_uint256", - "offset": 0, - "slot": "2" - }, - { - "label": "index", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "value", - "type": "t_uint256", - "offset": 0, - "slot": "4" - } - ], - "numberOfBytes": "160" - }, - "t_struct(RootEntry)429_storage": { - "label": "struct SmtLib.RootEntry", - "members": [ - { - "label": "root", - "type": "t_uint256", - "offset": 0, - "slot": "0" - }, - { - "label": "createdAtTimestamp", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "createdAtBlock", - "type": "t_uint256", - "offset": 0, - "slot": "2" - } - ], - "numberOfBytes": "96" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - }, - "62e5095beb8b073eaac406d1e2deaf2ca025949018ad99acded252a8b01f744b": { - "address": "0xfc65fa598D58AAf95051a7E05eC6617A7D720796", - "txHash": "0x83b747fd71c95ee0bc85ab0766cc0c5bf4633e6d45ff7c007b2940010e9d5a2e", - "layout": { - "solcVersion": "0.8.20", - "storage": [ - { - "label": "lockedProofs", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZetoCommon", - "src": "contracts/lib/zeto_common.sol:53" - }, - { - "label": "_commitmentsTree", - "offset": 0, - "slot": "1", - "type": "t_struct(Data)402_storage", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:31" - }, - { - "label": "_nullifiers", - "offset": 0, - "slot": "51", - "type": "t_mapping(t_uint256,t_bool)", - "contract": "ZetoNullifier", - "src": "contracts/lib/zeto_nullifier.sol:33" - }, - { - "label": "verifier", - "offset": 0, - "slot": "52", - "type": "t_contract(Groth16Verifier_NfAnonNullifier)6663", - "contract": "Zeto_NfAnonNullifier", - "src": "contracts/zeto_nf_anon_nullifier.sol:39" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_struct(InitializableStorage)687_storage": { - "label": "struct Initializable.InitializableStorage", - "members": [ - { - "label": "_initialized", - "type": "t_uint64", - "offset": 0, - "slot": "0" - }, - { - "label": "_initializing", - "type": "t_bool", - "offset": 8, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(OwnableStorage)620_storage": { - "label": "struct OwnableUpgradeable.OwnableStorage", - "members": [ - { - "label": "_owner", - "type": "t_address", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint64": { - "label": "uint64", - "numberOfBytes": "8" - }, - "t_array(t_struct(RootEntry)429_storage)dyn_storage": { - "label": "struct SmtLib.RootEntry[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)45_storage": { - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)dyn_storage": { - "label": "uint256[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(Groth16Verifier_NfAnonNullifier)6663": { - "label": "contract Groth16Verifier_NfAnonNullifier", - "numberOfBytes": "20" - }, - "t_enum(NodeType)378": { - "label": "enum SmtLib.NodeType", - "members": [ - "EMPTY", - "LEAF", - "MIDDLE" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)": { - "label": "mapping(uint256 => uint256[])", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_bool)": { - "label": "mapping(uint256 => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_struct(Node)456_storage)": { - "label": "mapping(uint256 => struct SmtLib.Node)", - "numberOfBytes": "32" - }, - "t_struct(Data)402_storage": { - "label": "struct SmtLib.Data", - "members": [ - { - "label": "nodes", - "type": "t_mapping(t_uint256,t_struct(Node)456_storage)", - "offset": 0, - "slot": "0" - }, - { - "label": "rootEntries", - "type": "t_array(t_struct(RootEntry)429_storage)dyn_storage", - "offset": 0, - "slot": "1" - }, - { - "label": "rootIndexes", - "type": "t_mapping(t_uint256,t_array(t_uint256)dyn_storage)", - "offset": 0, - "slot": "2" - }, - { - "label": "maxDepth", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "initialized", - "type": "t_bool", - "offset": 0, - "slot": "4" - }, - { - "label": "__gap", - "type": "t_array(t_uint256)45_storage", - "offset": 0, - "slot": "5" - } - ], - "numberOfBytes": "1600" - }, - "t_struct(Node)456_storage": { - "label": "struct SmtLib.Node", - "members": [ - { - "label": "nodeType", - "type": "t_enum(NodeType)378", - "offset": 0, - "slot": "0" - }, - { - "label": "childLeft", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "childRight", - "type": "t_uint256", - "offset": 0, - "slot": "2" - }, - { - "label": "index", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "value", - "type": "t_uint256", - "offset": 0, - "slot": "4" - } - ], - "numberOfBytes": "160" - }, - "t_struct(RootEntry)429_storage": { - "label": "struct SmtLib.RootEntry", - "members": [ - { - "label": "root", - "type": "t_uint256", - "offset": 0, - "slot": "0" - }, - { - "label": "createdAtTimestamp", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "createdAtBlock", - "type": "t_uint256", - "offset": 0, - "slot": "2" - } - ], - "numberOfBytes": "96" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - } - }, - "namespaces": { - "erc7201:openzeppelin.storage.Ownable": [ - { - "contract": "OwnableUpgradeable", - "label": "_owner", - "type": "t_address", - "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", - "offset": 0, - "slot": "0" - } - ], - "erc7201:openzeppelin.storage.Initializable": [ - { - "contract": "Initializable", - "label": "_initialized", - "type": "t_uint64", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", - "offset": 0, - "slot": "0" - }, - { - "contract": "Initializable", - "label": "_initializing", - "type": "t_bool", - "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", - "offset": 8, - "slot": "0" - } - ] - } - } - } - } -} From f8b7cc90bbb06f6ae49ce9d2d54e1a9ba96cdda5 Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Tue, 27 Aug 2024 11:59:26 -0400 Subject: [PATCH 8/8] calculate balance differences Signed-off-by: Jim Zhang --- solidity/test/zeto_anon.ts | 11 +++++++---- solidity/test/zeto_anon_enc.ts | 10 ++++++---- solidity/test/zeto_anon_enc_nullifier.ts | 11 +++++++---- .../zeto_anon_enc_nullifier_non_repudiation.ts | 10 ++++++---- solidity/test/zeto_anon_nullifier.ts | 11 +++++++---- solidity/test/zeto_anon_nullifier_kyc.ts | 15 +++++++++------ 6 files changed, 42 insertions(+), 26 deletions(-) diff --git a/solidity/test/zeto_anon.ts b/solidity/test/zeto_anon.ts index 425abed..8d26543 100644 --- a/solidity/test/zeto_anon.ts +++ b/solidity/test/zeto_anon.ts @@ -61,10 +61,11 @@ describe("Zeto based fungible token with anonymity without encryption or nullifi }); it("mint ERC20 tokens to Alice to deposit to Zeto should succeed", async function () { + const startingBalance = await erc20.balanceOf(Alice.ethAddress); const tx = await erc20.connect(deployer).mint(Alice.ethAddress, 100); await tx.wait(); - const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.be.gte(100); + const endingBalance = await erc20.balanceOf(Alice.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(100); const tx1 = await erc20.connect(Alice.signer).approve(zeto.target, 100); await tx1.wait(); @@ -117,6 +118,8 @@ describe("Zeto based fungible token with anonymity without encryption or nullifi }); it("Alice withdraws her UTXOs to ERC20 tokens should succeed", async function () { + const startingBalance = await erc20.balanceOf(Alice.ethAddress); + // Alice proposes the output ERC20 tokens const outputCommitment = newUTXO(20, Alice); @@ -127,8 +130,8 @@ describe("Zeto based fungible token with anonymity without encryption or nullifi await tx.wait(); // Alice checks her ERC20 balance - const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.be.gte(80); + const endingBalance = await erc20.balanceOf(Alice.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(80); }); describe('failure cases', function () { diff --git a/solidity/test/zeto_anon_enc.ts b/solidity/test/zeto_anon_enc.ts index cab7dcd..7a9670a 100644 --- a/solidity/test/zeto_anon_enc.ts +++ b/solidity/test/zeto_anon_enc.ts @@ -58,10 +58,11 @@ describe("Zeto based fungible token with anonymity and encryption", function () }); it("mint ERC20 tokens to Alice to deposit to Zeto should succeed", async function () { + const startingBalance = await erc20.balanceOf(Alice.ethAddress); const tx = await erc20.connect(deployer).mint(Alice.ethAddress, 100); await tx.wait(); - const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.be.gte(100); + const endingBalance = await erc20.balanceOf(Alice.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(100); const tx1 = await erc20.connect(Alice.signer).approve(zeto.target, 100); await tx1.wait(); @@ -114,6 +115,7 @@ describe("Zeto based fungible token with anonymity and encryption", function () }); it("Alice withdraws her UTXOs to ERC20 tokens should succeed", async function () { + const startingBalance = await erc20.balanceOf(Alice.ethAddress); // Alice proposes the output ERC20 tokens const outputCommitment = newUTXO(20, Alice); @@ -124,8 +126,8 @@ describe("Zeto based fungible token with anonymity and encryption", function () await tx.wait(); // Alice checks her ERC20 balance - const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.be.gte(80); + const endingBalance = await erc20.balanceOf(Alice.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(80); }); describe("failure cases", function () { diff --git a/solidity/test/zeto_anon_enc_nullifier.ts b/solidity/test/zeto_anon_enc_nullifier.ts index bd418c0..bfb2f47 100644 --- a/solidity/test/zeto_anon_enc_nullifier.ts +++ b/solidity/test/zeto_anon_enc_nullifier.ts @@ -73,10 +73,11 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti }); it("mint ERC20 tokens to Alice to deposit to Zeto should succeed", async function () { + const startingBalance = await erc20.balanceOf(Alice.ethAddress); const tx = await erc20.connect(deployer).mint(Alice.ethAddress, 100); await tx.wait(); - const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.be.gte(100); + const endingBalance = await erc20.balanceOf(Alice.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(100); const tx1 = await erc20.connect(Alice.signer).approve(zeto.target, 100); await tx1.wait(); @@ -179,6 +180,8 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti }).timeout(600000); it("Alice withdraws her UTXOs to ERC20 tokens should succeed", async function () { + const startingBalance = await erc20.balanceOf(Alice.ethAddress); + // Alice generates the nullifiers for the UTXOs to be spent const nullifier1 = newNullifier(utxo100, Alice); @@ -198,8 +201,8 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti await tx.wait(); // Alice checks her ERC20 balance - const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.be.gte(80); + const endingBalance = await erc20.balanceOf(Alice.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(80); }); describe("failure cases", function () { diff --git a/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts b/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts index f743b20..0b42a5a 100644 --- a/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts +++ b/solidity/test/zeto_anon_enc_nullifier_non_repudiation.ts @@ -78,10 +78,11 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti }); it("mint ERC20 tokens to Alice to deposit to Zeto should succeed", async function () { + const startingBalance = await erc20.balanceOf(Alice.ethAddress); const tx = await erc20.connect(deployer).mint(Alice.ethAddress, 100); await tx.wait(); - const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.be.gte(100); + const endingBalance = await erc20.balanceOf(Alice.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(100); const tx1 = await erc20.connect(Alice.signer).approve(zeto.target, 100); await tx1.wait(); @@ -216,6 +217,7 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti }).timeout(600000); it("Alice withdraws her UTXOs to ERC20 tokens should succeed", async function () { + const startingBalance = await erc20.balanceOf(Alice.ethAddress); // Alice generates the nullifiers for the UTXOs to be spent const nullifier1 = newNullifier(utxo100, Alice); @@ -235,8 +237,8 @@ describe("Zeto based fungible token with anonymity using nullifiers and encrypti await tx.wait(); // Alice checks her ERC20 balance - const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.be.gte(80); + const endingBalance = await erc20.balanceOf(Alice.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(80); }); describe("failure cases", function () { diff --git a/solidity/test/zeto_anon_nullifier.ts b/solidity/test/zeto_anon_nullifier.ts index fca3025..8a2897b 100644 --- a/solidity/test/zeto_anon_nullifier.ts +++ b/solidity/test/zeto_anon_nullifier.ts @@ -73,10 +73,11 @@ describe("Zeto based fungible token with anonymity using nullifiers without encr }); it("mint ERC20 tokens to Alice to deposit to Zeto should succeed", async function () { + const startingBalance = await erc20.balanceOf(Alice.ethAddress); const tx = await erc20.connect(deployer).mint(Alice.ethAddress, 100); await tx.wait(); - const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.be.gte(100); + const endingBalance = await erc20.balanceOf(Alice.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(100); const tx1 = await erc20.connect(Alice.signer).approve(zeto.target, 100); await tx1.wait(); @@ -181,6 +182,8 @@ describe("Zeto based fungible token with anonymity using nullifiers without encr }).timeout(600000); it("Alice withdraws her UTXOs to ERC20 tokens should succeed", async function () { + const startingBalance = await erc20.balanceOf(Alice.ethAddress); + // Alice generates the nullifiers for the UTXOs to be spent const nullifier1 = newNullifier(utxo100, Alice); @@ -200,8 +203,8 @@ describe("Zeto based fungible token with anonymity using nullifiers without encr await tx.wait(); // Alice checks her ERC20 balance - const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.be.gte(80); + const endingBalance = await erc20.balanceOf(Alice.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(80); }); describe("failure cases", function () { diff --git a/solidity/test/zeto_anon_nullifier_kyc.ts b/solidity/test/zeto_anon_nullifier_kyc.ts index 393d586..6f5f25c 100644 --- a/solidity/test/zeto_anon_nullifier_kyc.ts +++ b/solidity/test/zeto_anon_nullifier_kyc.ts @@ -95,10 +95,11 @@ describe("Zeto based fungible token with anonymity, KYC, using nullifiers withou }); it("mint ERC20 tokens to Alice to deposit to Zeto should succeed", async function () { + const startingBalance = await erc20.balanceOf(Alice.ethAddress); const tx = await erc20.connect(deployer).mint(Alice.ethAddress, 100); await tx.wait(); - const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.be.gte(100); + const endingBalance = await erc20.balanceOf(Alice.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(100); const tx1 = await erc20.connect(Alice.signer).approve(zeto.target, 100); await tx1.wait(); @@ -226,6 +227,7 @@ describe("Zeto based fungible token with anonymity, KYC, using nullifiers withou }).timeout(600000); it("Alice withdraws her UTXOs to ERC20 tokens should succeed", async function () { + const startingBalance = await erc20.balanceOf(Alice.ethAddress); // Alice generates the nullifiers for the UTXOs to be spent const nullifier1 = newNullifier(utxo100, Alice); @@ -244,8 +246,8 @@ describe("Zeto based fungible token with anonymity, KYC, using nullifiers withou await tx.wait(); // Alice checks her ERC20 balance - const balance = await erc20.balanceOf(Alice.ethAddress); - expect(balance).to.be.gte(80); + const endingBalance = await erc20.balanceOf(Alice.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(80); }); describe("unregistered user flows", function () { @@ -303,6 +305,7 @@ describe("Zeto based fungible token with anonymity, KYC, using nullifiers withou }); it("the unregistered user can still withdraw their UTXOs to ERC20 tokens", async function () { + const startingBalance = await erc20.balanceOf(unregistered.ethAddress); // unregistered user generates the nullifiers for the UTXOs to be spent const nullifier1 = newNullifier(unregisteredUtxo100, unregistered); @@ -322,8 +325,8 @@ describe("Zeto based fungible token with anonymity, KYC, using nullifiers withou await tx.wait(); // unregistered user checks her ERC20 balance - const balance = await erc20.balanceOf(unregistered.ethAddress); - expect(balance).to.be.gte(100); + const endingBalance = await erc20.balanceOf(unregistered.ethAddress); + expect(endingBalance - startingBalance).to.be.equal(100); }); });