diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 68476e1..0000000 --- a/.eslintignore +++ /dev/null @@ -1,21 +0,0 @@ -# directories -.coverage_artifacts -.coverage_cache -.coverage_contracts -artifacts -build -cache -coverage -dist -node_modules -types - -# files -*.env -*.log -.DS_Store -.pnp.* -coverage.json -package-lock.json -pnpm-lock.yaml -yarn.lock diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index 27672a3..0000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,21 +0,0 @@ -extends: - - "eslint:recommended" - - "plugin:@typescript-eslint/eslint-recommended" - - "plugin:@typescript-eslint/recommended" - - "prettier" -parser: "@typescript-eslint/parser" -parserOptions: - project: "tsconfig.json" -plugins: - - "@typescript-eslint" -root: true -rules: - "@typescript-eslint/no-floating-promises": - - error - - ignoreIIFE: true - ignoreVoid: true - "@typescript-eslint/no-inferrable-types": "off" - "@typescript-eslint/no-unused-vars": - - error - - argsIgnorePattern: "_" - varsIgnorePattern: "_" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03f0101..0fabbfc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,24 +42,8 @@ jobs: - name: "Compile the contracts and generate the TypeChain bindings" run: "pnpm typechain" - # - name: "Test the contracts and generate the coverage report" - # run: "pnpm coverage" - - - name: Login to GitHub Container Registry - uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: "CI test" - run: | - pnpm fhevm:start &> fhevm.log & - tail -f fhevm.log | sed '/Starting JSON WebSocket server/ q' - - pnpm fhevm:faucet - pnpm test - pnpm fhevm:stop || true + - name: "Test the contracts and generate the coverage report" + run: "pnpm coverage:mock" - name: "Add test summary" run: | diff --git a/.prettierrc.yml b/.prettierrc.yml index 42ad8c5..56221e3 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -11,7 +11,7 @@ trailingComma: "all" overrides: - files: "*.sol" options: - compiler: "0.8.22" + compiler: "0.8.24" parser: "solidity-parse" tabWidth: 4 - files: "*.ts" diff --git a/.solhint.json b/.solhint.json index 122f1f6..826fe4e 100644 --- a/.solhint.json +++ b/.solhint.json @@ -2,11 +2,16 @@ "extends": "solhint:recommended", "plugins": ["prettier"], "rules": { + "const-name-snakecase": "off", + "no-global-import": "off", + "reason-string": "off", + "state-visibility": "off", + "custom-errors": "off", "code-complexity": ["error", 8], "compiler-version": ["error", ">=0.8.4"], "func-visibility": ["error", { "ignoreConstructors": true }], "max-line-length": ["error", 120], - "named-parameters-mapping": "warn", + "named-parameters-mapping": "off", "no-console": "off", "not-rely-on-time": "off", "prettier/prettier": [ diff --git a/CustomProvider.ts b/CustomProvider.ts index f6cdb32..b60308e 100644 --- a/CustomProvider.ts +++ b/CustomProvider.ts @@ -1,27 +1,32 @@ import { ethers } from "ethers"; import { ProviderWrapper } from "hardhat/plugins"; +import type { EIP1193Provider, RequestArguments } from "hardhat/types"; -class CustomProvider extends ProviderWrapper { +interface Test { + request: EIP1193Provider["request"]; +} + +class CustomProvider extends ProviderWrapper implements Test { public lastBlockSnapshot: number; public lastCounterRand: number; public lastBlockSnapshotForDecrypt: number; - constructor(protected readonly _wrappedProvider: any) { + constructor(protected readonly _wrappedProvider: EIP1193Provider) { super(_wrappedProvider); this.lastBlockSnapshot = 0; // Initialize the variable this.lastCounterRand = 0; this.lastBlockSnapshotForDecrypt = 0; } - async request(args: { method: string; params?: any[] }) { + async request(args: RequestArguments): ReturnType { if (args.method === "eth_estimateGas") { - const estimatedGasLimit = BigInt(await this._wrappedProvider.request(args)); + const estimatedGasLimit = BigInt((await this._wrappedProvider.request(args)) as bigint); const increasedGasLimit = ethers.toBeHex((estimatedGasLimit * 120n) / 100n); // override estimated gasLimit by 120%, to avoid some edge case with ethermint gas estimation return increasedGasLimit; } if (args.method === "evm_revert") { const result = await this._wrappedProvider.request(args); - const blockNumberHex = await this._wrappedProvider.request({ method: "eth_blockNumber" }); + const blockNumberHex = (await this._wrappedProvider.request({ method: "eth_blockNumber" })) as string; this.lastBlockSnapshot = parseInt(blockNumberHex); this.lastBlockSnapshotForDecrypt = parseInt(blockNumberHex); @@ -29,10 +34,10 @@ class CustomProvider extends ProviderWrapper { to: "0x000000000000000000000000000000000000005d", data: "0x1f20d85c", }; - this.lastCounterRand = await this._wrappedProvider.request({ + this.lastCounterRand = (await this._wrappedProvider.request({ method: "eth_call", params: [callData, "latest"], - }); + })) as number; return result; } if (args.method === "get_lastBlockSnapshot") { @@ -42,11 +47,11 @@ class CustomProvider extends ProviderWrapper { return this.lastBlockSnapshotForDecrypt; } if (args.method === "set_lastBlockSnapshot") { - this.lastBlockSnapshot = args.params![0]; + this.lastBlockSnapshot = Array.isArray(args.params!) && args.params[0]; return this.lastBlockSnapshot; } if (args.method === "set_lastBlockSnapshotForDecrypt") { - this.lastBlockSnapshotForDecrypt = args.params![0]; + this.lastBlockSnapshotForDecrypt = Array.isArray(args.params!) && args.params[0]; return this.lastBlockSnapshotForDecrypt; } const result = this._wrappedProvider.request(args); diff --git a/contracts/TestAsyncDecrypt.sol b/contracts/TestAsyncDecrypt.sol index bb3b15c..0fd8c03 100644 --- a/contracts/TestAsyncDecrypt.sol +++ b/contracts/TestAsyncDecrypt.sol @@ -99,7 +99,8 @@ contract TestAsyncDecrypt is GatewayCaller { function requestFakeBool() public { uint256[] memory cts = new uint256[](1); cts[0] = uint256(0x4200000000000000000000000000000000000000000000000000000000000000); - Gateway.requestDecryption(cts, this.callbackBool.selector, 0, block.timestamp + 100, false); // this should revert because previous ebool is not honestly obtained + // this should revert because previous ebool is not honestly obtained + Gateway.requestDecryption(cts, this.callbackBool.selector, 0, block.timestamp + 100, false); } function callbackBool(uint256, bool decryptedInput) public onlyGateway returns (bool) { @@ -129,7 +130,8 @@ contract TestAsyncDecrypt is GatewayCaller { function requestFakeUint4() public { uint256[] memory cts = new uint256[](1); cts[0] = uint256(0x4200000000000000000000000000000000000000000000000000000000000100); - Gateway.requestDecryption(cts, this.callbackUint4.selector, 0, block.timestamp + 100, false); // this should revert because previous handle is not honestly obtained + // this should revert because previous handle is not honestly obtained + Gateway.requestDecryption(cts, this.callbackUint4.selector, 0, block.timestamp + 100, false); } function callbackUint4(uint256, uint8 decryptedInput) public onlyGateway returns (uint8) { @@ -146,7 +148,8 @@ contract TestAsyncDecrypt is GatewayCaller { function requestFakeUint8() public { uint256[] memory cts = new uint256[](1); cts[0] = uint256(0x4200000000000000000000000000000000000000000000000000000000000200); - Gateway.requestDecryption(cts, this.callbackUint8.selector, 0, block.timestamp + 100, false); // this should revert because previous handle is not honestly obtained + // this should revert because previous handle is not honestly obtained + Gateway.requestDecryption(cts, this.callbackUint8.selector, 0, block.timestamp + 100, false); } function callbackUint8(uint256, uint8 decryptedInput) public onlyGateway returns (uint8) { @@ -163,7 +166,8 @@ contract TestAsyncDecrypt is GatewayCaller { function requestFakeUint16() public { uint256[] memory cts = new uint256[](1); cts[0] = uint256(0x4200000000000000000000000000000000000000000000000000000000000300); - Gateway.requestDecryption(cts, this.callbackUint16.selector, 0, block.timestamp + 100, false); // this should revert because previous handle is not honestly obtained + // this should revert because previous handle is not honestly obtained + Gateway.requestDecryption(cts, this.callbackUint16.selector, 0, block.timestamp + 100, false); } function callbackUint16(uint256, uint16 decryptedInput) public onlyGateway returns (uint16) { @@ -188,7 +192,8 @@ contract TestAsyncDecrypt is GatewayCaller { function requestFakeUint32() public { uint256[] memory cts = new uint256[](1); cts[0] = uint256(0x4200000000000000000000000000000000000000000000000000000000000400); - Gateway.requestDecryption(cts, this.callbackUint32.selector, 0, block.timestamp + 100, false); // this should revert because previous handle is not honestly obtained + // this should revert because previous handle is not honestly obtained + Gateway.requestDecryption(cts, this.callbackUint32.selector, 0, block.timestamp + 100, false); } function callbackUint32(uint256 requestID, uint32 decryptedInput) public onlyGateway returns (uint32) { @@ -209,7 +214,8 @@ contract TestAsyncDecrypt is GatewayCaller { function requestFakeUint64() public { uint256[] memory cts = new uint256[](1); cts[0] = uint256(0x4200000000000000000000000000000000000000000000000000000000000500); - Gateway.requestDecryption(cts, this.callbackUint64.selector, 0, block.timestamp + 100, false); // this should revert because previous handle is not honestly obtained + // this should revert because previous handle is not honestly obtained + Gateway.requestDecryption(cts, this.callbackUint64.selector, 0, block.timestamp + 100, false); } function requestUint64NonTrivial(einput inputHandle, bytes calldata inputProof) public { @@ -262,7 +268,8 @@ contract TestAsyncDecrypt is GatewayCaller { function requestFakeAddress() public { uint256[] memory cts = new uint256[](1); cts[0] = uint256(0x4200000000000000000000000000000000000000000000000000000000000700); - Gateway.requestDecryption(cts, this.callbackAddress.selector, 0, block.timestamp + 100, false); // this should revert because previous handle is not honestly obtained + // this should revert because previous handle is not honestly obtained + Gateway.requestDecryption(cts, this.callbackAddress.selector, 0, block.timestamp + 100, false); } function callbackAddress(uint256, address decryptedInput) public onlyGateway returns (address) { diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..03e3173 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,17 @@ +import eslint from "@eslint/js"; +import globals from "globals"; +import tseslint from "typescript-eslint"; + +export default [ + { + languageOptions: { + globals: globals.node, + }, + linterOptions: { + reportUnusedDisableDirectives: "off", + }, + ignores: ["abi/", "artifacts/", "cache/", "res/", "types/*"], + }, + eslint.configs.recommended, + ...tseslint.configs.recommended, +]; diff --git a/hardhat.config.ts b/hardhat.config.ts index 85a5c4b..400a165 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -3,7 +3,8 @@ import dotenv from "dotenv"; import * as fs from "fs-extra"; import "hardhat-deploy"; import "hardhat-ignore-warnings"; -import type { HardhatUserConfig, extendProvider } from "hardhat/config"; +import type { HardhatUserConfig } from "hardhat/config"; +import { extendProvider } from "hardhat/config"; import { task } from "hardhat/config"; import type { NetworkUserConfig } from "hardhat/types"; import { resolve } from "path"; @@ -17,7 +18,7 @@ import "./tasks/taskDeploy"; import "./tasks/taskGatewayRelayer"; import "./tasks/taskTFHE"; -extendProvider(async (provider, config, network) => { +extendProvider(async (provider) => { const newProvider = new CustomProvider(provider); return newProvider; }); diff --git a/package.json b/package.json index 3bd6c43..b75e657 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "url": "https://github.com/zama-ai" }, "devDependencies": { + "@eslint/js": "^9.9.0", "@nomicfoundation/hardhat-chai-matchers": "^2.0.0", "@nomicfoundation/hardhat-ethers": "^3.0.0", "@nomicfoundation/hardhat-network-helpers": "^1.0.6", @@ -20,22 +21,24 @@ "@typechain/ethers-v6": "^0.4.0", "@typechain/hardhat": "^8.0.0", "@types/chai": "^4.3.4", + "@types/eslint__js": "^8.42.3", "@types/fs-extra": "^9.0.13", "@types/mocha": "^10.0.0", "@types/node": "^18.11.9", - "@typescript-eslint/eslint-plugin": "^5.44.0", - "@typescript-eslint/parser": "^5.44.0", + "@typescript-eslint/eslint-plugin": "^8.0.1", + "@typescript-eslint/parser": "^8.0.1", "chai": "^4.3.7", "cross-env": "^7.0.3", "dotenv": "^16.0.3", - "eslint": "^8.28.0", + "eslint": "^9.9.0", "eslint-config-prettier": "^8.5.0", "ethers": "^6.8.0", - "fhevm": "^0.5.5", + "fhevm": "^0.5.8", "fhevmjs": "^0.5.2", "fs-extra": "^10.1.0", + "globals": "^15.9.0", "hardhat": "^2.22.8", - "hardhat-deploy": "^0.11.29", + "hardhat-deploy": "^0.12.4", "hardhat-gas-reporter": "^1.0.9", "hardhat-ignore-warnings": "^0.2.11", "hardhat-preprocessor": "^0.1.5", @@ -50,7 +53,8 @@ "ts-generator": "^0.1.1", "ts-node": "^10.9.1", "typechain": "^8.2.0", - "typescript": "^5.1.6" + "typescript": "^5.5.4", + "typescript-eslint": "^8.0.1" }, "files": [ "contracts" @@ -76,7 +80,7 @@ "deploy:contracts": "hardhat deploy", "lint": "pnpm lint:sol && pnpm lint:ts && pnpm prettier:check", "lint:sol": "solhint --max-warnings 25 \"contracts/**/*.sol\"", - "lint:ts": "eslint --ignore-path ./.eslintignore --ext .js,.ts .", + "lint:ts": "eslint .", "postinstall": "DOTENV_CONFIG_PATH=./.env.example pnpm typechain", "prettier:check": "prettier --check \"**/*.{js,json,md,sol,ts,yml}\"", "prettier:write": "prettier --write \"**/*.{js,json,md,sol,ts,yml}\"", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e6302a6..18af4e9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,6 +15,9 @@ importers: specifier: ^5.1.7 version: 5.1.7 devDependencies: + '@eslint/js': + specifier: ^9.9.0 + version: 9.9.0 '@nomicfoundation/hardhat-chai-matchers': specifier: ^2.0.0 version: 2.0.7(@nomicfoundation/hardhat-ethers@3.0.6(ethers@6.13.2)(hardhat@2.22.8(ts-node@10.9.2(@types/node@18.19.44)(typescript@5.5.4))(typescript@5.5.4)))(chai@4.5.0)(ethers@6.13.2)(hardhat@2.22.8(ts-node@10.9.2(@types/node@18.19.44)(typescript@5.5.4))(typescript@5.5.4)) @@ -45,6 +48,9 @@ importers: '@types/chai': specifier: ^4.3.4 version: 4.3.17 + '@types/eslint__js': + specifier: ^8.42.3 + version: 8.42.3 '@types/fs-extra': specifier: ^9.0.13 version: 9.0.13 @@ -55,11 +61,11 @@ importers: specifier: ^18.11.9 version: 18.19.44 '@typescript-eslint/eslint-plugin': - specifier: ^5.44.0 - version: 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.0.1 + version: 8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4) '@typescript-eslint/parser': - specifier: ^5.44.0 - version: 5.62.0(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.0.1 + version: 8.0.1(eslint@9.9.0)(typescript@5.5.4) chai: specifier: ^4.3.7 version: 4.5.0 @@ -70,29 +76,32 @@ importers: specifier: ^16.0.3 version: 16.4.5 eslint: - specifier: ^8.28.0 - version: 8.57.0 + specifier: ^9.9.0 + version: 9.9.0 eslint-config-prettier: specifier: ^8.5.0 - version: 8.10.0(eslint@8.57.0) + version: 8.10.0(eslint@9.9.0) ethers: specifier: ^6.8.0 version: 6.13.2 fhevm: - specifier: ^0.5.5 - version: 0.5.5 + specifier: ^0.5.8 + version: 0.5.8 fhevmjs: specifier: ^0.5.2 version: 0.5.2(encoding@0.1.13) fs-extra: specifier: ^10.1.0 version: 10.1.0 + globals: + specifier: ^15.9.0 + version: 15.9.0 hardhat: specifier: ^2.22.8 version: 2.22.8(ts-node@10.9.2(@types/node@18.19.44)(typescript@5.5.4))(typescript@5.5.4) hardhat-deploy: - specifier: ^0.11.29 - version: 0.11.45 + specifier: ^0.12.4 + version: 0.12.4 hardhat-gas-reporter: specifier: ^1.0.9 version: 1.0.10(hardhat@2.22.8(ts-node@10.9.2(@types/node@18.19.44)(typescript@5.5.4))(typescript@5.5.4)) @@ -136,8 +145,11 @@ importers: specifier: ^8.2.0 version: 8.3.2(typescript@5.5.4) typescript: - specifier: ^5.1.6 + specifier: ^5.5.4 version: 5.5.4 + typescript-eslint: + specifier: ^8.0.1 + version: 8.0.1(eslint@9.9.0)(typescript@5.5.4) packages: @@ -219,13 +231,21 @@ packages: resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/eslintrc@2.1.4': - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@eslint/config-array@0.17.1': + resolution: {integrity: sha512-BlYOpej8AQ8Ev9xVqroV7a02JK3SkBAaN9GfMMH9W6Ch8FlQlkjGw4Ir7+FgYwfirivAf4t+GtzuAxqfukmISA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@8.57.0': - resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@eslint/eslintrc@3.1.0': + resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/js@9.9.0': + resolution: {integrity: sha512-hhetes6ZHP3BlXLxmd8K2SNgkhNSi+UcecbnwWKwpP7kyi/uC75DJ1lOOBO3xrC4jyojtGE3YxKZPHfk4yrgug==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/object-schema@2.1.4': + resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@ethereumjs/rlp@4.0.1': resolution: {integrity: sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==} @@ -333,18 +353,13 @@ packages: '@gar/promisify@1.1.3': resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} - '@humanwhocodes/config-array@0.11.14': - resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} - engines: {node: '>=10.10.0'} - deprecated: Use @eslint/config-array instead - '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - '@humanwhocodes/object-schema@2.0.3': - resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} - deprecated: Use @eslint/object-schema instead + '@humanwhocodes/retry@0.3.0': + resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} + engines: {node: '>=18.18'} '@jridgewell/gen-mapping@0.3.5': resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} @@ -659,6 +674,15 @@ packages: '@types/concat-stream@1.6.1': resolution: {integrity: sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==} + '@types/eslint@9.6.0': + resolution: {integrity: sha512-gi6WQJ7cHRgZxtkQEoyHMppPjq9Kxo5Tjn2prSKDSmZrCz8TZ3jSRCeTJm+WoM+oB0WG37bRqLzaaU3q7JypGg==} + + '@types/eslint__js@8.42.3': + resolution: {integrity: sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==} + + '@types/estree@1.0.5': + resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + '@types/form-data@0.0.33': resolution: {integrity: sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==} @@ -713,69 +737,62 @@ packages: '@types/secp256k1@4.0.6': resolution: {integrity: sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==} - '@types/semver@7.5.8': - resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - - '@typescript-eslint/eslint-plugin@5.62.0': - resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/eslint-plugin@8.0.1': + resolution: {integrity: sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/parser@5.62.0': - resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/parser@8.0.1': + resolution: {integrity: sha512-5IgYJ9EO/12pOUwiBKFkpU7rS3IU21mtXzB81TNwq2xEybcmAZrE9qwDtsb5uQd9aVO9o0fdabFyAmKveXyujg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/scope-manager@5.62.0': - resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/scope-manager@8.0.1': + resolution: {integrity: sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@5.62.0': - resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/type-utils@8.0.1': + resolution: {integrity: sha512-+/UT25MWvXeDX9YaHv1IS6KI1fiuTto43WprE7pgSMswHbn1Jm9GEM4Txp+X74ifOWV8emu2AWcbLhpJAvD5Ng==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: '*' typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/types@5.62.0': - resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/types@8.0.1': + resolution: {integrity: sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@5.62.0': - resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/typescript-estree@8.0.1': + resolution: {integrity: sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/utils@5.62.0': - resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/utils@8.0.1': + resolution: {integrity: sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - - '@typescript-eslint/visitor-keys@5.62.0': - resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + eslint: ^8.57.0 || ^9.0.0 - '@ungap/structured-clone@1.2.0': - resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + '@typescript-eslint/visitor-keys@8.0.1': + resolution: {integrity: sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} abbrev@1.0.9: resolution: {integrity: sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==} @@ -1251,10 +1268,6 @@ packages: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} - doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - dotenv@16.4.5: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} engines: {node: '>=12'} @@ -1322,26 +1335,31 @@ packages: peerDependencies: eslint: '>=7.0.0' - eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} - - eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + eslint-scope@8.0.2: + resolution: {integrity: sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint@8.57.0: - resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + eslint-visitor-keys@4.0.0: + resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + eslint@9.9.0: + resolution: {integrity: sha512-JfiKJrbx0506OEerjK2Y1QlldtBxkAlLxT5OEcRF8uaQ86noDe2k31Vw9rnSWv+MXZHj7OOUV/dA0AhdLFcyvA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true - espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + espree@10.1.0: + resolution: {integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} esprima@2.7.3: resolution: {integrity: sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==} @@ -1365,10 +1383,6 @@ packages: resolution: {integrity: sha512-25w1fMXQrGdoquWnScXZGckOv+Wes+JDnuN/+7ex3SauFRS72r2lFDec0EKPt2YD1wUJ/IrfEex+9yp4hfSOJA==} engines: {node: '>=0.10.0'} - estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} - estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} @@ -1454,8 +1468,8 @@ packages: fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - fhevm@0.5.5: - resolution: {integrity: sha512-0iPp6/IGx+O1go92LVSoZhBcnnSaSjlb3FazxUWJ0R38B/fSe5EZizZnM7vxnjLgBxwUDx0jGkTmc5S5ZEBNuw==} + fhevm@0.5.8: + resolution: {integrity: sha512-fzTQnnw/7EajQywXUfZyTEGlsPe2SmvcVLklsmHEeZ5YQRmbp9pGR2rFuRcXED+Ou76Miq9oExRKIhkcdPlySg==} engines: {node: '>=20.0.0'} fhevmjs@0.5.2: @@ -1463,9 +1477,9 @@ packages: engines: {node: '>=20'} hasBin: true - file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} + file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} file-uri-to-path@1.0.0: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} @@ -1486,9 +1500,9 @@ packages: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} - flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} + flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} flat@5.0.2: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} @@ -1632,9 +1646,13 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} - globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} + globals@14.0.0: + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + engines: {node: '>=18'} + + globals@15.9.0: + resolution: {integrity: sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==} + engines: {node: '>=18'} globby@10.0.2: resolution: {integrity: sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==} @@ -1658,8 +1676,8 @@ packages: engines: {node: '>=0.4.7'} hasBin: true - hardhat-deploy@0.11.45: - resolution: {integrity: sha512-aC8UNaq3JcORnEUIwV945iJuvBwi65tjHVDU3v6mOcqik7WAzHVCJ7cwmkkipsHrWysrB5YvGF1q9S1vIph83w==} + hardhat-deploy@0.12.4: + resolution: {integrity: sha512-bYO8DIyeGxZWlhnMoCBon9HNZb6ji0jQn7ngP1t5UmGhC8rQYhji7B73qETMOFhzt5ECZPr+U52duj3nubsqdQ==} hardhat-gas-reporter@1.0.10: resolution: {integrity: sha512-02N4+So/fZrzJ88ci54GqwVA3Zrf0C9duuTyGt0CFRIh/CdNwbnTgkXkRfojOMLBQ+6t+lBIkgbsOtqMvNwikA==} @@ -2066,6 +2084,10 @@ packages: resolution: {integrity: sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==} engines: {node: '>=16 || 14 >=14.17'} + minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + engines: {node: '>=16 || 14 >=14.17'} + minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -2141,9 +2163,6 @@ packages: napi-build-utils@1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} - natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -2659,11 +2678,6 @@ packages: cpu: [x64] os: [linux] - solidity-comments-linux-x64-gnu@0.1.1: - resolution: {integrity: sha512-oiU4yhh1Q9SeGXQ+/sogfTNoOkU8I8IvlIeotBQziTOonUHrxQk4E63kNiYGPDn5ZbB3BhKFmGHNRNrkufsxcQ==} - engines: {node: '>= 10'} - os: [linux] - solidity-comments-linux-x64-musl@0.0.2: resolution: {integrity: sha512-R9FeDloVlFGTaVkOlELDVC7+1Tjx5WBPI5L8r0AGOPHK3+jOcRh6sKYpI+VskSPDc3vOO46INkpDgUXrKydlIw==} engines: {node: '>= 10'} @@ -2846,6 +2860,12 @@ packages: tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + ts-api-utils@1.3.0: + resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + ts-command-line-args@2.5.1: resolution: {integrity: sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==} hasBin: true @@ -2885,12 +2905,6 @@ packages: tsort@0.0.1: resolution: {integrity: sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==} - tsutils@3.21.0: - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' - tunnel-agent@0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} @@ -2933,6 +2947,15 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + typescript-eslint@8.0.1: + resolution: {integrity: sha512-V3Y+MdfhawxEjE16dWpb7/IOgeXnLwAEEkS7v8oDqNcR1oYlqWhGH/iHqHdKVdpWme1VPZ0SoywXAkCqawj2eQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + typescript@5.5.4: resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} engines: {node: '>=14.17'} @@ -3125,11 +3148,11 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - zksync-web3@0.14.4: - resolution: {integrity: sha512-kYehMD/S6Uhe1g434UnaMN+sBr9nQm23Ywn0EUP5BfQCsbjcr3ORuS68PosZw8xUTu3pac7G6YMSnNHk+fwzvg==} - deprecated: This package has been deprecated in favor of zksync-ethers@5.0.0 + zksync-ethers@5.9.2: + resolution: {integrity: sha512-Y2Mx6ovvxO6UdC2dePLguVzvNToOY8iLWeq5ne+jgGSJxAi/f4He/NF6FNsf6x1aWX0o8dy4Df8RcOQXAkj5qw==} + engines: {node: '>=16.0.0'} peerDependencies: - ethers: ^5.7.0 + ethers: ~5.7.0 zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} @@ -3224,19 +3247,27 @@ snapshots: dependencies: '@jridgewell/trace-mapping': 0.3.9 - '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.9.0)': dependencies: - eslint: 8.57.0 + eslint: 9.9.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.11.0': {} - '@eslint/eslintrc@2.1.4': + '@eslint/config-array@0.17.1': + dependencies: + '@eslint/object-schema': 2.1.4 + debug: 4.3.6(supports-color@8.1.1) + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 debug: 4.3.6(supports-color@8.1.1) - espree: 9.6.1 - globals: 13.24.0 + espree: 10.1.0 + globals: 14.0.0 ignore: 5.3.1 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -3245,7 +3276,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@8.57.0': {} + '@eslint/js@9.9.0': {} + + '@eslint/object-schema@2.1.4': {} '@ethereumjs/rlp@4.0.1': {} @@ -3515,17 +3548,9 @@ snapshots: '@gar/promisify@1.1.3': optional: true - '@humanwhocodes/config-array@0.11.14': - dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.6(supports-color@8.1.1) - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/object-schema@2.0.3': {} + '@humanwhocodes/retry@0.3.0': {} '@jridgewell/gen-mapping@0.3.5': dependencies: @@ -3876,6 +3901,17 @@ snapshots: dependencies: '@types/node': 18.19.44 + '@types/eslint@9.6.0': + dependencies: + '@types/estree': 1.0.5 + '@types/json-schema': 7.0.15 + + '@types/eslint__js@8.42.3': + dependencies: + '@types/eslint': 9.6.0 + + '@types/estree@1.0.5': {} + '@types/form-data@0.0.33': dependencies: '@types/node': 18.19.44 @@ -3931,94 +3967,87 @@ snapshots: dependencies: '@types/node': 18.19.44 - '@types/semver@7.5.8': {} - - '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': + '@typescript-eslint/eslint-plugin@8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.5.4) - debug: 4.3.6(supports-color@8.1.1) - eslint: 8.57.0 + '@typescript-eslint/parser': 8.0.1(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.0.1 + '@typescript-eslint/type-utils': 8.0.1(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.1(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.0.1 + eslint: 9.9.0 graphemer: 1.4.0 ignore: 5.3.1 - natural-compare-lite: 1.4.0 - semver: 7.6.3 - tsutils: 3.21.0(typescript@5.5.4) + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.5.4)': + '@typescript-eslint/parser@8.0.1(eslint@9.9.0)(typescript@5.5.4)': dependencies: - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.0.1 + '@typescript-eslint/types': 8.0.1 + '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.0.1 debug: 4.3.6(supports-color@8.1.1) - eslint: 8.57.0 + eslint: 9.9.0 optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@5.62.0': + '@typescript-eslint/scope-manager@8.0.1': dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 + '@typescript-eslint/types': 8.0.1 + '@typescript-eslint/visitor-keys': 8.0.1 - '@typescript-eslint/type-utils@5.62.0(eslint@8.57.0)(typescript@5.5.4)': + '@typescript-eslint/type-utils@8.0.1(eslint@9.9.0)(typescript@5.5.4)': dependencies: - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.5.4) - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.1(eslint@9.9.0)(typescript@5.5.4) debug: 4.3.6(supports-color@8.1.1) - eslint: 8.57.0 - tsutils: 3.21.0(typescript@5.5.4) + ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: + - eslint - supports-color - '@typescript-eslint/types@5.62.0': {} + '@typescript-eslint/types@8.0.1': {} - '@typescript-eslint/typescript-estree@5.62.0(typescript@5.5.4)': + '@typescript-eslint/typescript-estree@8.0.1(typescript@5.5.4)': dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 + '@typescript-eslint/types': 8.0.1 + '@typescript-eslint/visitor-keys': 8.0.1 debug: 4.3.6(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 + minimatch: 9.0.5 semver: 7.6.3 - tsutils: 3.21.0(typescript@5.5.4) + ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.5.4)': + '@typescript-eslint/utils@8.0.1(eslint@9.9.0)(typescript@5.5.4)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.5.4) - eslint: 8.57.0 - eslint-scope: 5.1.1 - semver: 7.6.3 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0) + '@typescript-eslint/scope-manager': 8.0.1 + '@typescript-eslint/types': 8.0.1 + '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) + eslint: 9.9.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/visitor-keys@5.62.0': + '@typescript-eslint/visitor-keys@8.0.1': dependencies: - '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/types': 8.0.1 eslint-visitor-keys: 3.4.3 - '@ungap/structured-clone@1.2.0': {} - abbrev@1.0.9: {} acorn-jsx@5.3.2(acorn@8.12.1): @@ -4517,10 +4546,6 @@ snapshots: dependencies: path-type: 4.0.0 - doctrine@3.0.0: - dependencies: - esutils: 2.0.3 - dotenv@16.4.5: {} elliptic@6.5.4: @@ -4591,54 +4616,47 @@ snapshots: optionalDependencies: source-map: 0.2.0 - eslint-config-prettier@8.10.0(eslint@8.57.0): + eslint-config-prettier@8.10.0(eslint@9.9.0): dependencies: - eslint: 8.57.0 + eslint: 9.9.0 - eslint-scope@5.1.1: - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 - - eslint-scope@7.2.2: + eslint-scope@8.0.2: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint@8.57.0: + eslint-visitor-keys@4.0.0: {} + + eslint@9.9.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0) '@eslint-community/regexpp': 4.11.0 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.0 - '@humanwhocodes/config-array': 0.11.14 + '@eslint/config-array': 0.17.1 + '@eslint/eslintrc': 3.1.0 + '@eslint/js': 9.9.0 '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.3.0 '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 debug: 4.3.6(supports-color@8.1.1) - doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 + eslint-scope: 8.0.2 + eslint-visitor-keys: 4.0.0 + espree: 10.1.0 esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 + file-entry-cache: 8.0.0 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.24.0 - graphemer: 1.4.0 ignore: 5.3.1 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 - js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 lodash.merge: 4.6.2 @@ -4650,11 +4668,11 @@ snapshots: transitivePeerDependencies: - supports-color - espree@9.6.1: + espree@10.1.0: dependencies: acorn: 8.12.1 acorn-jsx: 5.3.2(acorn@8.12.1) - eslint-visitor-keys: 3.4.3 + eslint-visitor-keys: 4.0.0 esprima@2.7.3: {} @@ -4670,8 +4688,6 @@ snapshots: estraverse@1.9.3: {} - estraverse@4.3.0: {} - estraverse@5.3.0: {} esutils@2.0.3: {} @@ -4845,10 +4861,9 @@ snapshots: dependencies: reusify: 1.0.4 - fhevm@0.5.5: + fhevm@0.5.8: dependencies: '@openzeppelin/contracts': 5.0.2 - solidity-comments-linux-x64-gnu: 0.1.1 fhevmjs@0.5.2(encoding@0.1.13): dependencies: @@ -4864,9 +4879,9 @@ snapshots: transitivePeerDependencies: - encoding - file-entry-cache@6.0.1: + file-entry-cache@8.0.0: dependencies: - flat-cache: 3.2.0 + flat-cache: 4.0.1 file-uri-to-path@1.0.0: {} @@ -4887,11 +4902,10 @@ snapshots: locate-path: 6.0.0 path-exists: 4.0.0 - flat-cache@3.2.0: + flat-cache@4.0.1: dependencies: flatted: 3.3.1 keyv: 4.5.4 - rimraf: 3.0.2 flat@5.0.2: {} @@ -5066,9 +5080,9 @@ snapshots: globals@11.12.0: {} - globals@13.24.0: - dependencies: - type-fest: 0.20.2 + globals@14.0.0: {} + + globals@15.9.0: {} globby@10.0.2: dependencies: @@ -5107,7 +5121,7 @@ snapshots: optionalDependencies: uglify-js: 3.19.2 - hardhat-deploy@0.11.45: + hardhat-deploy@0.12.4: dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/abstract-signer': 5.7.0 @@ -5132,7 +5146,7 @@ snapshots: match-all: 1.2.6 murmur-128: 0.2.1 qs: 6.13.0 - zksync-web3: 0.14.4(ethers@5.7.2) + zksync-ethers: 5.9.2(ethers@5.7.2) transitivePeerDependencies: - bufferutil - supports-color @@ -5581,6 +5595,10 @@ snapshots: dependencies: brace-expansion: 2.0.1 + minimatch@9.0.5: + dependencies: + brace-expansion: 2.0.1 + minimist@1.2.8: {} minipass-collect@1.0.2: @@ -5674,8 +5692,6 @@ snapshots: napi-build-utils@1.0.2: {} - natural-compare-lite@1.4.0: {} - natural-compare@1.4.0: {} negotiator@0.6.3: @@ -6004,6 +6020,7 @@ snapshots: rimraf@3.0.2: dependencies: glob: 7.2.3 + optional: true rimraf@4.4.1: dependencies: @@ -6213,8 +6230,6 @@ snapshots: solidity-comments-linux-x64-gnu@0.0.2: optional: true - solidity-comments-linux-x64-gnu@0.1.1: {} - solidity-comments-linux-x64-musl@0.0.2: optional: true @@ -6441,6 +6456,10 @@ snapshots: tr46@0.0.3: {} + ts-api-utils@1.3.0(typescript@5.5.4): + dependencies: + typescript: 5.5.4 + ts-command-line-args@2.5.1: dependencies: chalk: 4.1.2 @@ -6490,11 +6509,6 @@ snapshots: tsort@0.0.1: {} - tsutils@3.21.0(typescript@5.5.4): - dependencies: - tslib: 1.14.1 - typescript: 5.5.4 - tunnel-agent@0.6.0: dependencies: safe-buffer: 5.2.1 @@ -6537,6 +6551,17 @@ snapshots: typedarray@0.0.6: {} + typescript-eslint@8.0.1(eslint@9.9.0)(typescript@5.5.4): + dependencies: + '@typescript-eslint/eslint-plugin': 8.0.1(@typescript-eslint/parser@8.0.1(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/parser': 8.0.1(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.0.1(eslint@9.9.0)(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - eslint + - supports-color + typescript@5.5.4: {} typical@4.0.0: {} @@ -6702,7 +6727,7 @@ snapshots: yocto-queue@0.1.0: {} - zksync-web3@0.14.4(ethers@5.7.2): + zksync-ethers@5.9.2(ethers@5.7.2): dependencies: ethers: 5.7.2 diff --git a/test/asyncDecrypt.ts b/test/asyncDecrypt.ts index 5b38cc5..7dff151 100644 --- a/test/asyncDecrypt.ts +++ b/test/asyncDecrypt.ts @@ -54,14 +54,14 @@ export const asyncDecrypt = async (): Promise => { "fhevm/gateway/GatewayContract.sol:GatewayContract", parsedEnv.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS, ); - gateway.on( + await gateway.on( "EventDecryption", async (requestID, cts, contractCaller, callbackSelector, msgValue, maxTimestamp, eventData) => { const blockNumber = eventData.log.blockNumber; console.log(`${await currentTime()} - Requested decrypt on block ${blockNumber} (requestID ${requestID})`); }, ); - gateway.on("ResultCallback", async (requestID, success, result, eventData) => { + await gateway.on("ResultCallback", async (requestID, success, result, eventData) => { const blockNumber = eventData.log.blockNumber; console.log(`${await currentTime()} - Fulfilled decrypt on block ${blockNumber} (requestID ${requestID})`); }); diff --git a/test/coprocessorUtils.ts b/test/coprocessorUtils.ts index a9c9c9b..c2b8606 100644 --- a/test/coprocessorUtils.ts +++ b/test/coprocessorUtils.ts @@ -15,9 +15,7 @@ let lastBlockSnapshot = 0; let lastCounterRand = 0; let counterRand = 0; -const contractABI = JSON.parse( - fs.readFileSync("abi/TFHEExecutor.json").toString(), -).abi; +const contractABI = JSON.parse(fs.readFileSync("abi/TFHEExecutor.json").toString()).abi; const iface = new ethers.Interface(contractABI); @@ -32,7 +30,7 @@ const selectors = functions.reduce((acc, func) => { //const db = new Database('./sql.db'); // on-disk db for debugging const db = new Database(":memory:"); -function insertSQL(handle: string, clearText: BigInt, replace: boolean = false) { +function insertSQL(handle: string, clearText: bigint, replace: boolean = false) { if (replace) { // this is useful if using snapshots while sampling different random numbers on each revert db.run("INSERT OR REPLACE INTO ciphertexts (handle, clearText) VALUES (?, ?)", [handle, clearText.toString()]); @@ -43,7 +41,7 @@ function insertSQL(handle: string, clearText: BigInt, replace: boolean = false) // Decrypt any handle, bypassing ACL // WARNING : only for testing or internal use -export const getClearText = async (handle: BigInt): Promise => { +export const getClearText = async (handle: bigint): Promise => { const handleStr = "0x" + handle.toString(16).padStart(64, "0"); return new Promise((resolve, reject) => { @@ -68,7 +66,7 @@ export const getClearText = async (handle: BigInt): Promise => { executeQuery(); }); }; -/*export const getClearText = async (handle: BigInt): Promise => { +/*export const getClearText = async (handle: bigint): Promise => { const handleStr = '0x' + handle.toString(16).padStart(64, '0'); return new Promise((resolve, reject) => { db.get('SELECT clearText FROM ciphertexts WHERE handle = ?', [handleStr], (err, row) => { @@ -197,7 +195,7 @@ function getRandomBigInt(numBits: number): bigint { return randomBigInt; } -async function insertHandle(obj: EvmState, blockNo: number) { +async function insertHandle(obj: EvmState) { if (isCoprocAdd(obj!.stack.at(-2))) { const argsOffset = Number(`0x${obj!.stack.at(-4)}`); const argsSize = Number(`0x${obj!.stack.at(-5)}`); @@ -671,7 +669,7 @@ async function insertHandle(obj: EvmState, blockNo: number) { insertSQL(handle, clearText); break; - case "verifyCiphertext(bytes32,address,bytes,bytes1)": + case "verifyCiphertext(bytes32,address,bytes,bytes1)": { handle = decodedData[0]; const type = parseInt(handle.slice(-4, -2), 16); if (type !== 11) { @@ -687,8 +685,8 @@ async function insertHandle(obj: EvmState, blockNo: number) { insertSQL(handle, clearText); } break; - - case "fheIfThenElse(uint256,uint256,uint256)": + } + case "fheIfThenElse(uint256,uint256,uint256)": { resultType = parseInt(decodedData[1].toString(16).slice(-4, -2), 16); handle = ethers.keccak256( ethers.solidityPacked( @@ -707,8 +705,8 @@ async function insertHandle(obj: EvmState, blockNo: number) { } insertSQL(handle, clearText); break; - - case "fheRand(bytes1)": + } + case "fheRand(bytes1)": { resultType = parseInt(decodedData[0], 16); handle = ethers.keccak256( ethers.solidityPacked(["uint8", "bytes1", "uint256"], [Operators.fheRand, decodedData[0], counterRand]), @@ -718,8 +716,8 @@ async function insertHandle(obj: EvmState, blockNo: number) { insertSQL(handle, clearText, true); counterRand++; break; - - case "fheRandBounded(uint256,bytes1)": + } + case "fheRandBounded(uint256,bytes1)": { resultType = parseInt(decodedData[1], 16); handle = ethers.keccak256( ethers.solidityPacked( @@ -732,11 +730,12 @@ async function insertHandle(obj: EvmState, blockNo: number) { insertSQL(handle, clearText, true); counterRand++; break; + } } } } -function bitwiseNotUintBits(value: BigInt, numBits: number) { +function bitwiseNotUintBits(value: bigint, numBits: number) { if (typeof value !== "bigint") { throw new TypeError("The input value must be a BigInt."); } @@ -776,7 +775,7 @@ export const awaitCoprocessor = async (): Promise => { async function getAllPastTransactionHashes() { const provider = ethers.provider; const latestBlockNumber = await provider.getBlockNumber(); - let txHashes: [string, number][] = []; + const txHashes: [string, number][] = []; if (hre.__SOLIDITY_COVERAGE_RUNNING !== true) { // evm_snapshot is not supported in coverage mode @@ -802,74 +801,74 @@ async function getAllPastTransactionHashes() { return txHashes; } -async function buildCallTree(receipt) { - const txHash = receipt.hash; - const trace = await ethers.provider.send("debug_traceTransaction", [txHash, {}]); - const structLogs = trace.structLogs; - - const callStack = []; - const callTree = { - id: 0, - type: !!receipt.to ? "TOPCALL" : "TOPCREATE", - revert: receipt.status === 1 ? false : true, - to: !!receipt.to ? receipt.to : null, - calls: [], - }; - let currentNode = callTree; - const lenStructLogs = structLogs.length; - let index = 1; - for (const [i, log] of structLogs.entries()) { - if (i < lenStructLogs - 1) { - if (structLogs[i].depth - structLogs[i + 1].depth === 1) { - if (!["RETURN", "SELFDESTRUCT", "STOP", "REVERT", "INVALID"].includes(structLogs[i].op)) { - currentNode.outofgasOrOther = true; - currentNode = callStack.pop(); - } - } - } - - switch (log.op) { - case "CALL": - case "DELEGATECALL": - case "CALLCODE": - case "STATICCALL": - case "CREATE": - case "CREATE2": - if (i < lenStructLogs - 1) { - if (structLogs[i + 1].depth - structLogs[i].depth === 1) { - const newNode = { - id: index, - type: log.op, - to: log.stack[log.stack.length - 2], - calls: [], - revert: true, - outofgasOrOther: false, - }; - currentNode.calls.push(newNode); - callStack.push(currentNode); - currentNode = newNode; - index += 1; - } - } - break; - case "RETURN": // some edge case probably not handled well : if memory expansion cost on RETURN exceeds the remaining gas in current subcall, but it's OK for a mocked mode - case "SELFDESTRUCT": // some edge case probably not handled well : if there is not enough gas remaining on SELFDESTRUCT, but it's OK for a mocked mode - case "STOP": - currentNode.revert = false; - currentNode = callStack.pop(); - break; - case "REVERT": - case "INVALID": - currentNode = callStack.pop(); - break; - } - - switch (log.op) { - case "CREATE": - case "CREATE2": - currentNode.to = null; - break; - } - } - return callTree; -} +// async function buildCallTree(receipt: TransactionReceipt) { +// const txHash = receipt.hash; +// const trace = await ethers.provider.send("debug_traceTransaction", [txHash, {}]); +// const structLogs = trace.structLogs; + +// const callStack = []; +// const callTree = { +// id: 0, +// type: !!receipt.to ? "TOPCALL" : "TOPCREATE", +// revert: receipt.status === 1 ? false : true, +// to: !!receipt.to ? receipt.to : null, +// calls: [], +// }; +// let currentNode = callTree; +// const lenStructLogs = structLogs.length; +// let index = 1; +// for (const [i, log] of structLogs.entries()) { +// if (i < lenStructLogs - 1) { +// if (structLogs[i].depth - structLogs[i + 1].depth === 1) { +// if (!["RETURN", "SELFDESTRUCT", "STOP", "REVERT", "INVALID"].includes(structLogs[i].op)) { +// currentNode.outofgasOrOther = true; +// currentNode = callStack.pop(); +// } +// } +// } + +// switch (log.op) { +// case "CALL": +// case "DELEGATECALL": +// case "CALLCODE": +// case "STATICCALL": +// case "CREATE": +// case "CREATE2": +// if (i < lenStructLogs - 1) { +// if (structLogs[i + 1].depth - structLogs[i].depth === 1) { +// const newNode = { +// id: index, +// type: log.op, +// to: log.stack[log.stack.length - 2], +// calls: [], +// revert: true, +// outofgasOrOther: false, +// }; +// currentNode.calls.push(newNode); +// callStack.push(currentNode); +// currentNode = newNode; +// index += 1; +// } +// } +// break; +// case "RETURN": // some edge case probably not handled well : if memory expansion cost on RETURN exceeds the remaining gas in current subcall, but it's OK for a mocked mode +// case "SELFDESTRUCT": // some edge case probably not handled well : if there is not enough gas remaining on SELFDESTRUCT, but it's OK for a mocked mode +// case "STOP": +// currentNode.revert = false; +// currentNode = callStack.pop(); +// break; +// case "REVERT": +// case "INVALID": +// currentNode = callStack.pop(); +// break; +// } + +// switch (log.op) { +// case "CREATE": +// case "CREATE2": +// currentNode.to = null; +// break; +// } +// } +// return callTree; +// } diff --git a/test/fhevmjsMocked.ts b/test/fhevmjsMocked.ts index b1b035a..42ee6d2 100644 --- a/test/fhevmjsMocked.ts +++ b/test/fhevmjsMocked.ts @@ -4,13 +4,12 @@ import crypto from "crypto"; import dotenv from "dotenv"; import { ethers } from "ethers"; import * as fs from "fs"; +import hre from "hardhat"; import { Keccak } from "sha3"; import { isAddress } from "web3-validator"; import { awaitCoprocessor, getClearText } from "./coprocessorUtils"; -const hre = require("hardhat"); - const parsedEnvACL = dotenv.parse(fs.readFileSync("node_modules/fhevm/lib/.env.acl")); const aclAdd = parsedEnvACL.ACL_CONTRACT_ADDRESS.replace(/^0x/, "").replace(/^0+/, "").toLowerCase(); diff --git a/test/gatewayDecrypt/testAsyncDecrypt.ts b/test/gatewayDecrypt/testAsyncDecrypt.ts index c5b4a4d..cf8b682 100644 --- a/test/gatewayDecrypt/testAsyncDecrypt.ts +++ b/test/gatewayDecrypt/testAsyncDecrypt.ts @@ -115,7 +115,7 @@ describe("TestAsyncDecrypt", function () { const tx2 = await contract2.connect(this.signers.carol).requestMixed(5, 15, { gasLimit: 5_000_000 }); await tx2.wait(); await awaitAllDecryptionResults(); - let yB = await contract2.yBool(); + const yB = await contract2.yBool(); expect(yB).to.equal(true); let y = await contract2.yUint4(); expect(y).to.equal(4); @@ -123,7 +123,7 @@ describe("TestAsyncDecrypt", function () { expect(y).to.equal(42); y = await contract2.yUint16(); expect(y).to.equal(16); - let yAdd = await contract2.yAddress(); + const yAdd = await contract2.yAddress(); expect(yAdd).to.equal("0x8ba1f109551bD432803012645Ac136ddd64DBA72"); y = await contract2.yUint32(); expect(y).to.equal(52); // 5+15+32