From cab68131aff382a1e4bd071619c66936791feacc Mon Sep 17 00:00:00 2001 From: Trung-Tin Pham <60747384+AtelyPham@users.noreply.github.com> Date: Thu, 2 Nov 2023 22:32:45 +0700 Subject: [PATCH] Upgrade snarkjs & Modularize Export in `@webb-tools/utils` Package (#353) --- package.json | 2 +- packages/anchors/package.json | 2 +- packages/utils/package.json | 34 +++++++++++++++++++- yarn.lock | 58 +++++++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d5a5671f..b79dfdee 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "nx": "^15.9.2", "prettier-plugin-solidity": "^1.1.3", "rimraf": "^5.0.0", - "snarkjs": "^0.6.10", + "snarkjs": "^0.7.2", "solidity-coverage": "^0.8.2", "tomlify-j0.4": "^3.0.0", "truffle-assertions": "^0.9.2", diff --git a/packages/anchors/package.json b/packages/anchors/package.json index 5f324eb9..1a544251 100644 --- a/packages/anchors/package.json +++ b/packages/anchors/package.json @@ -19,7 +19,7 @@ "circomlibjs": "^0.0.8", "ethers": "5.7.0", "jssha": "^3.2.0", - "snarkjs": "^0.6.10" + "snarkjs": "^0.7.2" }, "publishConfig": { "access": "public" diff --git a/packages/utils/package.json b/packages/utils/package.json index 0bea9065..7b0668bc 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -15,7 +15,7 @@ "circomlibjs": "^0.0.8", "elliptic": "6.5.4", "ethers": "5.7.0", - "snarkjs": "^0.6.10" + "snarkjs": "^0.7.2" }, "publishConfig": { "access": "public" @@ -30,5 +30,37 @@ "devDependencies": { "@webb-tools/sdk-core": "0.1.4-126", "chai": "^4.3.7" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/index.js", + "default": "./dist/index.js" + }, + "./bytes": { + "types": "./dist/bytes/index.d.ts", + "require": "./dist/bytes/index.js", + "default": "./dist/bytes/index.js" + }, + "./proof": { + "types": "./dist/proof/index.d.ts", + "require": "./dist/proof/index.js", + "default": "./dist/proof/index.js" + }, + "./protocol": { + "types": "./dist/protocol/index.d.ts", + "require": "./dist/protocol/index.js", + "default": "./dist/protocol/index.js" + }, + "./fixtures": { + "types": "./dist/fixtures.d.ts", + "require": "./dist/fixtures.js", + "default": "./dist/fixtures.js" + }, + "./utils": { + "types": "./dist/utils.d.ts", + "require": "./dist/utils.js", + "default": "./dist/utils.js" + } } } diff --git a/yarn.lock b/yarn.lock index 63b3f0b3..0fb9d993 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5736,6 +5736,13 @@ circom_runtime@0.1.22: dependencies: ffjavascript "0.2.57" +circom_runtime@0.1.24: + version "0.1.24" + resolved "https://registry.yarnpkg.com/circom_runtime/-/circom_runtime-0.1.24.tgz#60ca8a31c3675802fbab5a0bcdeb02556e510733" + integrity sha512-H7/7I2J/cBmRnZm9docOCGhfxzS61BEm4TMCWcrZGsWNBQhePNfQq88Oj2XpUfzmBTCd8pRvRb3Mvazt3TMrJw== + dependencies: + ffjavascript "0.2.60" + circomlib@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/circomlib/-/circomlib-2.0.5.tgz#183c703e53ed7d011811842dbeeeb9819f4cc1d6" @@ -7977,6 +7984,24 @@ ffjavascript@0.2.57: wasmcurves "0.2.0" web-worker "^1.2.0" +ffjavascript@0.2.60: + version "0.2.60" + resolved "https://registry.yarnpkg.com/ffjavascript/-/ffjavascript-0.2.60.tgz#4d8ae613d6bf4e98b3cc29ba10c626f5853854cf" + integrity sha512-T/9bnEL5xAZRDbQoEMf+pM9nrhK+C3JyZNmqiWub26EQorW7Jt+jR54gpqDhceA4Nj0YctPQwYnl8xa52/A26A== + dependencies: + wasmbuilder "0.0.16" + wasmcurves "0.2.2" + web-worker "^1.2.0" + +ffjavascript@0.2.62: + version "0.2.62" + resolved "https://registry.yarnpkg.com/ffjavascript/-/ffjavascript-0.2.62.tgz#f508dfe662a70181598ec5eb8ce5127eb342f624" + integrity sha512-uJ7MTrdzhX/3f+hxn0XhdXbJCqYZJSBB6y2/ui4t21vKYVjyTMlU80pPXu40ir6qpqbrdzUeKdlOdJ0aFG9UNA== + dependencies: + wasmbuilder "0.0.16" + wasmcurves "0.2.2" + web-worker "^1.2.0" + ffjavascript@^0.2.38, ffjavascript@^0.2.48, ffjavascript@^0.2.57: version "0.2.59" resolved "https://registry.yarnpkg.com/ffjavascript/-/ffjavascript-0.2.59.tgz#b2f836082587fab333dfb181b909a188f80036f3" @@ -13079,6 +13104,16 @@ r1csfile@0.0.45: fastfile "0.0.20" ffjavascript "0.2.57" +r1csfile@0.0.47: + version "0.0.47" + resolved "https://registry.yarnpkg.com/r1csfile/-/r1csfile-0.0.47.tgz#ed95a0dc8e910e9c070253906f7a31bd8c5333c8" + integrity sha512-oI4mAwuh1WwuFg95eJDNDDL8hCaZkwnPuNZrQdLBWvDoRU7EG+L/MOHL7SwPW2Y+ZuYcTLpj3rBkgllBQZN/JA== + dependencies: + "@iden3/bigarray" "0.0.2" + "@iden3/binfileutils" "0.0.11" + fastfile "0.0.20" + ffjavascript "0.2.60" + randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -14148,6 +14183,22 @@ snarkjs@^0.6.10: logplease "^1.2.15" r1csfile "0.0.45" +snarkjs@^0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/snarkjs/-/snarkjs-0.7.2.tgz#ab719b065fcd9867d9ea14bed92f3acdca3c766f" + integrity sha512-A8yPFm9pRnZ7XYXfPSjSFnugEV1rsHGjb8W7c0Qk7nzXl5h3WANTkpVC5FYxakmw/GKWekz7wjjHaOFtPp823Q== + dependencies: + "@iden3/binfileutils" "0.0.11" + bfj "^7.0.2" + blake2b-wasm "^2.4.0" + circom_runtime "0.1.24" + ejs "^3.1.6" + fastfile "0.0.20" + ffjavascript "0.2.62" + js-sha3 "^0.8.0" + logplease "^1.2.15" + r1csfile "0.0.47" + sockjs@^0.3.24: version "0.3.24" resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce" @@ -15661,6 +15712,13 @@ wasmcurves@0.2.1: dependencies: wasmbuilder "0.0.16" +wasmcurves@0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/wasmcurves/-/wasmcurves-0.2.2.tgz#ca444f6a6f6e2a5cbe6629d98ff478a62b4ccb2b" + integrity sha512-JRY908NkmKjFl4ytnTu5ED6AwPD+8VJ9oc94kdq7h5bIwbj0L4TDJ69mG+2aLs2SoCmGfqIesMWTEJjtYsoQXQ== + dependencies: + wasmbuilder "0.0.16" + watchpack@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d"