From ef12b74f3cb36a9b4da9f7fcfd0fc055232e0342 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 6 May 2024 14:25:06 -0400 Subject: [PATCH 01/21] use maci 0.0.0-ci.153326b: do not allow invalid pub key --- common/package.json | 4 +- contracts/package.json | 4 +- yarn.lock | 294 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 297 insertions(+), 5 deletions(-) diff --git a/common/package.json b/common/package.json index ee496d949..bd7caa4fb 100644 --- a/common/package.json +++ b/common/package.json @@ -23,8 +23,8 @@ "dependencies": { "@openzeppelin/merkle-tree": "^1.0.5", "ethers": "^6.11.1", - "maci-crypto": "^1.2.0", - "maci-domainobjs": "^1.2.0" + "maci-crypto": "0.0.0-ci.153326b", + "maci-domainobjs": "0.0.0-ci.153326b" }, "repository": { "type": "git", diff --git a/contracts/package.json b/contracts/package.json index 94bb91a88..4498c8aba 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -18,7 +18,7 @@ "@openzeppelin/contracts": "4.9.0", "@pinata/sdk": "^2.1.0", "dotenv": "^8.2.0", - "maci-contracts": "^1.2.0", + "maci-contracts": "0.0.0-ci.153326b", "solidity-rlp": "2.0.8" }, "devDependencies": { @@ -41,7 +41,7 @@ "ipfs-only-hash": "^2.0.1", "maci-circuits": "^1.2.0", "maci-cli": "^1.2.0", - "maci-domainobjs": "^1.2.0", + "maci-domainobjs": "0.0.0-ci.153326b", "mocha": "^10.2.0", "solidity-coverage": "^0.8.1", "ts-node": "^10.9.2", diff --git a/yarn.lock b/yarn.lock index 86e13a1f9..10adf18a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1912,6 +1912,14 @@ fastfile "0.0.20" ffjavascript "^0.2.48" +"@iden3/binfileutils@0.0.12": + version "0.0.12" + resolved "https://registry.yarnpkg.com/@iden3/binfileutils/-/binfileutils-0.0.12.tgz#3772552f57551814ff606fa68ea1e0ef52795ce3" + integrity sha512-naAmzuDufRIcoNfQ1d99d7hGHufLA3wZSibtr4dMe6ZeiOPV1KwOZWTJ1YVz4HbaWlpDuzVU72dS4ATQS4PXBQ== + dependencies: + fastfile "0.0.20" + ffjavascript "^0.3.0" + "@import-maps/resolve@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@import-maps/resolve/-/resolve-1.0.1.tgz#1e9fcadcf23aa0822256a329aabca241879d37c9" @@ -2674,6 +2682,54 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@nomicfoundation/edr-darwin-arm64@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.3.7.tgz#c204edc79643624dbd431b489b254778817d8244" + integrity sha512-6tK9Lv/lSfyBvpEQ4nsTfgxyDT1y1Uv/x8Wa+aB+E8qGo3ToexQ1BMVjxJk6PChXCDOWxB3B4KhqaZFjdhl3Ow== + +"@nomicfoundation/edr-darwin-x64@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.3.7.tgz#c3b394445084270cc5250d6c1869b0574e7ef810" + integrity sha512-1RrQ/1JPwxrYO69e0tglFv5H+ggour5Ii3bb727+yBpBShrxtOTQ7fZyfxA5h62LCN+0Z9wYOPeQ7XFcVurMaQ== + +"@nomicfoundation/edr-linux-arm64-gnu@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.3.7.tgz#6d65545a44d1323bb7ab08c3306947165d2071de" + integrity sha512-ds/CKlBoVXIihjhflhgPn13EdKWed6r5bgvMs/YwRqT5wldQAQJZWAfA2+nYm0Yi2gMGh1RUpBcfkyl4pq7G+g== + +"@nomicfoundation/edr-linux-arm64-musl@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.3.7.tgz#5368534bceac1a8c18b1be6b908caca5d39b0c03" + integrity sha512-e29udiRaPujhLkM3+R6ju7QISrcyOqpcaxb2FsDWBkuD7H8uU9JPZEyyUIpEp5uIY0Jh1eEJPKZKIXQmQAEAuw== + +"@nomicfoundation/edr-linux-x64-gnu@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.3.7.tgz#42349bf5941dbb54a5719942924c6e4e8cde348e" + integrity sha512-/xkjmTyv+bbJ4akBCW0qzFKxPOV4AqLOmqurov+s9umHb16oOv72osSa3SdzJED2gHDaKmpMITT4crxbar4Axg== + +"@nomicfoundation/edr-linux-x64-musl@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.3.7.tgz#e6babe11c9a8012f1284e6e48c3551861f2a7cd4" + integrity sha512-QwBP9xlmsbf/ldZDGLcE4QiAb8Zt46E/+WLpxHBATFhGa7MrpJh6Zse+h2VlrT/SYLPbh2cpHgSmoSlqVxWG9g== + +"@nomicfoundation/edr-win32-x64-msvc@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.3.7.tgz#1504b98f305f03be153b0220a546985660de9dc6" + integrity sha512-j/80DEnkxrF2ewdbk/gQ2EOPvgF0XSsg8D0o4+6cKhUVAW6XwtWKzIphNL6dyD2YaWEPgIrNvqiJK/aln0ww4Q== + +"@nomicfoundation/edr@^0.3.5": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.3.7.tgz#9c75edf1fcf601617905b2c89acf103f4786d017" + integrity sha512-v2JFWnFKRsnOa6PDUrD+sr8amcdhxnG/YbL7LzmgRGU1odWEyOF4/EwNeUajQr4ZNKVWrYnJ6XjydXtUge5OBQ== + optionalDependencies: + "@nomicfoundation/edr-darwin-arm64" "0.3.7" + "@nomicfoundation/edr-darwin-x64" "0.3.7" + "@nomicfoundation/edr-linux-arm64-gnu" "0.3.7" + "@nomicfoundation/edr-linux-arm64-musl" "0.3.7" + "@nomicfoundation/edr-linux-x64-gnu" "0.3.7" + "@nomicfoundation/edr-linux-x64-musl" "0.3.7" + "@nomicfoundation/edr-win32-x64-msvc" "0.3.7" + "@nomicfoundation/ethereumjs-block@5.0.2": version "5.0.2" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz#13a7968f5964f1697da941281b7f7943b0465d04" @@ -2974,6 +3030,11 @@ resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-4.0.0.tgz#eb1f619218dd1414fa161dfec92d3e5e53a2f407" integrity sha512-jhcWHp0aHaL0aDYj8IJl80v4SZXWMS1A2XxXa1CA6pBiFfJKuZinCkO6wb+POAt0LIfXB3gA3AgdcOccrcwBwA== +"@nomicfoundation/hardhat-toolbox@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-5.0.0.tgz#165b47f8a3d2bf668cc5d453ce7f496a1156948d" + integrity sha512-FnUtUC5PsakCbwiVNsqlXVIWG5JIb5CEZoSXbJUsEBun22Bivx2jhF1/q9iQbzuaGpJKFQyOhemPB2+XlEE6pQ== + "@nomicfoundation/hardhat-verify@^2.0.3": version "2.0.3" resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.3.tgz#173557f8cfa53c8c9da23a326f54d24fe459ae68" @@ -3282,6 +3343,11 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.5.tgz#1eed23d4844c861a1835b5d33507c1017fa98de8" integrity sha512-ZK+W5mVhRppff9BE6YdR8CC52C8zAvsVAiWhEtQ5+oNxFE6h1WdeWo+FJSF8KKvtxxVYZ7MTP/5KoVpAU3aSWg== +"@openzeppelin/contracts@^5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.0.2.tgz#b1d03075e49290d06570b2fd42154d76c2a5d210" + integrity sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA== + "@openzeppelin/merkle-tree@^1.0.5": version "1.0.5" resolved "https://registry.yarnpkg.com/@openzeppelin/merkle-tree/-/merkle-tree-1.0.5.tgz#4836d377777a7e39f31674f06ec3d6909def7913" @@ -4963,6 +5029,20 @@ dependencies: "@zk-kit/utils" "0.1.0" +"@zk-kit/baby-jubjub@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@zk-kit/baby-jubjub/-/baby-jubjub-0.2.0.tgz#71c5396ddacb97e4e3db677933f74bde3332b236" + integrity sha512-pqiPq621oKpwiIkf1KcVh5MdbFX0V67s9gCmiEkhLMeafZaIXEwVt5qmIu1d2HB4mjXgr4Ys8Jpn2Rw4KXxnFQ== + dependencies: + "@zk-kit/utils" "0.3.0" + +"@zk-kit/baby-jubjub@0.3.0", "@zk-kit/baby-jubjub@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@zk-kit/baby-jubjub/-/baby-jubjub-0.3.0.tgz#78b8d3226670dd02dc8ced713aec64d6bb2a6e62" + integrity sha512-mA3/M/+4C2vDtc0SpXf/q/nsvwBh+s42ou176sgDzqIBQD/u/N+LaLGorDh+X5AD3dVMHb8rheFpnnrJmjsqdA== + dependencies: + "@zk-kit/utils" "0.6.0" + "@zk-kit/circuits@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@zk-kit/circuits/-/circuits-0.3.0.tgz#716d932e9b09f33c71c7ff940a507e519ce0a6f4" @@ -4970,6 +5050,22 @@ dependencies: circomlib "^2.0.5" +"@zk-kit/circuits@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@zk-kit/circuits/-/circuits-0.4.0.tgz#17a8333e8afe5a4e79260600a2dcefb2bc751a8f" + integrity sha512-Di7mokhwBS3qxVeCfHxGeNIpDg1kTnr1JXmsWiQMZLkRTn3Hugh6Tl07J394rWD0pIWRwPQsinaMVL2sB4F8yQ== + dependencies: + circomlib "^2.0.5" + +"@zk-kit/eddsa-poseidon@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@zk-kit/eddsa-poseidon/-/eddsa-poseidon-0.11.0.tgz#f648b50a79ce660df75896d8fafa30c0f6eb9a43" + integrity sha512-8XgIVSD+nTnTEjvdrFVvju6lVQ5rxCfkBnf/nCFN/IteiIpYX7LnxrTOV7pIp3RrWL29WuTvNrT8TlBrHRrUFA== + dependencies: + "@zk-kit/baby-jubjub" "0.3.0" + "@zk-kit/utils" "0.8.1" + buffer "6.0.3" + "@zk-kit/eddsa-poseidon@^0.5.1": version "0.5.1" resolved "https://registry.yarnpkg.com/@zk-kit/eddsa-poseidon/-/eddsa-poseidon-0.5.1.tgz#7fef431f441f5385f82e6005cdf83d72d298e8c2" @@ -4986,11 +5082,38 @@ "@zk-kit/baby-jubjub" "0.1.1" "@zk-kit/utils" "0.1.0" +"@zk-kit/poseidon-cipher@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@zk-kit/poseidon-cipher/-/poseidon-cipher-0.3.0.tgz#e05a5d8a39a2d3a9aadb1b9997c2580713eacfff" + integrity sha512-Byszt7dxssgsR7hog2nf9AMaBKYr8LrgtlU/PPHPEe2OkJwIeQSshoxqquLlZsyfOn2c1ZmTJb4Mo4aHY11pCA== + dependencies: + "@zk-kit/baby-jubjub" "0.2.0" + "@zk-kit/utils" "0.3.0" + "@zk-kit/utils@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@zk-kit/utils/-/utils-0.1.0.tgz#6c134c22541efc6e634d4a89884c8bfe209b2da1" integrity sha512-MZmuw2w2StB7XOSNg1TW4VwnBJ746UDmdXTvxwDO/U85UZfGfM3zb53gG35qz5sWpQo/DjfoKqaScmh6HUtQpA== +"@zk-kit/utils@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@zk-kit/utils/-/utils-0.3.0.tgz#ca85ab40540ee76b3a09b91df66a55d7f319a71d" + integrity sha512-yVBczOwOSV+evSgdsJ0tpPn3oQpbL7a7fRqANDogleaLLte1IFxKTFLz3WNcgd28Asq2guMGiU6SmiEc61uHAg== + +"@zk-kit/utils@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@zk-kit/utils/-/utils-0.6.0.tgz#30124e98df8e29f7af31e19ce4dc6302f178c0a4" + integrity sha512-sUF1yVjlGmm7/NIN/+d+N8WOcI77bTzgV5+vZmp/S7lXcy4fmO+5TdHERRsDbs8Ep8K33EOC6V+U+JXzmjSe5A== + dependencies: + buffer "^6.0.3" + +"@zk-kit/utils@0.8.1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@zk-kit/utils/-/utils-0.8.1.tgz#9d358542e6b223dde35f32f3e161d1d3a41b0644" + integrity sha512-m5cvnYo5IBZQCO8H5X0Mw3rGRGEoSqlYXVVF1+4M9IT3olDWcJHLPRqtYGF9zNf+vXV/21srpZ0hX3X2Lzp1TQ== + dependencies: + buffer "^6.0.3" + JSONStream@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" @@ -6896,7 +7019,7 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -"buffer-polyfill@npm:buffer@^6.0.3", buffer@^6.0.1, buffer@^6.0.3: +"buffer-polyfill@npm:buffer@^6.0.3", buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.3: name buffer-polyfill version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" @@ -7407,6 +7530,13 @@ circom_runtime@0.1.24: dependencies: ffjavascript "0.2.60" +circom_runtime@0.1.25: + version "0.1.25" + resolved "https://registry.yarnpkg.com/circom_runtime/-/circom_runtime-0.1.25.tgz#62a33b371f4633f30238db7a326c43d988e3a170" + integrity sha512-xBGsBFF5Uv6AKvbpgExYqpHfmfawH2HKe+LyjfKSRevqEV8u63i9KGHVIILsbJNW+0c5bm/66f0PUYQ7qZSkJA== + dependencies: + ffjavascript "0.3.0" + circom_tester@^0.0.19: version "0.0.19" resolved "https://registry.yarnpkg.com/circom_tester/-/circom_tester-0.0.19.tgz#e8bed494d080f8186bd0ac6571755d00ccec83bd" @@ -7431,6 +7561,16 @@ circomkit@^0.0.24: loglevel "^1.8.1" snarkjs "^0.7.0" +circomkit@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/circomkit/-/circomkit-0.1.0.tgz#f44cf86d46b3a3dff5a4958b6450f494d6fa9970" + integrity sha512-Mnc9IuOoaN7FitfURvbg2Q5j62S7/zQl6l18u5dcIhZg3Ot9MZYLiGIotCaF1Gfp/vAUKnvO2lnS3Xc1TdTISA== + dependencies: + chai "^4.3.7" + circom_tester "^0.0.19" + loglevel "^1.8.1" + snarkjs "^0.7.0" + circomlib@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/circomlib/-/circomlib-2.0.5.tgz#183c703e53ed7d011811842dbeeeb9819f4cc1d6" @@ -10182,6 +10322,19 @@ ethers@^6.11.1: tslib "2.4.0" ws "8.5.0" +ethers@^6.12.0: + version "6.12.1" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.12.1.tgz#517ff6d66d4fd5433e38e903051da3e57c87ff37" + integrity sha512-j6wcVoZf06nqEcBbDWkKg8Fp895SS96dSnTCjiXT+8vt2o02raTn4Lo9ERUuIVU5bAjoPYeA+7ytQFexFmLuVw== + dependencies: + "@adraffy/ens-normalize" "1.10.1" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@types/node" "18.15.13" + aes-js "4.0.0-beta.5" + tslib "2.4.0" + ws "8.5.0" + ethers@^6.9.2: version "6.10.0" resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.10.0.tgz#20f3c63c60d59a993f8090ad423d8a3854b3b1cd" @@ -10708,6 +10861,15 @@ ffjavascript@0.2.63, ffjavascript@^0.2.45, ffjavascript@^0.2.48, ffjavascript@^0 wasmcurves "0.2.2" web-worker "1.2.0" +ffjavascript@0.3.0, ffjavascript@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/ffjavascript/-/ffjavascript-0.3.0.tgz#442cd8fbb1ee4cbb1be9d26fd7b2951a1ea45d6a" + integrity sha512-l7sR5kmU3gRwDy8g0Z2tYBXy5ttmafRPFOqY7S6af5cq51JqJWt5eQ/lSR/rs2wQNbDYaYlQr5O+OSUf/oMLoQ== + dependencies: + wasmbuilder "0.0.16" + wasmcurves "0.2.2" + web-worker "1.2.0" + figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" @@ -12016,6 +12178,55 @@ hardhat@^2.20.1: uuid "^8.3.2" ws "^7.4.6" +hardhat@^2.22.3: + version "2.22.3" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.3.tgz#50605daca6b29862397e446c42ec14c89430bec3" + integrity sha512-k8JV2ECWNchD6ahkg2BR5wKVxY0OiKot7fuxiIpRK0frRqyOljcR2vKwgWSLw6YIeDcNNA4xybj7Og7NSxr2hA== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@metamask/eth-sig-util" "^4.0.0" + "@nomicfoundation/edr" "^0.3.5" + "@nomicfoundation/ethereumjs-common" "4.0.4" + "@nomicfoundation/ethereumjs-tx" "5.0.4" + "@nomicfoundation/ethereumjs-util" "9.0.4" + "@nomicfoundation/solidity-analyzer" "^0.1.0" + "@sentry/node" "^5.18.1" + "@types/bn.js" "^5.1.0" + "@types/lru-cache" "^5.1.0" + adm-zip "^0.4.16" + aggregate-error "^3.0.0" + ansi-escapes "^4.3.0" + boxen "^5.1.2" + chalk "^2.4.2" + chokidar "^3.4.0" + ci-info "^2.0.0" + debug "^4.1.1" + enquirer "^2.3.0" + env-paths "^2.2.0" + ethereum-cryptography "^1.0.3" + ethereumjs-abi "^0.6.8" + find-up "^2.1.0" + fp-ts "1.19.3" + fs-extra "^7.0.1" + glob "7.2.0" + immutable "^4.0.0-rc.12" + io-ts "1.10.4" + keccak "^3.0.2" + lodash "^4.17.11" + mnemonist "^0.38.0" + mocha "^10.0.0" + p-map "^4.0.0" + raw-body "^2.4.1" + resolve "1.17.0" + semver "^6.3.0" + solc "0.7.3" + source-map-support "^0.5.13" + stacktrace-parser "^0.1.10" + tsort "0.0.1" + undici "^5.14.0" + uuid "^8.3.2" + ws "^7.4.6" + has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -14917,6 +15128,19 @@ luxon@^3.1.1, luxon@^3.2.1: resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.4.4.tgz#cf20dc27dc532ba41a169c43fdcc0063601577af" integrity sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA== +maci-circuits@0.0.0-ci.153326b: + version "0.0.0-ci.153326b" + resolved "https://registry.yarnpkg.com/maci-circuits/-/maci-circuits-0.0.0-ci.153326b.tgz#9958949f675b466c8f0fd7da4d12467012ca1dbb" + integrity sha512-9WYp1465Xelujo4GLpiLqgVdsia2VAl7FEpRMZOJeEJlbl8RUYLBTFlR9X9fBL3sNjoPNFSiswrVoCgmiQEi8A== + dependencies: + "@zk-kit/circuits" "^0.4.0" + circomkit "^0.1.0" + circomlib "^2.0.5" + maci-core "0.0.0-ci.153326b" + maci-crypto "0.0.0-ci.153326b" + maci-domainobjs "0.0.0-ci.153326b" + snarkjs "^0.7.4" + maci-circuits@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/maci-circuits/-/maci-circuits-1.2.0.tgz#9b1f9c64d48e4dc3c3c7c8ffc4d0f254d60cce3e" @@ -14948,6 +15172,23 @@ maci-cli@^1.2.0: maci-domainobjs "^1.2.0" prompt "^1.3.0" +maci-contracts@0.0.0-ci.153326b: + version "0.0.0-ci.153326b" + resolved "https://registry.yarnpkg.com/maci-contracts/-/maci-contracts-0.0.0-ci.153326b.tgz#4c1d3cc1c5a89cbbe852439a1e81646e8b0dc302" + integrity sha512-DFo8xLR/Ia/CcSFXYjHfMCfaN/GnhNMxVgcRu1EQBY8DzWMs/MBHEYnH/LBpT/r5QscY0kyk45lMdKA24xHsFA== + dependencies: + "@nomicfoundation/hardhat-ethers" "^3.0.5" + "@nomicfoundation/hardhat-toolbox" "^5.0.0" + "@openzeppelin/contracts" "^5.0.2" + circomlibjs "^0.1.7" + ethers "^6.12.0" + hardhat "^2.22.3" + maci-circuits "0.0.0-ci.153326b" + maci-core "0.0.0-ci.153326b" + maci-crypto "0.0.0-ci.153326b" + maci-domainobjs "0.0.0-ci.153326b" + solidity-docgen "^0.6.0-beta.36" + maci-contracts@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/maci-contracts/-/maci-contracts-1.2.0.tgz#a724b3e757d2402442d822c34a5221660ef43b94" @@ -14965,6 +15206,14 @@ maci-contracts@^1.2.0: maci-domainobjs "^1.2.0" solidity-docgen "^0.6.0-beta.36" +maci-core@0.0.0-ci.153326b: + version "0.0.0-ci.153326b" + resolved "https://registry.yarnpkg.com/maci-core/-/maci-core-0.0.0-ci.153326b.tgz#08cb39ab66b2e528da319d64e2194c4b1c2fca01" + integrity sha512-lrkPm/gIcHbVO3+tuGnvNdc/Gy5jD0+5biG13RmdIfFiXnND0vD7aX5x45HY4mNK1TUrlS8ZMVHSjY4voeiieg== + dependencies: + maci-crypto "0.0.0-ci.153326b" + maci-domainobjs "0.0.0-ci.153326b" + maci-core@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/maci-core/-/maci-core-1.2.0.tgz#57ff4b92c457f42a3043fe5b34cfef98a9ac1cf5" @@ -14973,6 +15222,16 @@ maci-core@^1.2.0: maci-crypto "^1.2.0" maci-domainobjs "^1.2.0" +maci-crypto@0.0.0-ci.153326b: + version "0.0.0-ci.153326b" + resolved "https://registry.yarnpkg.com/maci-crypto/-/maci-crypto-0.0.0-ci.153326b.tgz#4d0d2e72dd0aa6dba30d24e2c873729a5706bb8e" + integrity sha512-80QCpFdMts3rgfUn0fSQq0BFsuALOAYRH+MLWWDVTQXu1LtXZ4ikwq4DvD0ZuUDHjf9GgAmsQGQbi/Raa6q0bQ== + dependencies: + "@zk-kit/baby-jubjub" "^0.3.0" + "@zk-kit/eddsa-poseidon" "^0.11.0" + "@zk-kit/poseidon-cipher" "^0.3.0" + ethers "^6.12.0" + maci-crypto@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/maci-crypto/-/maci-crypto-1.2.0.tgz#b894810fa2ab379d93f77a2518f55abfe2f22dbe" @@ -14983,6 +15242,13 @@ maci-crypto@^1.2.0: "@zk-kit/poseidon-cipher" "^0.2.1" ethers "^6.11.1" +maci-domainobjs@0.0.0-ci.153326b: + version "0.0.0-ci.153326b" + resolved "https://registry.yarnpkg.com/maci-domainobjs/-/maci-domainobjs-0.0.0-ci.153326b.tgz#546649c1b6e29748bc79c77b46081433a8d22876" + integrity sha512-utPsFPC6a6Q8LwtBqTQvzBOsUroprvFoCHy5sTRoRvKsSGLwTibkcYMzmxF5A+tnFJ4n9CKCrr6UF/6Mzc2dlw== + dependencies: + maci-crypto "0.0.0-ci.153326b" + maci-domainobjs@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/maci-domainobjs/-/maci-domainobjs-1.2.0.tgz#27a6a9e05b3712e54c48dd080dcfc0c1d6035f93" @@ -17827,6 +18093,16 @@ r1csfile@0.0.47: fastfile "0.0.20" ffjavascript "0.2.60" +r1csfile@0.0.48: + version "0.0.48" + resolved "https://registry.yarnpkg.com/r1csfile/-/r1csfile-0.0.48.tgz#a317fc75407a9da92631666c75bdfc13f0a7835a" + integrity sha512-kHRkKUJNaor31l05f2+RFzvcH5XSa7OfEfd/l4hzjte6NL6fjRkSMfZ4BjySW9wmfdwPOtq3mXurzPvPGEf5Tw== + dependencies: + "@iden3/bigarray" "0.0.2" + "@iden3/binfileutils" "0.0.12" + fastfile "0.0.20" + ffjavascript "0.3.0" + rabin-wasm@~0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/rabin-wasm/-/rabin-wasm-0.0.8.tgz#5b61b1d519d0377453435fbca5f82510b3f956cb" @@ -19080,6 +19356,22 @@ snarkjs@^0.7.0, snarkjs@^0.7.3: logplease "^1.2.15" r1csfile "0.0.47" +snarkjs@^0.7.4: + version "0.7.4" + resolved "https://registry.yarnpkg.com/snarkjs/-/snarkjs-0.7.4.tgz#b9ad5813f055ab84d33f1831a6f1f34a71b6cd46" + integrity sha512-x4cOCR4YXSyBlLtfnUUwfbZrw8wFd/Y0lk83eexJzKwZB8ELdpH+10ts8YtDsm2/a3WK7c7p514bbE8NpqxW8w== + dependencies: + "@iden3/binfileutils" "0.0.12" + bfj "^7.0.2" + blake2b-wasm "^2.4.0" + circom_runtime "0.1.25" + ejs "^3.1.6" + fastfile "0.0.20" + ffjavascript "0.3.0" + js-sha3 "^0.8.0" + logplease "^1.2.15" + r1csfile "0.0.48" + solc@0.7.3: version "0.7.3" resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" From 3969baca810a1e84643a40d3a4efc4a950a2526a Mon Sep 17 00:00:00 2001 From: yuetloo Date: Thu, 9 May 2024 10:52:11 -0400 Subject: [PATCH 02/21] verify validity of public key using babyjubjub function --- common/package.json | 4 +- contracts/contracts/maci/BabyJubJub.sol | 136 ++++++++ contracts/contracts/maci/Poll.sol | 286 +++++++++++++++++ contracts/contracts/maci/PollFactory.sol | 73 +++++ contracts/e2e/index.ts | 14 +- contracts/package.json | 4 +- .../tasks/helpers/ConstructorArguments.ts | 8 +- contracts/tasks/runners/claim.ts | 9 +- contracts/tasks/runners/contribute.ts | 7 +- contracts/tasks/runners/finalize.ts | 7 +- .../tasks/runners/publishTallyResults.ts | 12 +- contracts/tests/deployer.ts | 14 +- contracts/tests/round.ts | 10 +- contracts/utils/contracts.ts | 44 ++- yarn.lock | 300 +----------------- 15 files changed, 607 insertions(+), 321 deletions(-) create mode 100644 contracts/contracts/maci/BabyJubJub.sol create mode 100644 contracts/contracts/maci/Poll.sol create mode 100644 contracts/contracts/maci/PollFactory.sol diff --git a/common/package.json b/common/package.json index bd7caa4fb..d7f3da4a5 100644 --- a/common/package.json +++ b/common/package.json @@ -23,8 +23,8 @@ "dependencies": { "@openzeppelin/merkle-tree": "^1.0.5", "ethers": "^6.11.1", - "maci-crypto": "0.0.0-ci.153326b", - "maci-domainobjs": "0.0.0-ci.153326b" + "maci-crypto": "1.2.0", + "maci-domainobjs": "1.2.0" }, "repository": { "type": "git", diff --git a/contracts/contracts/maci/BabyJubJub.sol b/contracts/contracts/maci/BabyJubJub.sol new file mode 100644 index 000000000..7d046b624 --- /dev/null +++ b/contracts/contracts/maci/BabyJubJub.sol @@ -0,0 +1,136 @@ +// @note This code was taken from +// https://github.com/privacy-scaling-explorations/maci/blob/dc18e2f046cf160f846f003c04ec4dfac502f6ae/contracts/contracts/crypto/BabyJubJub.sol +// TODO remove this and use MACI npm package when version greater than 1.2.0 is released + +// SPDX-License-Identifier: MIT +pragma solidity 0.8.10; + +library CurveBabyJubJub { + // Curve parameters + // E: 168700x^2 + y^2 = 1 + 168696x^2y^2 + // A = 168700 + uint256 public constant A = 0x292FC; + // D = 168696 + uint256 public constant D = 0x292F8; + // Prime Q = 21888242871839275222246405745257275088548364400416034343698204186575808495617 + uint256 public constant Q = 0x30644E72E131A029B85045B68181585D2833E84879B9709143E1F593F0000001; + + /** + * @dev Add 2 points on baby jubjub curve + * Formula for adding 2 points on a twisted Edwards curve: + * x3 = (x1y2 + y1x2) / (1 + dx1x2y1y2) + * y3 = (y1y2 - ax1x2) / (1 - dx1x2y1y2) + */ + function pointAdd(uint256 _x1, uint256 _y1, uint256 _x2, uint256 _y2) internal view returns (uint256 x3, uint256 y3) { + if (_x1 == 0 && _y1 == 0) { + return (_x2, _y2); + } + + if (_x2 == 0 && _y1 == 0) { + return (_x1, _y1); + } + + uint256 x1x2 = mulmod(_x1, _x2, Q); + uint256 y1y2 = mulmod(_y1, _y2, Q); + uint256 dx1x2y1y2 = mulmod(D, mulmod(x1x2, y1y2, Q), Q); + uint256 x3Num = addmod(mulmod(_x1, _y2, Q), mulmod(_y1, _x2, Q), Q); + uint256 y3Num = submod(y1y2, mulmod(A, x1x2, Q), Q); + + x3 = mulmod(x3Num, inverse(addmod(1, dx1x2y1y2, Q)), Q); + y3 = mulmod(y3Num, inverse(submod(1, dx1x2y1y2, Q)), Q); + } + + /** + * @dev Double a point on baby jubjub curve + * Doubling can be performed with the same formula as addition + */ + function pointDouble(uint256 _x1, uint256 _y1) internal view returns (uint256 x2, uint256 y2) { + return pointAdd(_x1, _y1, _x1, _y1); + } + + /** + * @dev Multiply a point on baby jubjub curve by a scalar + * Use the double and add algorithm + */ + function pointMul(uint256 _x1, uint256 _y1, uint256 _d) internal view returns (uint256 x2, uint256 y2) { + uint256 remaining = _d; + + uint256 px = _x1; + uint256 py = _y1; + uint256 ax = 0; + uint256 ay = 0; + + while (remaining != 0) { + if ((remaining & 1) != 0) { + // Binary digit is 1 so add + (ax, ay) = pointAdd(ax, ay, px, py); + } + + (px, py) = pointDouble(px, py); + + remaining = remaining / 2; + } + + x2 = ax; + y2 = ay; + } + + /** + * @dev Check if a given point is on the curve + * (168700x^2 + y^2) - (1 + 168696x^2y^2) == 0 + */ + function isOnCurve(uint256 _x, uint256 _y) internal pure returns (bool) { + uint256 xSq = mulmod(_x, _x, Q); + uint256 ySq = mulmod(_y, _y, Q); + uint256 lhs = addmod(mulmod(A, xSq, Q), ySq, Q); + uint256 rhs = addmod(1, mulmod(mulmod(D, xSq, Q), ySq, Q), Q); + return submod(lhs, rhs, Q) == 0; + } + + /** + * @dev Perform modular subtraction + */ + function submod(uint256 _a, uint256 _b, uint256 _mod) internal pure returns (uint256) { + uint256 aNN = _a; + + if (_a <= _b) { + aNN += _mod; + } + + return addmod(aNN - _b, 0, _mod); + } + + /** + * @dev Compute modular inverse of a number + */ + function inverse(uint256 _a) internal view returns (uint256) { + // We can use Euler's theorem instead of the extended Euclidean algorithm + // Since m = Q and Q is prime we have: a^-1 = a^(m - 2) (mod m) + return expmod(_a, Q - 2, Q); + } + + /** + * @dev Helper function to call the bigModExp precompile + */ + function expmod(uint256 _b, uint256 _e, uint256 _m) internal view returns (uint256 o) { + assembly { + let memPtr := mload(0x40) + mstore(memPtr, 0x20) // Length of base _b + mstore(add(memPtr, 0x20), 0x20) // Length of exponent _e + mstore(add(memPtr, 0x40), 0x20) // Length of modulus _m + mstore(add(memPtr, 0x60), _b) // Base _b + mstore(add(memPtr, 0x80), _e) // Exponent _e + mstore(add(memPtr, 0xa0), _m) // Modulus _m + + // The bigModExp precompile is at 0x05 + let success := staticcall(gas(), 0x05, memPtr, 0xc0, memPtr, 0x20) + switch success + case 0 { + revert(0x0, 0x0) + } + default { + o := mload(memPtr) + } + } + } +} diff --git a/contracts/contracts/maci/Poll.sol b/contracts/contracts/maci/Poll.sol new file mode 100644 index 000000000..1306c7698 --- /dev/null +++ b/contracts/contracts/maci/Poll.sol @@ -0,0 +1,286 @@ +// @note This code was taken from maci-contracts v1.2.0 with public key validation from +// https://github.com/privacy-scaling-explorations/maci/blob/dc18e2f046cf160f846f003c04ec4dfac502f6ae/contracts/contracts/Poll.sol +// TODO remove this and use MACI npm package when version greater than 1.2.0 is released + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.10; + +import { Params } from "maci-contracts/contracts/utilities/Params.sol"; +import { SnarkCommon } from "maci-contracts/contracts/crypto/SnarkCommon.sol"; +import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; +import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import { EmptyBallotRoots } from "maci-contracts/contracts/trees/EmptyBallotRoots.sol"; +import { IPoll } from "maci-contracts/contracts/interfaces/IPoll.sol"; +import { Utilities } from "maci-contracts/contracts/utilities/Utilities.sol"; +import { CurveBabyJubJub } from "./BabyJubJub.sol"; + +/// @title Poll +/// @notice A Poll contract allows voters to submit encrypted messages +/// which can be either votes, key change messages or topup messages. +/// @dev Do not deploy this directly. Use PollFactory.deploy() which performs some +/// checks on the Poll constructor arguments. +contract Poll is Params, Utilities, SnarkCommon, Ownable, EmptyBallotRoots, IPoll { + using SafeERC20 for ERC20; + + /// @notice Whether the Poll has been initialized + bool internal isInit; + + /// @notice The coordinator's public key + PubKey public coordinatorPubKey; + + /// @notice Hash of the coordinator's public key + uint256 public immutable coordinatorPubKeyHash; + + /// @notice the state root of the state merkle tree + uint256 public mergedStateRoot; + + // The timestamp of the block at which the Poll was deployed + uint256 internal immutable deployTime; + + // The duration of the polling period, in seconds + uint256 internal immutable duration; + + /// @notice Whether the MACI contract's stateAq has been merged by this contract + bool public stateAqMerged; + + /// @notice Get the commitment to the state leaves and the ballots. This is + /// hash3(stateRoot, ballotRoot, salt). + /// Its initial value should be + /// hash(maciStateRootSnapshot, emptyBallotRoot, 0) + /// Each successful invocation of processMessages() should use a different + /// salt to update this value, so that an external observer cannot tell in + /// the case that none of the messages are valid. + uint256 public currentSbCommitment; + + /// @notice The number of messages that have been published + uint256 public numMessages; + + /// @notice The number of signups that have been processed + /// before the Poll ended (stateAq merged) + uint256 public numSignups; + + /// @notice Max values for the poll + MaxValues public maxValues; + + /// @notice Depths of the merkle trees + TreeDepths public treeDepths; + + /// @notice The contracts used by the Poll + ExtContracts public extContracts; + + error VotingPeriodOver(); + error VotingPeriodNotOver(); + error PollAlreadyInit(); + error TooManyMessages(); + error InvalidPubKey(); + error StateAqAlreadyMerged(); + error StateAqSubtreesNeedMerge(); + error InvalidBatchLength(); + + event PublishMessage(Message _message, PubKey _encPubKey); + event TopupMessage(Message _message); + event MergeMaciStateAqSubRoots(uint256 _numSrQueueOps); + event MergeMaciStateAq(uint256 _stateRoot, uint256 _numSignups); + event MergeMessageAqSubRoots(uint256 _numSrQueueOps); + event MergeMessageAq(uint256 _messageRoot); + + /// @notice Each MACI instance can have multiple Polls. + /// When a Poll is deployed, its voting period starts immediately. + /// @param _duration The duration of the voting period, in seconds + /// @param _maxValues The maximum number of messages and vote options + /// @param _treeDepths The depths of the merkle trees + /// @param _coordinatorPubKey The coordinator's public key + /// @param _extContracts The external contracts + constructor( + uint256 _duration, + MaxValues memory _maxValues, + TreeDepths memory _treeDepths, + PubKey memory _coordinatorPubKey, + ExtContracts memory _extContracts + ) payable { + // check that the coordinator public key is valid + if (!CurveBabyJubJub.isOnCurve(_coordinatorPubKey.x, _coordinatorPubKey.y)) { + revert InvalidPubKey(); + } + + // store the pub key as object then calculate the hash + coordinatorPubKey = _coordinatorPubKey; + // we hash it ourselves to ensure we store the correct value + coordinatorPubKeyHash = hashLeftRight(_coordinatorPubKey.x, _coordinatorPubKey.y); + // store the external contracts to interact with + extContracts = _extContracts; + // store duration of the poll + duration = _duration; + // store max values + maxValues = _maxValues; + // store tree depth + treeDepths = _treeDepths; + // Record the current timestamp + deployTime = block.timestamp; + } + + /// @notice A modifier that causes the function to revert if the voting period is + /// not over. + modifier isAfterVotingDeadline() { + uint256 secondsPassed = block.timestamp - deployTime; + if (secondsPassed <= duration) revert VotingPeriodNotOver(); + _; + } + + /// @notice A modifier that causes the function to revert if the voting period is + /// over + modifier isWithinVotingDeadline() { + uint256 secondsPassed = block.timestamp - deployTime; + if (secondsPassed >= duration) revert VotingPeriodOver(); + _; + } + + /// @notice The initialization function. + /// @dev Should be called immediately after Poll creation + /// and messageAq ownership transferred + function init() public { + if (isInit) revert PollAlreadyInit(); + // set to true so it cannot be called again + isInit = true; + + unchecked { + numMessages++; + } + + // init messageAq here by inserting placeholderLeaf + uint256[2] memory dat = [NOTHING_UP_MY_SLEEVE, 0]; + + (Message memory _message, PubKey memory _padKey, uint256 placeholderLeaf) = padAndHashMessage(dat, 1); + extContracts.messageAq.enqueue(placeholderLeaf); + + emit PublishMessage(_message, _padKey); + } + + /// @inheritdoc IPoll + function topup(uint256 stateIndex, uint256 amount) public virtual isWithinVotingDeadline { + // we check that we do not exceed the max number of messages + if (numMessages >= maxValues.maxMessages) revert TooManyMessages(); + + // cannot realistically overflow + unchecked { + numMessages++; + } + + /// @notice topupCredit is a trusted token contract which reverts if the transfer fails + extContracts.topupCredit.transferFrom(msg.sender, address(this), amount); + + uint256[2] memory dat = [stateIndex, amount]; + (Message memory _message, , uint256 messageLeaf) = padAndHashMessage(dat, 2); + + extContracts.messageAq.enqueue(messageLeaf); + + emit TopupMessage(_message); + } + + /// @inheritdoc IPoll + function publishMessage(Message memory _message, PubKey calldata _encPubKey) public virtual isWithinVotingDeadline { + // we check that we do not exceed the max number of messages + if (numMessages >= maxValues.maxMessages) revert TooManyMessages(); + + // validate that the public key is valid + if (!CurveBabyJubJub.isOnCurve(_encPubKey.x, _encPubKey.y)) { + revert InvalidPubKey(); + } + + // cannot realistically overflow + unchecked { + numMessages++; + } + + // we enforce that msgType here is 1 so we don't need checks + // at the circuit level + _message.msgType = 1; + + uint256 messageLeaf = hashMessageAndEncPubKey(_message, _encPubKey); + extContracts.messageAq.enqueue(messageLeaf); + + emit PublishMessage(_message, _encPubKey); + } + + /// @notice submit a message batch + /// @dev Can only be submitted before the voting deadline + /// @param _messages the messages + /// @param _encPubKeys the encrypted public keys + function publishMessageBatch(Message[] calldata _messages, PubKey[] calldata _encPubKeys) external { + if (_messages.length != _encPubKeys.length) { + revert InvalidBatchLength(); + } + + uint256 len = _messages.length; + for (uint256 i = 0; i < len; ) { + // an event will be published by this function already + publishMessage(_messages[i], _encPubKeys[i]); + + unchecked { + i++; + } + } + } + + /// @inheritdoc IPoll + function mergeMaciStateAqSubRoots(uint256 _numSrQueueOps, uint256 _pollId) public onlyOwner isAfterVotingDeadline { + // This function cannot be called after the stateAq was merged + if (stateAqMerged) revert StateAqAlreadyMerged(); + + // merge subroots + extContracts.maci.mergeStateAqSubRoots(_numSrQueueOps, _pollId); + + emit MergeMaciStateAqSubRoots(_numSrQueueOps); + } + + /// @inheritdoc IPoll + function mergeMaciStateAq(uint256 _pollId) public onlyOwner isAfterVotingDeadline { + // This function can only be called once per Poll after the voting + // deadline + if (stateAqMerged) revert StateAqAlreadyMerged(); + + // set merged to true so it cannot be called again + stateAqMerged = true; + + // the subtrees must have been merged first + if (!extContracts.maci.stateAq().subTreesMerged()) revert StateAqSubtreesNeedMerge(); + + mergedStateRoot = extContracts.maci.mergeStateAq(_pollId); + + // Set currentSbCommitment + uint256[3] memory sb; + sb[0] = mergedStateRoot; + sb[1] = emptyBallotRoots[treeDepths.voteOptionTreeDepth - 1]; + sb[2] = uint256(0); + + currentSbCommitment = hash3(sb); + + numSignups = extContracts.maci.numSignUps(); + emit MergeMaciStateAq(mergedStateRoot, numSignups); + } + + /// @inheritdoc IPoll + function mergeMessageAqSubRoots(uint256 _numSrQueueOps) public onlyOwner isAfterVotingDeadline { + extContracts.messageAq.mergeSubRoots(_numSrQueueOps); + emit MergeMessageAqSubRoots(_numSrQueueOps); + } + + /// @inheritdoc IPoll + function mergeMessageAq() public onlyOwner isAfterVotingDeadline { + uint256 root = extContracts.messageAq.merge(treeDepths.messageTreeDepth); + emit MergeMessageAq(root); + } + + /// @inheritdoc IPoll + function getDeployTimeAndDuration() public view returns (uint256 pollDeployTime, uint256 pollDuration) { + pollDeployTime = deployTime; + pollDuration = duration; + } + + /// @inheritdoc IPoll + function numSignUpsAndMessages() public view returns (uint256 numSUps, uint256 numMsgs) { + numSUps = numSignups; + numMsgs = numMessages; + } +} diff --git a/contracts/contracts/maci/PollFactory.sol b/contracts/contracts/maci/PollFactory.sol new file mode 100644 index 000000000..ad91b4305 --- /dev/null +++ b/contracts/contracts/maci/PollFactory.sol @@ -0,0 +1,73 @@ +// @note This code was taken from https://github.com/privacy-scaling-explorations/maci/blob/dc18e2f046cf160f846f003c04ec4dfac502f6ae/contracts/contracts/PollFactory.sol +// TODO remove this and use MACI npm package when version greater than 1.2.0 is released + +// SPDX-License-Identifier: MIT +pragma solidity 0.8.10; + + +import { IMACI } from "maci-contracts/contracts/interfaces/IMACI.sol"; +import { AccQueue } from "maci-contracts/contracts/trees/AccQueue.sol"; +import { AccQueueQuinaryMaci } from "maci-contracts/contracts/trees/AccQueueQuinaryMaci.sol"; +import { TopupCredit } from "maci-contracts/contracts/TopupCredit.sol"; +import { Params } from "maci-contracts/contracts/utilities/Params.sol"; +import { DomainObjs } from "maci-contracts/contracts/utilities/DomainObjs.sol"; +import { Poll } from "./Poll.sol"; +import { IPollFactory } from "maci-contracts/contracts/interfaces/IPollFactory.sol"; + +/// @title PollFactory +/// @notice A factory contract which deploys Poll contracts. It allows the MACI contract +/// size to stay within the limit set by EIP-170. +contract PollFactory is Params, DomainObjs, IPollFactory { + // The number of children each node in the message tree has + uint256 internal constant TREE_ARITY = 5; + + // custom error + error InvalidMaxValues(); + + /// @notice The PollFactory constructor + // solhint-disable-next-line no-empty-blocks + constructor() payable {} + + /// @inheritdoc IPollFactory + function deploy( + uint256 _duration, + MaxValues calldata _maxValues, + TreeDepths calldata _treeDepths, + PubKey calldata _coordinatorPubKey, + address _maci, + TopupCredit _topupCredit, + address _pollOwner + ) public virtual returns (address pollAddr) { + /// @notice Validate _maxValues + /// maxVoteOptions must be less than 2 ** 50 due to circuit limitations; + /// it will be packed as a 50-bit value along with other values as one + /// of the inputs (aka packedVal) + if (_maxValues.maxVoteOptions >= (2 ** 50)) { + revert InvalidMaxValues(); + } + + /// @notice deploy a new AccQueue contract to store messages + AccQueue messageAq = new AccQueueQuinaryMaci(_treeDepths.messageTreeSubDepth); + + /// @notice the smart contracts that a Poll would interact with + ExtContracts memory extContracts = ExtContracts({ + maci: IMACI(_maci), + messageAq: messageAq, + topupCredit: _topupCredit + }); + + // deploy the poll + Poll poll = new Poll(_duration, _maxValues, _treeDepths, _coordinatorPubKey, extContracts); + + // Make the Poll contract own the messageAq contract, so only it can + // run enqueue/merge + messageAq.transferOwnership(address(poll)); + + // init Poll + poll.init(); + + poll.transferOwnership(_pollOwner); + + pollAddr = address(poll); + } +} diff --git a/contracts/e2e/index.ts b/contracts/e2e/index.ts index 76e21525c..f3ad49b7c 100644 --- a/contracts/e2e/index.ts +++ b/contracts/e2e/index.ts @@ -16,7 +16,11 @@ import { DEFAULT_GET_LOG_BATCH_SIZE, DEFAULT_SR_QUEUE_OPS, } from '../utils/constants' -import { getEventArg } from '../utils/contracts' +import { + getContractAt, + getEventArg, + getQualifiedContractName, +} from '../utils/contracts' import { deployPoseidonLibraries, deployMaciFactory } from '../utils/testutils' import { getIpfsHash } from '../utils/ipfs' import { @@ -33,7 +37,7 @@ import { DEFAULT_CIRCUIT } from '../utils/circuits' import { MaciParameters } from '../utils/maciParameters' import { existsSync, mkdirSync } from 'fs' import path from 'path' -import { FundingRound } from '../typechain-types' +import { FundingRound, Poll } from '../typechain-types' import { JSONFile } from '../utils/JSONFile' import { EContracts } from '../utils/types' import { getTalyFilePath } from '../utils/misc' @@ -270,7 +274,11 @@ describe('End-to-end Tests', function () { pollId = await fundingRound.pollId() const pollAddress = await fundingRound.poll() - pollContract = await ethers.getContractAt(EContracts.Poll, pollAddress) + pollContract = await getContractAt( + EContracts.Poll, + pollAddress, + ethers + ) await mine() }) diff --git a/contracts/package.json b/contracts/package.json index 4498c8aba..9a3941562 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -18,7 +18,7 @@ "@openzeppelin/contracts": "4.9.0", "@pinata/sdk": "^2.1.0", "dotenv": "^8.2.0", - "maci-contracts": "0.0.0-ci.153326b", + "maci-contracts": "1.2.0", "solidity-rlp": "2.0.8" }, "devDependencies": { @@ -41,7 +41,7 @@ "ipfs-only-hash": "^2.0.1", "maci-circuits": "^1.2.0", "maci-cli": "^1.2.0", - "maci-domainobjs": "0.0.0-ci.153326b", + "maci-domainobjs": "1.2.0", "mocha": "^10.2.0", "solidity-coverage": "^0.8.1", "ts-node": "^10.9.2", diff --git a/contracts/tasks/helpers/ConstructorArguments.ts b/contracts/tasks/helpers/ConstructorArguments.ts index 6f9f3d5b4..1db4beb22 100644 --- a/contracts/tasks/helpers/ConstructorArguments.ts +++ b/contracts/tasks/helpers/ConstructorArguments.ts @@ -12,6 +12,7 @@ import { Poll, Tally, } from '../../typechain-types' +import { getContractAt } from '../../utils/contracts' /** A list of functions to get contract constructor arguments from the contract */ const ConstructorArgumentsGetters: Record< @@ -89,10 +90,11 @@ async function getPollConstructorArguments( address: string, ethers: HardhatEthersHelpers ): Promise> { - const pollContract = (await ethers.getContractAt( + const pollContract = await getContractAt( EContracts.Poll, - address - )) as BaseContract as Poll + address, + ethers + ) const [, duration] = await pollContract.getDeployTimeAndDuration() const [maxValues, treeDepths, coordinatorPubKey, extContracts] = diff --git a/contracts/tasks/runners/claim.ts b/contracts/tasks/runners/claim.ts index e5135aa24..0f27a2e95 100644 --- a/contracts/tasks/runners/claim.ts +++ b/contracts/tasks/runners/claim.ts @@ -5,7 +5,7 @@ * yarn hardhat claim --recipient --network */ -import { getEventArg } from '../../utils/contracts' +import { getContractAt, getEventArg } from '../../utils/contracts' import { getRecipientClaimData } from '@clrfund/common' import { JSONFile } from '../../utils/JSONFile' import { @@ -17,6 +17,7 @@ import { getNumber } from 'ethers' import { task, types } from 'hardhat/config' import { EContracts } from '../../utils/types' import { ContractStorage } from '../helpers/ContractStorage' +import { Poll } from 'maci-contracts/build/typechain-types' task('claim', 'Claim funnds for test recipients') .addOptionalParam('roundAddress', 'Funding round contract address') @@ -64,7 +65,11 @@ task('claim', 'Claim funnds for test recipients') const pollAddress = await fundingRoundContract.poll() console.log('pollAddress', pollAddress) - const poll = await ethers.getContractAt(EContracts.Poll, pollAddress) + const poll = await getContractAt( + EContracts.Poll, + pollAddress, + ethers + ) const treeDepths = await poll.treeDepths() const recipientTreeDepth = getNumber(treeDepths.voteOptionTreeDepth) diff --git a/contracts/tasks/runners/contribute.ts b/contracts/tasks/runners/contribute.ts index 6060c17a1..41cb7d610 100644 --- a/contracts/tasks/runners/contribute.ts +++ b/contracts/tasks/runners/contribute.ts @@ -11,7 +11,7 @@ import { Keypair, createMessage, Message, PubKey } from '@clrfund/common' import { UNIT } from '../../utils/constants' -import { getEventArg } from '../../utils/contracts' +import { getContractAt, getEventArg } from '../../utils/contracts' import type { FundingRound, ERC20, Poll } from '../../typechain-types' import { task } from 'hardhat/config' import { EContracts } from '../../utils/types' @@ -98,9 +98,10 @@ task('contribute', 'Contribute to a funding round').setAction( const pollId = await fundingRound.pollId() const pollAddress = await fundingRound.poll() - const pollContract = await ethers.getContractAt( + const pollContract = await getContractAt( EContracts.Poll, - pollAddress + pollAddress, + ethers ) const rawCoordinatorPubKey = await pollContract.coordinatorPubKey() diff --git a/contracts/tasks/runners/finalize.ts b/contracts/tasks/runners/finalize.ts index e48a6c2b6..74afe85e1 100644 --- a/contracts/tasks/runners/finalize.ts +++ b/contracts/tasks/runners/finalize.ts @@ -17,6 +17,8 @@ import { EContracts } from '../../utils/types' import { ContractStorage } from '../helpers/ContractStorage' import { Subtask } from '../helpers/Subtask' import { getProofDirForRound, getTalyFilePath } from '../../utils/misc' +import { getContractAt } from '../../utils/contracts' +import { Poll } from 'maci-contracts/build/typechain-types' task('finalize', 'Finalize a funding round') .addOptionalParam('clrfund', 'The ClrFund contract address') @@ -47,9 +49,10 @@ task('finalize', 'Finalize a funding round') console.log('Current round', fundingRound.target) const pollAddress = await fundingRound.poll() - const pollContract = await ethers.getContractAt( + const pollContract = await getContractAt( EContracts.Poll, - pollAddress + pollAddress, + ethers ) console.log('Poll', pollAddress) diff --git a/contracts/tasks/runners/publishTallyResults.ts b/contracts/tasks/runners/publishTallyResults.ts index 5651ac353..b9db3404f 100644 --- a/contracts/tasks/runners/publishTallyResults.ts +++ b/contracts/tasks/runners/publishTallyResults.ts @@ -24,10 +24,12 @@ import { FundingRound, Poll } from '../../typechain-types' import { HardhatEthersHelpers } from '@nomicfoundation/hardhat-ethers/types' import { EContracts } from '../../utils/types' import { Subtask } from '../helpers/Subtask' -import { getCurrentFundingRoundContract } from '../../utils/contracts' +import { + getContractAt, + getCurrentFundingRoundContract, +} from '../../utils/contracts' import { getTalyFilePath } from '../../utils/misc' import { ContractStorage } from '../helpers/ContractStorage' -import { PINATA_PINNING_URL } from '../../utils/constants' /** * Publish the tally IPFS hash on chain if it's not already published @@ -92,7 +94,11 @@ async function getRecipientTreeDepth( ethers: HardhatEthersHelpers ): Promise { const pollAddress = await fundingRoundContract.poll() - const pollContract = await ethers.getContractAt(EContracts.Poll, pollAddress) + const pollContract = await getContractAt( + EContracts.Poll, + pollAddress, + ethers + ) const treeDepths = await (pollContract as BaseContract as Poll).treeDepths() const voteOptionTreeDepth = treeDepths.voteOptionTreeDepth return getNumber(voteOptionTreeDepth) diff --git a/contracts/tests/deployer.ts b/contracts/tests/deployer.ts index f21353557..bbe8c027a 100644 --- a/contracts/tests/deployer.ts +++ b/contracts/tests/deployer.ts @@ -6,7 +6,12 @@ import { genRandomSalt } from 'maci-crypto' import { Keypair } from '@clrfund/common' import { TREE_ARITY, ZERO_ADDRESS, UNIT } from '../utils/constants' -import { getGasUsage, getEventArg, deployContract } from '../utils/contracts' +import { + getGasUsage, + getEventArg, + deployContract, + getContractAt, +} from '../utils/contracts' import { deployPoseidonLibraries, deployMaciFactory } from '../utils/testutils' import { MaciParameters } from '../utils/maciParameters' import { HardhatEthersSigner } from '@nomicfoundation/hardhat-ethers/signers' @@ -15,6 +20,7 @@ import { ClrFundDeployer, FundingRoundFactory, MACIFactory, + Poll, } from '../typechain-types' import { EContracts } from '../utils/types' @@ -318,7 +324,11 @@ describe('Clr fund deployer', async () => { 'pollAddr' ) - const poll = await ethers.getContractAt('Poll', pollAddress.poll) + const poll = await getContractAt( + EContracts.Poll, + pollAddress.poll, + ethers + ) const roundCoordinatorPubKey = await poll.coordinatorPubKey() expect(roundCoordinatorPubKey.x).to.equal(coordinatorPubKey.x) expect(roundCoordinatorPubKey.y).to.equal(coordinatorPubKey.y) diff --git a/contracts/tests/round.ts b/contracts/tests/round.ts index c0fa4f813..4e480ff34 100644 --- a/contracts/tests/round.ts +++ b/contracts/tests/round.ts @@ -21,7 +21,7 @@ import { VOICE_CREDIT_FACTOR, ALPHA_PRECISION, } from '../utils/constants' -import { getEventArg, getGasUsage } from '../utils/contracts' +import { getContractAt, getEventArg, getGasUsage } from '../utils/contracts' import { bnSqrt, createMessage, @@ -34,6 +34,7 @@ import { deployTestFundingRound } from '../utils/testutils' // ethStaker test vectors for Quadratic Funding with alpha import smallTallyTestData from './data/testTallySmall.json' import { FundingRound } from '../typechain-types' +import { EContracts } from '../utils/types' const newResultCommitment = hexlify(randomBytes(32)) const perVOSpentVoiceCreditsHash = hexlify(randomBytes(32)) @@ -136,7 +137,12 @@ describe('Funding Round', () => { maciAddress = await fundingRound.maci() maci = await ethers.getContractAt('MACI', maciAddress) const pollAddress = await fundingRound.poll() - poll = await ethers.getContractAt('Poll', pollAddress, deployer) + poll = await getContractAt( + EContracts.Poll, + pollAddress, + ethers, + deployer + ) pollId = await fundingRound.pollId() const treeDepths = await poll.treeDepths() diff --git a/contracts/utils/contracts.ts b/contracts/utils/contracts.ts index 45250e3fb..c72aac709 100644 --- a/contracts/utils/contracts.ts +++ b/contracts/utils/contracts.ts @@ -27,7 +27,7 @@ export async function deployContract( options?: DeployContractOptions & { args?: unknown[]; quiet?: boolean } ): Promise { const args = options?.args || [] - const contractName = String(name).includes('Poseidon') ? ':' + name : name + const contractName = getQualifiedContractName(name) const contract = await ethers.deployContract(contractName, args, options) await contract.waitForDeployment() @@ -116,4 +116,46 @@ export async function getCurrentFundingRoundContract( return fundingRoundContract as BaseContract as FundingRound } + +/** + * Return the fully qualified contract name for Poll and PollFactory + * since there is a local copy and another in the maci-contracts + * otherwise return the name of the contract + * @param name The contract name + * @returns The qualified contract name + */ +export function getQualifiedContractName(name: EContracts): string { + let contractName = String(name) + if (contractName.includes('Poseidon')) { + contractName = `:${name}` + } + if (name === EContracts.PollFactory) { + contractName = 'contracts/maci/PollFactory.sol:PollFactory' + } + if (name === EContracts.Poll) { + contractName = 'contracts/maci/Poll.sol:Poll' + } + return contractName +} + +/** + * Get a contract + * @param name Name of the contract + * @param address The contract address + * @param ethers Hardhat ethers handle + * @param signers The signer + * @returns contract + */ +export async function getContractAt( + name: EContracts, + address: string, + ethers: HardhatEthersHelpers, + signer?: Signer +): Promise { + const contractName = getQualifiedContractName(name) + const contract = await ethers.getContractAt(contractName, address, signer) + + return contract as BaseContract as T +} + export { getEventArg } diff --git a/yarn.lock b/yarn.lock index 10adf18a4..970c4343b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1912,14 +1912,6 @@ fastfile "0.0.20" ffjavascript "^0.2.48" -"@iden3/binfileutils@0.0.12": - version "0.0.12" - resolved "https://registry.yarnpkg.com/@iden3/binfileutils/-/binfileutils-0.0.12.tgz#3772552f57551814ff606fa68ea1e0ef52795ce3" - integrity sha512-naAmzuDufRIcoNfQ1d99d7hGHufLA3wZSibtr4dMe6ZeiOPV1KwOZWTJ1YVz4HbaWlpDuzVU72dS4ATQS4PXBQ== - dependencies: - fastfile "0.0.20" - ffjavascript "^0.3.0" - "@import-maps/resolve@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@import-maps/resolve/-/resolve-1.0.1.tgz#1e9fcadcf23aa0822256a329aabca241879d37c9" @@ -2682,54 +2674,6 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@nomicfoundation/edr-darwin-arm64@0.3.7": - version "0.3.7" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.3.7.tgz#c204edc79643624dbd431b489b254778817d8244" - integrity sha512-6tK9Lv/lSfyBvpEQ4nsTfgxyDT1y1Uv/x8Wa+aB+E8qGo3ToexQ1BMVjxJk6PChXCDOWxB3B4KhqaZFjdhl3Ow== - -"@nomicfoundation/edr-darwin-x64@0.3.7": - version "0.3.7" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.3.7.tgz#c3b394445084270cc5250d6c1869b0574e7ef810" - integrity sha512-1RrQ/1JPwxrYO69e0tglFv5H+ggour5Ii3bb727+yBpBShrxtOTQ7fZyfxA5h62LCN+0Z9wYOPeQ7XFcVurMaQ== - -"@nomicfoundation/edr-linux-arm64-gnu@0.3.7": - version "0.3.7" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.3.7.tgz#6d65545a44d1323bb7ab08c3306947165d2071de" - integrity sha512-ds/CKlBoVXIihjhflhgPn13EdKWed6r5bgvMs/YwRqT5wldQAQJZWAfA2+nYm0Yi2gMGh1RUpBcfkyl4pq7G+g== - -"@nomicfoundation/edr-linux-arm64-musl@0.3.7": - version "0.3.7" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.3.7.tgz#5368534bceac1a8c18b1be6b908caca5d39b0c03" - integrity sha512-e29udiRaPujhLkM3+R6ju7QISrcyOqpcaxb2FsDWBkuD7H8uU9JPZEyyUIpEp5uIY0Jh1eEJPKZKIXQmQAEAuw== - -"@nomicfoundation/edr-linux-x64-gnu@0.3.7": - version "0.3.7" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.3.7.tgz#42349bf5941dbb54a5719942924c6e4e8cde348e" - integrity sha512-/xkjmTyv+bbJ4akBCW0qzFKxPOV4AqLOmqurov+s9umHb16oOv72osSa3SdzJED2gHDaKmpMITT4crxbar4Axg== - -"@nomicfoundation/edr-linux-x64-musl@0.3.7": - version "0.3.7" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.3.7.tgz#e6babe11c9a8012f1284e6e48c3551861f2a7cd4" - integrity sha512-QwBP9xlmsbf/ldZDGLcE4QiAb8Zt46E/+WLpxHBATFhGa7MrpJh6Zse+h2VlrT/SYLPbh2cpHgSmoSlqVxWG9g== - -"@nomicfoundation/edr-win32-x64-msvc@0.3.7": - version "0.3.7" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.3.7.tgz#1504b98f305f03be153b0220a546985660de9dc6" - integrity sha512-j/80DEnkxrF2ewdbk/gQ2EOPvgF0XSsg8D0o4+6cKhUVAW6XwtWKzIphNL6dyD2YaWEPgIrNvqiJK/aln0ww4Q== - -"@nomicfoundation/edr@^0.3.5": - version "0.3.7" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.3.7.tgz#9c75edf1fcf601617905b2c89acf103f4786d017" - integrity sha512-v2JFWnFKRsnOa6PDUrD+sr8amcdhxnG/YbL7LzmgRGU1odWEyOF4/EwNeUajQr4ZNKVWrYnJ6XjydXtUge5OBQ== - optionalDependencies: - "@nomicfoundation/edr-darwin-arm64" "0.3.7" - "@nomicfoundation/edr-darwin-x64" "0.3.7" - "@nomicfoundation/edr-linux-arm64-gnu" "0.3.7" - "@nomicfoundation/edr-linux-arm64-musl" "0.3.7" - "@nomicfoundation/edr-linux-x64-gnu" "0.3.7" - "@nomicfoundation/edr-linux-x64-musl" "0.3.7" - "@nomicfoundation/edr-win32-x64-msvc" "0.3.7" - "@nomicfoundation/ethereumjs-block@5.0.2": version "5.0.2" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz#13a7968f5964f1697da941281b7f7943b0465d04" @@ -3030,11 +2974,6 @@ resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-4.0.0.tgz#eb1f619218dd1414fa161dfec92d3e5e53a2f407" integrity sha512-jhcWHp0aHaL0aDYj8IJl80v4SZXWMS1A2XxXa1CA6pBiFfJKuZinCkO6wb+POAt0LIfXB3gA3AgdcOccrcwBwA== -"@nomicfoundation/hardhat-toolbox@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-5.0.0.tgz#165b47f8a3d2bf668cc5d453ce7f496a1156948d" - integrity sha512-FnUtUC5PsakCbwiVNsqlXVIWG5JIb5CEZoSXbJUsEBun22Bivx2jhF1/q9iQbzuaGpJKFQyOhemPB2+XlEE6pQ== - "@nomicfoundation/hardhat-verify@^2.0.3": version "2.0.3" resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.3.tgz#173557f8cfa53c8c9da23a326f54d24fe459ae68" @@ -3343,11 +3282,6 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.5.tgz#1eed23d4844c861a1835b5d33507c1017fa98de8" integrity sha512-ZK+W5mVhRppff9BE6YdR8CC52C8zAvsVAiWhEtQ5+oNxFE6h1WdeWo+FJSF8KKvtxxVYZ7MTP/5KoVpAU3aSWg== -"@openzeppelin/contracts@^5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.0.2.tgz#b1d03075e49290d06570b2fd42154d76c2a5d210" - integrity sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA== - "@openzeppelin/merkle-tree@^1.0.5": version "1.0.5" resolved "https://registry.yarnpkg.com/@openzeppelin/merkle-tree/-/merkle-tree-1.0.5.tgz#4836d377777a7e39f31674f06ec3d6909def7913" @@ -5029,20 +4963,6 @@ dependencies: "@zk-kit/utils" "0.1.0" -"@zk-kit/baby-jubjub@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@zk-kit/baby-jubjub/-/baby-jubjub-0.2.0.tgz#71c5396ddacb97e4e3db677933f74bde3332b236" - integrity sha512-pqiPq621oKpwiIkf1KcVh5MdbFX0V67s9gCmiEkhLMeafZaIXEwVt5qmIu1d2HB4mjXgr4Ys8Jpn2Rw4KXxnFQ== - dependencies: - "@zk-kit/utils" "0.3.0" - -"@zk-kit/baby-jubjub@0.3.0", "@zk-kit/baby-jubjub@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@zk-kit/baby-jubjub/-/baby-jubjub-0.3.0.tgz#78b8d3226670dd02dc8ced713aec64d6bb2a6e62" - integrity sha512-mA3/M/+4C2vDtc0SpXf/q/nsvwBh+s42ou176sgDzqIBQD/u/N+LaLGorDh+X5AD3dVMHb8rheFpnnrJmjsqdA== - dependencies: - "@zk-kit/utils" "0.6.0" - "@zk-kit/circuits@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@zk-kit/circuits/-/circuits-0.3.0.tgz#716d932e9b09f33c71c7ff940a507e519ce0a6f4" @@ -5050,22 +4970,6 @@ dependencies: circomlib "^2.0.5" -"@zk-kit/circuits@^0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@zk-kit/circuits/-/circuits-0.4.0.tgz#17a8333e8afe5a4e79260600a2dcefb2bc751a8f" - integrity sha512-Di7mokhwBS3qxVeCfHxGeNIpDg1kTnr1JXmsWiQMZLkRTn3Hugh6Tl07J394rWD0pIWRwPQsinaMVL2sB4F8yQ== - dependencies: - circomlib "^2.0.5" - -"@zk-kit/eddsa-poseidon@^0.11.0": - version "0.11.0" - resolved "https://registry.yarnpkg.com/@zk-kit/eddsa-poseidon/-/eddsa-poseidon-0.11.0.tgz#f648b50a79ce660df75896d8fafa30c0f6eb9a43" - integrity sha512-8XgIVSD+nTnTEjvdrFVvju6lVQ5rxCfkBnf/nCFN/IteiIpYX7LnxrTOV7pIp3RrWL29WuTvNrT8TlBrHRrUFA== - dependencies: - "@zk-kit/baby-jubjub" "0.3.0" - "@zk-kit/utils" "0.8.1" - buffer "6.0.3" - "@zk-kit/eddsa-poseidon@^0.5.1": version "0.5.1" resolved "https://registry.yarnpkg.com/@zk-kit/eddsa-poseidon/-/eddsa-poseidon-0.5.1.tgz#7fef431f441f5385f82e6005cdf83d72d298e8c2" @@ -5082,38 +4986,11 @@ "@zk-kit/baby-jubjub" "0.1.1" "@zk-kit/utils" "0.1.0" -"@zk-kit/poseidon-cipher@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@zk-kit/poseidon-cipher/-/poseidon-cipher-0.3.0.tgz#e05a5d8a39a2d3a9aadb1b9997c2580713eacfff" - integrity sha512-Byszt7dxssgsR7hog2nf9AMaBKYr8LrgtlU/PPHPEe2OkJwIeQSshoxqquLlZsyfOn2c1ZmTJb4Mo4aHY11pCA== - dependencies: - "@zk-kit/baby-jubjub" "0.2.0" - "@zk-kit/utils" "0.3.0" - "@zk-kit/utils@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@zk-kit/utils/-/utils-0.1.0.tgz#6c134c22541efc6e634d4a89884c8bfe209b2da1" integrity sha512-MZmuw2w2StB7XOSNg1TW4VwnBJ746UDmdXTvxwDO/U85UZfGfM3zb53gG35qz5sWpQo/DjfoKqaScmh6HUtQpA== -"@zk-kit/utils@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@zk-kit/utils/-/utils-0.3.0.tgz#ca85ab40540ee76b3a09b91df66a55d7f319a71d" - integrity sha512-yVBczOwOSV+evSgdsJ0tpPn3oQpbL7a7fRqANDogleaLLte1IFxKTFLz3WNcgd28Asq2guMGiU6SmiEc61uHAg== - -"@zk-kit/utils@0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@zk-kit/utils/-/utils-0.6.0.tgz#30124e98df8e29f7af31e19ce4dc6302f178c0a4" - integrity sha512-sUF1yVjlGmm7/NIN/+d+N8WOcI77bTzgV5+vZmp/S7lXcy4fmO+5TdHERRsDbs8Ep8K33EOC6V+U+JXzmjSe5A== - dependencies: - buffer "^6.0.3" - -"@zk-kit/utils@0.8.1": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@zk-kit/utils/-/utils-0.8.1.tgz#9d358542e6b223dde35f32f3e161d1d3a41b0644" - integrity sha512-m5cvnYo5IBZQCO8H5X0Mw3rGRGEoSqlYXVVF1+4M9IT3olDWcJHLPRqtYGF9zNf+vXV/21srpZ0hX3X2Lzp1TQ== - dependencies: - buffer "^6.0.3" - JSONStream@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" @@ -7019,7 +6896,7 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -"buffer-polyfill@npm:buffer@^6.0.3", buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.3: +"buffer-polyfill@npm:buffer@^6.0.3", buffer@^6.0.1, buffer@^6.0.3: name buffer-polyfill version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" @@ -7530,13 +7407,6 @@ circom_runtime@0.1.24: dependencies: ffjavascript "0.2.60" -circom_runtime@0.1.25: - version "0.1.25" - resolved "https://registry.yarnpkg.com/circom_runtime/-/circom_runtime-0.1.25.tgz#62a33b371f4633f30238db7a326c43d988e3a170" - integrity sha512-xBGsBFF5Uv6AKvbpgExYqpHfmfawH2HKe+LyjfKSRevqEV8u63i9KGHVIILsbJNW+0c5bm/66f0PUYQ7qZSkJA== - dependencies: - ffjavascript "0.3.0" - circom_tester@^0.0.19: version "0.0.19" resolved "https://registry.yarnpkg.com/circom_tester/-/circom_tester-0.0.19.tgz#e8bed494d080f8186bd0ac6571755d00ccec83bd" @@ -7561,16 +7431,6 @@ circomkit@^0.0.24: loglevel "^1.8.1" snarkjs "^0.7.0" -circomkit@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/circomkit/-/circomkit-0.1.0.tgz#f44cf86d46b3a3dff5a4958b6450f494d6fa9970" - integrity sha512-Mnc9IuOoaN7FitfURvbg2Q5j62S7/zQl6l18u5dcIhZg3Ot9MZYLiGIotCaF1Gfp/vAUKnvO2lnS3Xc1TdTISA== - dependencies: - chai "^4.3.7" - circom_tester "^0.0.19" - loglevel "^1.8.1" - snarkjs "^0.7.0" - circomlib@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/circomlib/-/circomlib-2.0.5.tgz#183c703e53ed7d011811842dbeeeb9819f4cc1d6" @@ -10322,19 +10182,6 @@ ethers@^6.11.1: tslib "2.4.0" ws "8.5.0" -ethers@^6.12.0: - version "6.12.1" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.12.1.tgz#517ff6d66d4fd5433e38e903051da3e57c87ff37" - integrity sha512-j6wcVoZf06nqEcBbDWkKg8Fp895SS96dSnTCjiXT+8vt2o02raTn4Lo9ERUuIVU5bAjoPYeA+7ytQFexFmLuVw== - dependencies: - "@adraffy/ens-normalize" "1.10.1" - "@noble/curves" "1.2.0" - "@noble/hashes" "1.3.2" - "@types/node" "18.15.13" - aes-js "4.0.0-beta.5" - tslib "2.4.0" - ws "8.5.0" - ethers@^6.9.2: version "6.10.0" resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.10.0.tgz#20f3c63c60d59a993f8090ad423d8a3854b3b1cd" @@ -10861,15 +10708,6 @@ ffjavascript@0.2.63, ffjavascript@^0.2.45, ffjavascript@^0.2.48, ffjavascript@^0 wasmcurves "0.2.2" web-worker "1.2.0" -ffjavascript@0.3.0, ffjavascript@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/ffjavascript/-/ffjavascript-0.3.0.tgz#442cd8fbb1ee4cbb1be9d26fd7b2951a1ea45d6a" - integrity sha512-l7sR5kmU3gRwDy8g0Z2tYBXy5ttmafRPFOqY7S6af5cq51JqJWt5eQ/lSR/rs2wQNbDYaYlQr5O+OSUf/oMLoQ== - dependencies: - wasmbuilder "0.0.16" - wasmcurves "0.2.2" - web-worker "1.2.0" - figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" @@ -12178,55 +12016,6 @@ hardhat@^2.20.1: uuid "^8.3.2" ws "^7.4.6" -hardhat@^2.22.3: - version "2.22.3" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.3.tgz#50605daca6b29862397e446c42ec14c89430bec3" - integrity sha512-k8JV2ECWNchD6ahkg2BR5wKVxY0OiKot7fuxiIpRK0frRqyOljcR2vKwgWSLw6YIeDcNNA4xybj7Og7NSxr2hA== - dependencies: - "@ethersproject/abi" "^5.1.2" - "@metamask/eth-sig-util" "^4.0.0" - "@nomicfoundation/edr" "^0.3.5" - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-tx" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - "@nomicfoundation/solidity-analyzer" "^0.1.0" - "@sentry/node" "^5.18.1" - "@types/bn.js" "^5.1.0" - "@types/lru-cache" "^5.1.0" - adm-zip "^0.4.16" - aggregate-error "^3.0.0" - ansi-escapes "^4.3.0" - boxen "^5.1.2" - chalk "^2.4.2" - chokidar "^3.4.0" - ci-info "^2.0.0" - debug "^4.1.1" - enquirer "^2.3.0" - env-paths "^2.2.0" - ethereum-cryptography "^1.0.3" - ethereumjs-abi "^0.6.8" - find-up "^2.1.0" - fp-ts "1.19.3" - fs-extra "^7.0.1" - glob "7.2.0" - immutable "^4.0.0-rc.12" - io-ts "1.10.4" - keccak "^3.0.2" - lodash "^4.17.11" - mnemonist "^0.38.0" - mocha "^10.0.0" - p-map "^4.0.0" - raw-body "^2.4.1" - resolve "1.17.0" - semver "^6.3.0" - solc "0.7.3" - source-map-support "^0.5.13" - stacktrace-parser "^0.1.10" - tsort "0.0.1" - undici "^5.14.0" - uuid "^8.3.2" - ws "^7.4.6" - has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -15128,19 +14917,6 @@ luxon@^3.1.1, luxon@^3.2.1: resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.4.4.tgz#cf20dc27dc532ba41a169c43fdcc0063601577af" integrity sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA== -maci-circuits@0.0.0-ci.153326b: - version "0.0.0-ci.153326b" - resolved "https://registry.yarnpkg.com/maci-circuits/-/maci-circuits-0.0.0-ci.153326b.tgz#9958949f675b466c8f0fd7da4d12467012ca1dbb" - integrity sha512-9WYp1465Xelujo4GLpiLqgVdsia2VAl7FEpRMZOJeEJlbl8RUYLBTFlR9X9fBL3sNjoPNFSiswrVoCgmiQEi8A== - dependencies: - "@zk-kit/circuits" "^0.4.0" - circomkit "^0.1.0" - circomlib "^2.0.5" - maci-core "0.0.0-ci.153326b" - maci-crypto "0.0.0-ci.153326b" - maci-domainobjs "0.0.0-ci.153326b" - snarkjs "^0.7.4" - maci-circuits@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/maci-circuits/-/maci-circuits-1.2.0.tgz#9b1f9c64d48e4dc3c3c7c8ffc4d0f254d60cce3e" @@ -15172,24 +14948,7 @@ maci-cli@^1.2.0: maci-domainobjs "^1.2.0" prompt "^1.3.0" -maci-contracts@0.0.0-ci.153326b: - version "0.0.0-ci.153326b" - resolved "https://registry.yarnpkg.com/maci-contracts/-/maci-contracts-0.0.0-ci.153326b.tgz#4c1d3cc1c5a89cbbe852439a1e81646e8b0dc302" - integrity sha512-DFo8xLR/Ia/CcSFXYjHfMCfaN/GnhNMxVgcRu1EQBY8DzWMs/MBHEYnH/LBpT/r5QscY0kyk45lMdKA24xHsFA== - dependencies: - "@nomicfoundation/hardhat-ethers" "^3.0.5" - "@nomicfoundation/hardhat-toolbox" "^5.0.0" - "@openzeppelin/contracts" "^5.0.2" - circomlibjs "^0.1.7" - ethers "^6.12.0" - hardhat "^2.22.3" - maci-circuits "0.0.0-ci.153326b" - maci-core "0.0.0-ci.153326b" - maci-crypto "0.0.0-ci.153326b" - maci-domainobjs "0.0.0-ci.153326b" - solidity-docgen "^0.6.0-beta.36" - -maci-contracts@^1.2.0: +maci-contracts@1.2.0, maci-contracts@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/maci-contracts/-/maci-contracts-1.2.0.tgz#a724b3e757d2402442d822c34a5221660ef43b94" integrity sha512-zLYmGzBIBTygw7FiukK9nLNFnDdEWDmizuHruXFjpawCIwH+kzBsGImRy77Rn58SOe9XORdlGZOQckEGvaT4QQ== @@ -15206,14 +14965,6 @@ maci-contracts@^1.2.0: maci-domainobjs "^1.2.0" solidity-docgen "^0.6.0-beta.36" -maci-core@0.0.0-ci.153326b: - version "0.0.0-ci.153326b" - resolved "https://registry.yarnpkg.com/maci-core/-/maci-core-0.0.0-ci.153326b.tgz#08cb39ab66b2e528da319d64e2194c4b1c2fca01" - integrity sha512-lrkPm/gIcHbVO3+tuGnvNdc/Gy5jD0+5biG13RmdIfFiXnND0vD7aX5x45HY4mNK1TUrlS8ZMVHSjY4voeiieg== - dependencies: - maci-crypto "0.0.0-ci.153326b" - maci-domainobjs "0.0.0-ci.153326b" - maci-core@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/maci-core/-/maci-core-1.2.0.tgz#57ff4b92c457f42a3043fe5b34cfef98a9ac1cf5" @@ -15222,17 +14973,7 @@ maci-core@^1.2.0: maci-crypto "^1.2.0" maci-domainobjs "^1.2.0" -maci-crypto@0.0.0-ci.153326b: - version "0.0.0-ci.153326b" - resolved "https://registry.yarnpkg.com/maci-crypto/-/maci-crypto-0.0.0-ci.153326b.tgz#4d0d2e72dd0aa6dba30d24e2c873729a5706bb8e" - integrity sha512-80QCpFdMts3rgfUn0fSQq0BFsuALOAYRH+MLWWDVTQXu1LtXZ4ikwq4DvD0ZuUDHjf9GgAmsQGQbi/Raa6q0bQ== - dependencies: - "@zk-kit/baby-jubjub" "^0.3.0" - "@zk-kit/eddsa-poseidon" "^0.11.0" - "@zk-kit/poseidon-cipher" "^0.3.0" - ethers "^6.12.0" - -maci-crypto@^1.2.0: +maci-crypto@1.2.0, maci-crypto@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/maci-crypto/-/maci-crypto-1.2.0.tgz#b894810fa2ab379d93f77a2518f55abfe2f22dbe" integrity sha512-OOQvI+uDR0Q8wji9cbBqfDcwQgjoIIiv5r1pnne4ST15taxgMygep13rsA6UCU/A007rYBa93YAR3vnnBTnmrw== @@ -15242,14 +14983,7 @@ maci-crypto@^1.2.0: "@zk-kit/poseidon-cipher" "^0.2.1" ethers "^6.11.1" -maci-domainobjs@0.0.0-ci.153326b: - version "0.0.0-ci.153326b" - resolved "https://registry.yarnpkg.com/maci-domainobjs/-/maci-domainobjs-0.0.0-ci.153326b.tgz#546649c1b6e29748bc79c77b46081433a8d22876" - integrity sha512-utPsFPC6a6Q8LwtBqTQvzBOsUroprvFoCHy5sTRoRvKsSGLwTibkcYMzmxF5A+tnFJ4n9CKCrr6UF/6Mzc2dlw== - dependencies: - maci-crypto "0.0.0-ci.153326b" - -maci-domainobjs@^1.2.0: +maci-domainobjs@1.2.0, maci-domainobjs@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/maci-domainobjs/-/maci-domainobjs-1.2.0.tgz#27a6a9e05b3712e54c48dd080dcfc0c1d6035f93" integrity sha512-9ItdA/EVSVqDMOD+Foe+OkDdj/LEfpwSAtXLCxG900TeAZpI486qiAbiJoI5sR8gnoRfSvwnZGJqiB+w0BPgSQ== @@ -18093,16 +17827,6 @@ r1csfile@0.0.47: fastfile "0.0.20" ffjavascript "0.2.60" -r1csfile@0.0.48: - version "0.0.48" - resolved "https://registry.yarnpkg.com/r1csfile/-/r1csfile-0.0.48.tgz#a317fc75407a9da92631666c75bdfc13f0a7835a" - integrity sha512-kHRkKUJNaor31l05f2+RFzvcH5XSa7OfEfd/l4hzjte6NL6fjRkSMfZ4BjySW9wmfdwPOtq3mXurzPvPGEf5Tw== - dependencies: - "@iden3/bigarray" "0.0.2" - "@iden3/binfileutils" "0.0.12" - fastfile "0.0.20" - ffjavascript "0.3.0" - rabin-wasm@~0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/rabin-wasm/-/rabin-wasm-0.0.8.tgz#5b61b1d519d0377453435fbca5f82510b3f956cb" @@ -19356,22 +19080,6 @@ snarkjs@^0.7.0, snarkjs@^0.7.3: logplease "^1.2.15" r1csfile "0.0.47" -snarkjs@^0.7.4: - version "0.7.4" - resolved "https://registry.yarnpkg.com/snarkjs/-/snarkjs-0.7.4.tgz#b9ad5813f055ab84d33f1831a6f1f34a71b6cd46" - integrity sha512-x4cOCR4YXSyBlLtfnUUwfbZrw8wFd/Y0lk83eexJzKwZB8ELdpH+10ts8YtDsm2/a3WK7c7p514bbE8NpqxW8w== - dependencies: - "@iden3/binfileutils" "0.0.12" - bfj "^7.0.2" - blake2b-wasm "^2.4.0" - circom_runtime "0.1.25" - ejs "^3.1.6" - fastfile "0.0.20" - ffjavascript "0.3.0" - js-sha3 "^0.8.0" - logplease "^1.2.15" - r1csfile "0.0.48" - solc@0.7.3: version "0.7.3" resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" From bcdd62cb96b926355d6b4453420c9257485f9eda Mon Sep 17 00:00:00 2001 From: yuetloo Date: Thu, 9 May 2024 12:50:57 -0400 Subject: [PATCH 03/21] use qualified contract name --- contracts/tasks/helpers/Subtask.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contracts/tasks/helpers/Subtask.ts b/contracts/tasks/helpers/Subtask.ts index 089cf06d6..06eed8015 100644 --- a/contracts/tasks/helpers/Subtask.ts +++ b/contracts/tasks/helpers/Subtask.ts @@ -18,7 +18,7 @@ import type { HardhatRuntimeEnvironment, } from 'hardhat/types' -import { deployContract } from '../../utils/contracts' +import { deployContract, getQualifiedContractName } from '../../utils/contracts' import { EContracts } from '../../utils/types' import { ContractStorage } from './ContractStorage' import { @@ -527,7 +527,8 @@ export class Subtask { const contractAddress = address || this.storage.mustGetAddress(name, this.hre.network.name) - const { abi } = await this.hre.artifacts.readArtifact(name.toString()) + const qualifiedName = getQualifiedContractName(name) + const { abi } = await this.hre.artifacts.readArtifact(qualifiedName) return new BaseContract(contractAddress, abi, deployer) as T } From 2ff9b0b1de19393a1c21887056f95e9441414724 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Thu, 9 May 2024 13:21:00 -0400 Subject: [PATCH 04/21] use qualified name for Poll --- contracts/tasks/runners/exportRound.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/contracts/tasks/runners/exportRound.ts b/contracts/tasks/runners/exportRound.ts index fa3e332b1..27be1e51b 100644 --- a/contracts/tasks/runners/exportRound.ts +++ b/contracts/tasks/runners/exportRound.ts @@ -14,12 +14,14 @@ import { task, types } from 'hardhat/config' import { Contract, formatUnits, getNumber } from 'ethers' import { Ipfs } from '../../utils/ipfs' -import { Project, Round, RoundFileContent } from '../../utils/types' +import { EContracts, Project, Round, RoundFileContent } from '../../utils/types' import { RecipientRegistryLogProcessor } from '../../utils/RecipientRegistryLogProcessor' import { getRecipientAddressAbi, MaciV0Abi } from '../../utils/abi' import { JSONFile } from '../../utils/JSONFile' import path from 'path' import fs from 'fs' +import { getContractAt } from '../../utils/contracts' +import { Poll } from '../../typechain-types' type RoundListEntry = { network: string @@ -216,7 +218,11 @@ async function getRoundInfo( try { if (pollAddress) { - const pollContract = await ethers.getContractAt('Poll', pollAddress) + const pollContract = await getContractAt( + EContracts.Poll, + pollAddress, + ethers + ) const [roundStartTime, roundDuration] = await pollContract.getDeployTimeAndDuration() startTime = getNumber(roundStartTime) From e78fc12adb2bf1a768272fcc1fc63c2a011444bd Mon Sep 17 00:00:00 2001 From: yuetloo Date: Thu, 9 May 2024 13:24:30 -0400 Subject: [PATCH 05/21] make script maci-pubkey available --- contracts/tasks/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/tasks/index.ts b/contracts/tasks/index.ts index 59f1c9699..b25d56890 100644 --- a/contracts/tasks/index.ts +++ b/contracts/tasks/index.ts @@ -28,3 +28,4 @@ import './runners/genProofs' import './runners/proveOnChain' import './runners/publishTallyResults' import './runners/resetTally' +import './runners/maciPubkey' From 6bbd012dd4c6082a5ee8c778ca680285b69992cd Mon Sep 17 00:00:00 2001 From: yuetloo Date: Fri, 10 May 2024 11:09:44 -0400 Subject: [PATCH 06/21] validate key using the serialize function --- common/src/keypair.ts | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/common/src/keypair.ts b/common/src/keypair.ts index 8e02ab52f..649ef4b9f 100644 --- a/common/src/keypair.ts +++ b/common/src/keypair.ts @@ -1,37 +1,34 @@ import { keccak256, isBytesLike, concat, toBeArray } from 'ethers' import { Keypair as MaciKeypair, PrivKey, PubKey } from 'maci-domainobjs' -const SNARK_FIELD_SIZE = BigInt( - '21888242871839275222246405745257275088548364400416034343698204186575808495617' -) - /** - * Returns a BabyJub-compatible value. This function is modified from - * the MACI's genRandomBabyJubValue(). Instead of returning random value - * for the private key, it derives the private key from the users - * signature hash + * Derives the MACI private key from the users signature hash * @param hash - user's signature hash + * @return The MACI private key */ function genPrivKey(hash: string): PrivKey { - // Prevent modulo bias - //const lim = BigInt('0x10000000000000000000000000000000000000000000000000000000000000000') - //const min = (lim - SNARK_FIELD_SIZE) % SNARK_FIELD_SIZE - const min = BigInt( - '6350874878119819312338956282401532410528162663560392320966563075034087161851' - ) - if (!isBytesLike(hash)) { - throw new Error(`Hash must be a hex string: ${hash}`) + throw new Error(`genPrivKey() error. Hash must be a hex string: ${hash}`) } - let hashBN = BigInt(hash) - // don't think we'll enter the for loop below, but, just in case - for (let counter = 1; hashBN < min; counter++) { - const data = concat([toBeArray(hashBN), toBeArray(counter)]) - hashBN = BigInt(keccak256(data)) + let rawPrivKey = BigInt(hash) + let pubKey: PubKey | null = null + + for (let counter = 1; pubKey === null; counter++) { + try { + const privKey = new PrivKey(rawPrivKey) + const keypair = new Keypair(privKey) + + // this will throw 'Invalid public key' if key is not on the Baby Jubjub elliptic curve + keypair.pubKey.serialize() + + pubKey = keypair.pubKey + } catch { + const data = concat([toBeArray(rawPrivKey), toBeArray(counter)]) + rawPrivKey = BigInt(keccak256(data)) + } } - const rawPrivKey = hashBN % SNARK_FIELD_SIZE return new PrivKey(rawPrivKey) } From 0ff9b2b7cd212e004867ab1b82448fd4b621aaff Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 13 May 2024 12:31:48 -0400 Subject: [PATCH 07/21] add test for common package --- common/src/__tests__/keypair.spec.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 common/src/__tests__/keypair.spec.ts diff --git a/common/src/__tests__/keypair.spec.ts b/common/src/__tests__/keypair.spec.ts new file mode 100644 index 000000000..47f1cba72 --- /dev/null +++ b/common/src/__tests__/keypair.spec.ts @@ -0,0 +1,20 @@ +import { expect } from 'chai' +import { Keypair, PubKey } from '../keypair' +import { Wallet, sha256, randomBytes } from 'ethers' + +describe.only('keypair', function () { + for (let i = 0; i < 10; i++) { + it(`should generate key ${i} from seed successfully`, function () { + const wallet = Wallet.createRandom() + const signature = wallet.signMessageSync(randomBytes(32).toString()) + const seed = sha256(signature) + const keypair = Keypair.createFromSeed(seed) + expect(keypair.pubKey.serialize()).to.match(/^macipk./) + }) + } + + it('should throw if pubKey is invalid', () => { + const pubKey = new PubKey([1n, 1n]) + expect(() => pubKey.serialize()).to.throw('Invalid public key') + }) +}) From b031c8edde8e2ff5b57698e9f45291160cce91be Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 13 May 2024 12:32:50 -0400 Subject: [PATCH 08/21] add test common to pre push script --- .husky/pre-push | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/pre-push b/.husky/pre-push index c0bc1da1c..c0d892312 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -11,4 +11,4 @@ export VITE_RECIPIENT_REGISTRY_TYPE=simple export VITE_USER_REGISTRY_TYPE=simple export VITE_WALLET_CONNECT_PROJECT_ID=1 -yarn test:format && yarn test:web && yarn test:lint-i18n +yarn test:format && yarn test:common && yarn test:web && yarn test:lint-i18n From 2f980e27122ca016b7a98e0b61bdb5e7e44277bd Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 13 May 2024 12:55:49 -0400 Subject: [PATCH 09/21] add test:common script --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 072d15e02..0ae9648b6 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "test:contracts": "yarn workspace @clrfund/contracts run test", "test:e2e": "yarn workspace @clrfund/contracts run e2e", "test:web": "yarn workspace @clrfund/vue-app run test", + "test:common": "yarn workspace @clrfund/common run test", "test:format": "yarn prettier --check", "test:lint-i18n": "echo yarn workspace @clrfund/vue-app run test:lint-i18n --ci", "deploy:subgraph": "yarn workspace @clrfund/subgraph run deploy", From 37247636510834661947c4c7b9581a6d5a01b8bb Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 13 May 2024 12:56:02 -0400 Subject: [PATCH 10/21] fix contract verification error --- contracts/tasks/helpers/ConstructorArguments.ts | 5 +++-- contracts/utils/contracts.ts | 8 +++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/contracts/tasks/helpers/ConstructorArguments.ts b/contracts/tasks/helpers/ConstructorArguments.ts index 1db4beb22..751a8bbc4 100644 --- a/contracts/tasks/helpers/ConstructorArguments.ts +++ b/contracts/tasks/helpers/ConstructorArguments.ts @@ -12,7 +12,7 @@ import { Poll, Tally, } from '../../typechain-types' -import { getContractAt } from '../../utils/contracts' +import { getContractAt, getQualifiedContractName } from '../../utils/contracts' /** A list of functions to get contract constructor arguments from the contract */ const ConstructorArgumentsGetters: Record< @@ -312,7 +312,8 @@ export class ConstructorArguments { address: string, ethers: HardhatEthersHelpers ): Promise> { - const contractArtifact = this.hre.artifacts.readArtifactSync(name) + const qualifiedName = getQualifiedContractName(name) + const contractArtifact = this.hre.artifacts.readArtifactSync(qualifiedName) const contractInterface = new Interface(contractArtifact.abi) if (contractInterface.deploy.inputs.length === 0) { // no argument diff --git a/contracts/utils/contracts.ts b/contracts/utils/contracts.ts index c72aac709..77a2bc72d 100644 --- a/contracts/utils/contracts.ts +++ b/contracts/utils/contracts.ts @@ -124,15 +124,13 @@ export async function getCurrentFundingRoundContract( * @param name The contract name * @returns The qualified contract name */ -export function getQualifiedContractName(name: EContracts): string { +export function getQualifiedContractName(name: EContracts | string): string { let contractName = String(name) if (contractName.includes('Poseidon')) { contractName = `:${name}` - } - if (name === EContracts.PollFactory) { + } else if (name === EContracts.PollFactory) { contractName = 'contracts/maci/PollFactory.sol:PollFactory' - } - if (name === EContracts.Poll) { + } else if (name === EContracts.Poll) { contractName = 'contracts/maci/Poll.sol:Poll' } return contractName From d8cd50ca00108896cfe5746291a56509b91b05a8 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Thu, 16 May 2024 06:04:03 -0400 Subject: [PATCH 11/21] use MACI v1.2.1 --- common/package.json | 4 +- common/src/__tests__/keypair.spec.ts | 7 +- common/src/keypair.ts | 5 +- contracts/contracts/AnyOldERC20Token.sol | 2 +- contracts/contracts/CloneFactory.sol | 2 +- contracts/contracts/ClrFund.sol | 2 +- contracts/contracts/ClrFundDeployer.sol | 4 +- contracts/contracts/ExternalContacts.sol | 3 +- contracts/contracts/FundingRound.sol | 12 +- contracts/contracts/FundingRoundFactory.sol | 2 +- contracts/contracts/MACICommon.sol | 2 +- contracts/contracts/MACIFactory.sol | 24 +- contracts/contracts/OwnableUpgradeable.sol | 2 +- contracts/contracts/TopupToken.sol | 4 +- contracts/contracts/interfaces/IClrFund.sol | 2 +- .../contracts/interfaces/IFundingRound.sol | 2 +- .../interfaces/IFundingRoundFactory.sol | 2 +- .../contracts/interfaces/IMACIFactory.sol | 2 +- contracts/contracts/maci/BabyJubJub.sol | 136 ----- contracts/contracts/maci/Poll.sol | 286 ---------- contracts/contracts/maci/PollFactory.sol | 73 --- .../BaseRecipientRegistry.sol | 2 +- .../recipientRegistry/IKlerosGTCR.sol | 2 +- .../recipientRegistry/IRecipientRegistry.sol | 2 +- .../recipientRegistry/KlerosGTCRAdapter.sol | 2 +- .../recipientRegistry/KlerosGTCRMock.sol | 4 +- .../OptimisticRecipientRegistry.sol | 4 +- .../PermissionedRecipientRegistry.sol | 4 +- .../SimpleRecipientRegistry.sol | 4 +- .../userRegistry/BrightIdSponsor.sol | 2 +- .../userRegistry/BrightIdUserRegistry.sol | 4 +- .../contracts/userRegistry/IUserRegistry.sol | 2 +- .../userRegistry/MerkleUserRegistry.sol | 4 +- .../userRegistry/SemaphoreUserRegistry.sol | 4 +- .../userRegistry/SimpleUserRegistry.sol | 4 +- .../userRegistry/SnapshotUserRegistry.sol | 4 +- .../MerklePatriciaProofVerifier.sol | 2 +- .../utils/cryptography/MerkleProof.sol | 2 +- .../utils/cryptography/StateProofVerifier.sol | 2 +- contracts/hardhat.config.ts | 7 +- contracts/package.json | 18 +- contracts/tasks/runners/genProofs.ts | 2 +- .../subtasks/clrfund/03-setVkRegsitry.ts | 7 +- .../subtasks/coordinator/01-coordinator.ts | 23 +- .../tasks/subtasks/round/02-deploy-round.ts | 6 +- contracts/utils/contracts.ts | 7 +- contracts/utils/maci.ts | 6 +- subgraph/abis/MACI.json | 62 +- subgraph/abis/Poll.json | 34 +- subgraph/generated/ClrFund/MACI.ts | 59 +- subgraph/generated/templates/MACI/MACI.ts | 59 +- yarn.lock | 539 +++++++++--------- 52 files changed, 473 insertions(+), 988 deletions(-) delete mode 100644 contracts/contracts/maci/BabyJubJub.sol delete mode 100644 contracts/contracts/maci/Poll.sol delete mode 100644 contracts/contracts/maci/PollFactory.sol diff --git a/common/package.json b/common/package.json index d7f3da4a5..713437020 100644 --- a/common/package.json +++ b/common/package.json @@ -23,8 +23,8 @@ "dependencies": { "@openzeppelin/merkle-tree": "^1.0.5", "ethers": "^6.11.1", - "maci-crypto": "1.2.0", - "maci-domainobjs": "1.2.0" + "maci-crypto": "1.2.1", + "maci-domainobjs": "1.2.1" }, "repository": { "type": "git", diff --git a/common/src/__tests__/keypair.spec.ts b/common/src/__tests__/keypair.spec.ts index 47f1cba72..7dbc6e195 100644 --- a/common/src/__tests__/keypair.spec.ts +++ b/common/src/__tests__/keypair.spec.ts @@ -2,7 +2,7 @@ import { expect } from 'chai' import { Keypair, PubKey } from '../keypair' import { Wallet, sha256, randomBytes } from 'ethers' -describe.only('keypair', function () { +describe('keypair', function () { for (let i = 0; i < 10; i++) { it(`should generate key ${i} from seed successfully`, function () { const wallet = Wallet.createRandom() @@ -14,7 +14,8 @@ describe.only('keypair', function () { } it('should throw if pubKey is invalid', () => { - const pubKey = new PubKey([1n, 1n]) - expect(() => pubKey.serialize()).to.throw('Invalid public key') + expect(() => { + new PubKey([1n, 1n]) + }).to.throw('PubKey not on curve') }) }) diff --git a/common/src/keypair.ts b/common/src/keypair.ts index 649ef4b9f..c6c9ea165 100644 --- a/common/src/keypair.ts +++ b/common/src/keypair.ts @@ -17,11 +17,8 @@ function genPrivKey(hash: string): PrivKey { for (let counter = 1; pubKey === null; counter++) { try { const privKey = new PrivKey(rawPrivKey) - const keypair = new Keypair(privKey) - // this will throw 'Invalid public key' if key is not on the Baby Jubjub elliptic curve - keypair.pubKey.serialize() - + const keypair = new Keypair(privKey) pubKey = keypair.pubKey } catch { const data = concat([toBeArray(rawPrivKey), toBeArray(counter)]) diff --git a/contracts/contracts/AnyOldERC20Token.sol b/contracts/contracts/AnyOldERC20Token.sol index 3d88c9508..be5ba8656 100644 --- a/contracts/contracts/AnyOldERC20Token.sol +++ b/contracts/contracts/AnyOldERC20Token.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; diff --git a/contracts/contracts/CloneFactory.sol b/contracts/contracts/CloneFactory.sol index 99247f723..fcdf5d9b6 100644 --- a/contracts/contracts/CloneFactory.sol +++ b/contracts/contracts/CloneFactory.sol @@ -21,7 +21,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -pragma solidity 0.8.10; +pragma solidity 0.8.20; contract CloneFactory { // implementation of eip-1167 - see https://eips.ethereum.org/EIPS/eip-1167 function createClone(address target) internal returns (address result) { diff --git a/contracts/contracts/ClrFund.sol b/contracts/contracts/ClrFund.sol index c9ad77389..4f5ad30bc 100644 --- a/contracts/contracts/ClrFund.sol +++ b/contracts/contracts/ClrFund.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.10; +pragma solidity 0.8.20; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; diff --git a/contracts/contracts/ClrFundDeployer.sol b/contracts/contracts/ClrFundDeployer.sol index 2487723ff..4f2b279d5 100644 --- a/contracts/contracts/ClrFundDeployer.sol +++ b/contracts/contracts/ClrFundDeployer.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.10; +pragma solidity 0.8.20; import {MACIFactory} from './MACIFactory.sol'; import {ClrFund} from './ClrFund.sol'; @@ -9,7 +9,7 @@ import {SignUpGatekeeper} from "maci-contracts/contracts/gatekeepers/SignUpGatek import {InitialVoiceCreditProxy} from "maci-contracts/contracts/initialVoiceCreditProxy/InitialVoiceCreditProxy.sol"; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; -contract ClrFundDeployer is CloneFactory, Ownable { +contract ClrFundDeployer is CloneFactory, Ownable(msg.sender) { address public clrfundTemplate; address public maciFactory; address public roundFactory; diff --git a/contracts/contracts/ExternalContacts.sol b/contracts/contracts/ExternalContacts.sol index 51706fb5f..d2f1d989e 100644 --- a/contracts/contracts/ExternalContacts.sol +++ b/contracts/contracts/ExternalContacts.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; /* * These imports are just for hardhat to find the contracts for deployment @@ -9,5 +9,4 @@ pragma solidity ^0.8.10; import {Poll} from 'maci-contracts/contracts/Poll.sol'; import {PollFactory} from 'maci-contracts/contracts/PollFactory.sol'; import {TallyFactory} from 'maci-contracts/contracts/TallyFactory.sol'; -import {SubsidyFactory} from 'maci-contracts/contracts/SubsidyFactory.sol'; import {MessageProcessorFactory} from 'maci-contracts/contracts/MessageProcessorFactory.sol'; diff --git a/contracts/contracts/FundingRound.sol b/contracts/contracts/FundingRound.sol index 38bb4f1ee..9f8fe143b 100644 --- a/contracts/contracts/FundingRound.sol +++ b/contracts/contracts/FundingRound.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.10; +pragma solidity 0.8.20; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; @@ -15,7 +15,7 @@ import {SignUpGatekeeper} from 'maci-contracts/contracts/gatekeepers/SignUpGatek import {InitialVoiceCreditProxy} from 'maci-contracts/contracts/initialVoiceCreditProxy/InitialVoiceCreditProxy.sol'; import {CommonUtilities} from 'maci-contracts/contracts/utilities/CommonUtilities.sol'; import {SnarkCommon} from 'maci-contracts/contracts/crypto/SnarkCommon.sol'; -import {ITallySubsidyFactory} from 'maci-contracts/contracts/interfaces/ITallySubsidyFactory.sol'; +import {ITallyFactory} from 'maci-contracts/contracts/interfaces/ITallyFactory.sol'; import {IMessageProcessorFactory} from 'maci-contracts/contracts/interfaces/IMPFactory.sol'; import {IClrFund} from './interfaces/IClrFund.sol'; import {IMACIFactory} from './interfaces/IMACIFactory.sol'; @@ -25,7 +25,7 @@ import './userRegistry/IUserRegistry.sol'; import './recipientRegistry/IRecipientRegistry.sol'; contract FundingRound is - Ownable, + Ownable(msg.sender), SignUpGatekeeper, InitialVoiceCreditProxy, DomainObjs, @@ -221,10 +221,10 @@ contract FundingRound is address vkRegistry = address(tally.vkRegistry()); IMessageProcessorFactory messageProcessorFactory = maci.messageProcessorFactory(); - ITallySubsidyFactory tallyFactory = maci.tallyFactory(); + ITallyFactory tallyFactory = maci.tallyFactory(); - address mp = messageProcessorFactory.deploy(verifier, vkRegistry, address(poll), coordinator); - address newTally = tallyFactory.deploy(verifier, vkRegistry, address(poll), mp, coordinator); + address mp = messageProcessorFactory.deploy(verifier, vkRegistry, address(poll), coordinator, Mode.QV); + address newTally = tallyFactory.deploy(verifier, vkRegistry, address(poll), mp, coordinator, Mode.QV); _setTally(newTally); } diff --git a/contracts/contracts/FundingRoundFactory.sol b/contracts/contracts/FundingRoundFactory.sol index 9a35c1077..06d0453e5 100644 --- a/contracts/contracts/FundingRoundFactory.sol +++ b/contracts/contracts/FundingRoundFactory.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import {FundingRound} from './FundingRound.sol'; import {IClrFund} from './interfaces/IClrFund.sol'; diff --git a/contracts/contracts/MACICommon.sol b/contracts/contracts/MACICommon.sol index 3a73b4110..05762874e 100644 --- a/contracts/contracts/MACICommon.sol +++ b/contracts/contracts/MACICommon.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; /** * @dev a contract that holds common MACI structures diff --git a/contracts/contracts/MACIFactory.sol b/contracts/contracts/MACIFactory.sol index 1fb0b800b..2bccc4655 100644 --- a/contracts/contracts/MACIFactory.sol +++ b/contracts/contracts/MACIFactory.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import {MACI} from 'maci-contracts/contracts/MACI.sol'; import {IPollFactory} from 'maci-contracts/contracts/interfaces/IPollFactory.sol'; -import {ITallySubsidyFactory} from 'maci-contracts/contracts/interfaces/ITallySubsidyFactory.sol'; +import {ITallyFactory} from 'maci-contracts/contracts/interfaces/ITallyFactory.sol'; import {IMessageProcessorFactory} from 'maci-contracts/contracts/interfaces/IMPFactory.sol'; import {SignUpGatekeeper} from 'maci-contracts/contracts/gatekeepers/SignUpGatekeeper.sol'; import {InitialVoiceCreditProxy} from 'maci-contracts/contracts/initialVoiceCreditProxy/InitialVoiceCreditProxy.sol'; @@ -17,7 +17,7 @@ import {Params} from 'maci-contracts/contracts/utilities/Params.sol'; import {DomainObjs} from 'maci-contracts/contracts/utilities/DomainObjs.sol'; import {MACICommon} from './MACICommon.sol'; -contract MACIFactory is Ownable, Params, SnarkCommon, DomainObjs, MACICommon { +contract MACIFactory is Ownable(msg.sender), Params, SnarkCommon, DomainObjs, MACICommon { // Verifying Key Registry containing circuit parameters VkRegistry public vkRegistry; @@ -135,7 +135,8 @@ contract MACIFactory is Ownable, Params, SnarkCommon, DomainObjs, MACICommon { _stateTreeDepth, _treeDepths.messageTreeDepth, _treeDepths.voteOptionTreeDepth, - messageBatchSize) + messageBatchSize, + Mode.QV) ) { revert ProcessVkNotSet(); } @@ -143,7 +144,8 @@ contract MACIFactory is Ownable, Params, SnarkCommon, DomainObjs, MACICommon { if (!vkRegistry.hasTallyVk( _stateTreeDepth, _treeDepths.intStateTreeDepth, - _treeDepths.voteOptionTreeDepth) + _treeDepths.voteOptionTreeDepth, + Mode.QV) ) { revert TallyVkNotSet(); } @@ -175,7 +177,8 @@ contract MACIFactory is Ownable, Params, SnarkCommon, DomainObjs, MACICommon { stateTreeDepth, treeDepths.messageTreeDepth, treeDepths.voteOptionTreeDepth, - messageBatchSize) + messageBatchSize, + Mode.QV) ) { revert ProcessVkNotSet(); } @@ -183,7 +186,8 @@ contract MACIFactory is Ownable, Params, SnarkCommon, DomainObjs, MACICommon { if (!vkRegistry.hasTallyVk( stateTreeDepth, treeDepths.intStateTreeDepth, - treeDepths.voteOptionTreeDepth) + treeDepths.voteOptionTreeDepth, + Mode.QV) ) { revert TallyVkNotSet(); } @@ -191,8 +195,7 @@ contract MACIFactory is Ownable, Params, SnarkCommon, DomainObjs, MACICommon { _maci = new MACI( IPollFactory(factories.pollFactory), IMessageProcessorFactory(factories.messageProcessorFactory), - ITallySubsidyFactory(factories.tallyFactory), - ITallySubsidyFactory(factories.subsidyFactory), + ITallyFactory(factories.tallyFactory), signUpGatekeeper, initialVoiceCreditProxy, TopupCredit(topupCredit), @@ -205,8 +208,7 @@ contract MACIFactory is Ownable, Params, SnarkCommon, DomainObjs, MACICommon { coordinatorPubKey, address(verifier), address(vkRegistry), - // pass false to not deploy the subsidy contract - false + Mode.QV ); // transfer ownership to coordinator to run the tally scripts diff --git a/contracts/contracts/OwnableUpgradeable.sol b/contracts/contracts/OwnableUpgradeable.sol index 3826e125a..152178fe4 100644 --- a/contracts/contracts/OwnableUpgradeable.sol +++ b/contracts/contracts/OwnableUpgradeable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.10; +pragma solidity 0.8.20; // NOTE: had to copy contracts over since OZ uses a higher pragma than we do in the one's they maintain. diff --git a/contracts/contracts/TopupToken.sol b/contracts/contracts/TopupToken.sol index c70068ae7..8cafce9e1 100644 --- a/contracts/contracts/TopupToken.sol +++ b/contracts/contracts/TopupToken.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import {ERC20} from '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; @@ -9,7 +9,7 @@ import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; * TopupToken is used by MACI Poll contract to validate the topup credits of a user * In clrfund, this is only used as gateway to pass the topup amount to the Poll contract */ -contract TopupToken is ERC20, Ownable { +contract TopupToken is ERC20, Ownable(msg.sender) { constructor() ERC20("TopupCredit", "TopupCredit") {} function airdrop(uint256 amount) public onlyOwner { diff --git a/contracts/contracts/interfaces/IClrFund.sol b/contracts/contracts/interfaces/IClrFund.sol index 5da1b8b45..2f77f992d 100644 --- a/contracts/contracts/interfaces/IClrFund.sol +++ b/contracts/contracts/interfaces/IClrFund.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity 0.8.10; +pragma solidity 0.8.20; import {ERC20} from '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import {IUserRegistry} from '../userRegistry/IUserRegistry.sol'; diff --git a/contracts/contracts/interfaces/IFundingRound.sol b/contracts/contracts/interfaces/IFundingRound.sol index 026f40c0a..65daf3ea6 100644 --- a/contracts/contracts/interfaces/IFundingRound.sol +++ b/contracts/contracts/interfaces/IFundingRound.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import {ERC20} from '@openzeppelin/contracts/token/ERC20/ERC20.sol'; diff --git a/contracts/contracts/interfaces/IFundingRoundFactory.sol b/contracts/contracts/interfaces/IFundingRoundFactory.sol index 9ca5806f1..45ec956fa 100644 --- a/contracts/contracts/interfaces/IFundingRoundFactory.sol +++ b/contracts/contracts/interfaces/IFundingRoundFactory.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import {ERC20} from '@openzeppelin/contracts/token/ERC20/ERC20.sol'; diff --git a/contracts/contracts/interfaces/IMACIFactory.sol b/contracts/contracts/interfaces/IMACIFactory.sol index d5d0bf3b2..eacfd7df2 100644 --- a/contracts/contracts/interfaces/IMACIFactory.sol +++ b/contracts/contracts/interfaces/IMACIFactory.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import {IVkRegistry} from 'maci-contracts/contracts/interfaces/IVkRegistry.sol'; import {IVerifier} from 'maci-contracts/contracts/interfaces/IVerifier.sol'; diff --git a/contracts/contracts/maci/BabyJubJub.sol b/contracts/contracts/maci/BabyJubJub.sol deleted file mode 100644 index 7d046b624..000000000 --- a/contracts/contracts/maci/BabyJubJub.sol +++ /dev/null @@ -1,136 +0,0 @@ -// @note This code was taken from -// https://github.com/privacy-scaling-explorations/maci/blob/dc18e2f046cf160f846f003c04ec4dfac502f6ae/contracts/contracts/crypto/BabyJubJub.sol -// TODO remove this and use MACI npm package when version greater than 1.2.0 is released - -// SPDX-License-Identifier: MIT -pragma solidity 0.8.10; - -library CurveBabyJubJub { - // Curve parameters - // E: 168700x^2 + y^2 = 1 + 168696x^2y^2 - // A = 168700 - uint256 public constant A = 0x292FC; - // D = 168696 - uint256 public constant D = 0x292F8; - // Prime Q = 21888242871839275222246405745257275088548364400416034343698204186575808495617 - uint256 public constant Q = 0x30644E72E131A029B85045B68181585D2833E84879B9709143E1F593F0000001; - - /** - * @dev Add 2 points on baby jubjub curve - * Formula for adding 2 points on a twisted Edwards curve: - * x3 = (x1y2 + y1x2) / (1 + dx1x2y1y2) - * y3 = (y1y2 - ax1x2) / (1 - dx1x2y1y2) - */ - function pointAdd(uint256 _x1, uint256 _y1, uint256 _x2, uint256 _y2) internal view returns (uint256 x3, uint256 y3) { - if (_x1 == 0 && _y1 == 0) { - return (_x2, _y2); - } - - if (_x2 == 0 && _y1 == 0) { - return (_x1, _y1); - } - - uint256 x1x2 = mulmod(_x1, _x2, Q); - uint256 y1y2 = mulmod(_y1, _y2, Q); - uint256 dx1x2y1y2 = mulmod(D, mulmod(x1x2, y1y2, Q), Q); - uint256 x3Num = addmod(mulmod(_x1, _y2, Q), mulmod(_y1, _x2, Q), Q); - uint256 y3Num = submod(y1y2, mulmod(A, x1x2, Q), Q); - - x3 = mulmod(x3Num, inverse(addmod(1, dx1x2y1y2, Q)), Q); - y3 = mulmod(y3Num, inverse(submod(1, dx1x2y1y2, Q)), Q); - } - - /** - * @dev Double a point on baby jubjub curve - * Doubling can be performed with the same formula as addition - */ - function pointDouble(uint256 _x1, uint256 _y1) internal view returns (uint256 x2, uint256 y2) { - return pointAdd(_x1, _y1, _x1, _y1); - } - - /** - * @dev Multiply a point on baby jubjub curve by a scalar - * Use the double and add algorithm - */ - function pointMul(uint256 _x1, uint256 _y1, uint256 _d) internal view returns (uint256 x2, uint256 y2) { - uint256 remaining = _d; - - uint256 px = _x1; - uint256 py = _y1; - uint256 ax = 0; - uint256 ay = 0; - - while (remaining != 0) { - if ((remaining & 1) != 0) { - // Binary digit is 1 so add - (ax, ay) = pointAdd(ax, ay, px, py); - } - - (px, py) = pointDouble(px, py); - - remaining = remaining / 2; - } - - x2 = ax; - y2 = ay; - } - - /** - * @dev Check if a given point is on the curve - * (168700x^2 + y^2) - (1 + 168696x^2y^2) == 0 - */ - function isOnCurve(uint256 _x, uint256 _y) internal pure returns (bool) { - uint256 xSq = mulmod(_x, _x, Q); - uint256 ySq = mulmod(_y, _y, Q); - uint256 lhs = addmod(mulmod(A, xSq, Q), ySq, Q); - uint256 rhs = addmod(1, mulmod(mulmod(D, xSq, Q), ySq, Q), Q); - return submod(lhs, rhs, Q) == 0; - } - - /** - * @dev Perform modular subtraction - */ - function submod(uint256 _a, uint256 _b, uint256 _mod) internal pure returns (uint256) { - uint256 aNN = _a; - - if (_a <= _b) { - aNN += _mod; - } - - return addmod(aNN - _b, 0, _mod); - } - - /** - * @dev Compute modular inverse of a number - */ - function inverse(uint256 _a) internal view returns (uint256) { - // We can use Euler's theorem instead of the extended Euclidean algorithm - // Since m = Q and Q is prime we have: a^-1 = a^(m - 2) (mod m) - return expmod(_a, Q - 2, Q); - } - - /** - * @dev Helper function to call the bigModExp precompile - */ - function expmod(uint256 _b, uint256 _e, uint256 _m) internal view returns (uint256 o) { - assembly { - let memPtr := mload(0x40) - mstore(memPtr, 0x20) // Length of base _b - mstore(add(memPtr, 0x20), 0x20) // Length of exponent _e - mstore(add(memPtr, 0x40), 0x20) // Length of modulus _m - mstore(add(memPtr, 0x60), _b) // Base _b - mstore(add(memPtr, 0x80), _e) // Exponent _e - mstore(add(memPtr, 0xa0), _m) // Modulus _m - - // The bigModExp precompile is at 0x05 - let success := staticcall(gas(), 0x05, memPtr, 0xc0, memPtr, 0x20) - switch success - case 0 { - revert(0x0, 0x0) - } - default { - o := mload(memPtr) - } - } - } -} diff --git a/contracts/contracts/maci/Poll.sol b/contracts/contracts/maci/Poll.sol deleted file mode 100644 index 1306c7698..000000000 --- a/contracts/contracts/maci/Poll.sol +++ /dev/null @@ -1,286 +0,0 @@ -// @note This code was taken from maci-contracts v1.2.0 with public key validation from -// https://github.com/privacy-scaling-explorations/maci/blob/dc18e2f046cf160f846f003c04ec4dfac502f6ae/contracts/contracts/Poll.sol -// TODO remove this and use MACI npm package when version greater than 1.2.0 is released - -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.10; - -import { Params } from "maci-contracts/contracts/utilities/Params.sol"; -import { SnarkCommon } from "maci-contracts/contracts/crypto/SnarkCommon.sol"; -import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; -import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import { EmptyBallotRoots } from "maci-contracts/contracts/trees/EmptyBallotRoots.sol"; -import { IPoll } from "maci-contracts/contracts/interfaces/IPoll.sol"; -import { Utilities } from "maci-contracts/contracts/utilities/Utilities.sol"; -import { CurveBabyJubJub } from "./BabyJubJub.sol"; - -/// @title Poll -/// @notice A Poll contract allows voters to submit encrypted messages -/// which can be either votes, key change messages or topup messages. -/// @dev Do not deploy this directly. Use PollFactory.deploy() which performs some -/// checks on the Poll constructor arguments. -contract Poll is Params, Utilities, SnarkCommon, Ownable, EmptyBallotRoots, IPoll { - using SafeERC20 for ERC20; - - /// @notice Whether the Poll has been initialized - bool internal isInit; - - /// @notice The coordinator's public key - PubKey public coordinatorPubKey; - - /// @notice Hash of the coordinator's public key - uint256 public immutable coordinatorPubKeyHash; - - /// @notice the state root of the state merkle tree - uint256 public mergedStateRoot; - - // The timestamp of the block at which the Poll was deployed - uint256 internal immutable deployTime; - - // The duration of the polling period, in seconds - uint256 internal immutable duration; - - /// @notice Whether the MACI contract's stateAq has been merged by this contract - bool public stateAqMerged; - - /// @notice Get the commitment to the state leaves and the ballots. This is - /// hash3(stateRoot, ballotRoot, salt). - /// Its initial value should be - /// hash(maciStateRootSnapshot, emptyBallotRoot, 0) - /// Each successful invocation of processMessages() should use a different - /// salt to update this value, so that an external observer cannot tell in - /// the case that none of the messages are valid. - uint256 public currentSbCommitment; - - /// @notice The number of messages that have been published - uint256 public numMessages; - - /// @notice The number of signups that have been processed - /// before the Poll ended (stateAq merged) - uint256 public numSignups; - - /// @notice Max values for the poll - MaxValues public maxValues; - - /// @notice Depths of the merkle trees - TreeDepths public treeDepths; - - /// @notice The contracts used by the Poll - ExtContracts public extContracts; - - error VotingPeriodOver(); - error VotingPeriodNotOver(); - error PollAlreadyInit(); - error TooManyMessages(); - error InvalidPubKey(); - error StateAqAlreadyMerged(); - error StateAqSubtreesNeedMerge(); - error InvalidBatchLength(); - - event PublishMessage(Message _message, PubKey _encPubKey); - event TopupMessage(Message _message); - event MergeMaciStateAqSubRoots(uint256 _numSrQueueOps); - event MergeMaciStateAq(uint256 _stateRoot, uint256 _numSignups); - event MergeMessageAqSubRoots(uint256 _numSrQueueOps); - event MergeMessageAq(uint256 _messageRoot); - - /// @notice Each MACI instance can have multiple Polls. - /// When a Poll is deployed, its voting period starts immediately. - /// @param _duration The duration of the voting period, in seconds - /// @param _maxValues The maximum number of messages and vote options - /// @param _treeDepths The depths of the merkle trees - /// @param _coordinatorPubKey The coordinator's public key - /// @param _extContracts The external contracts - constructor( - uint256 _duration, - MaxValues memory _maxValues, - TreeDepths memory _treeDepths, - PubKey memory _coordinatorPubKey, - ExtContracts memory _extContracts - ) payable { - // check that the coordinator public key is valid - if (!CurveBabyJubJub.isOnCurve(_coordinatorPubKey.x, _coordinatorPubKey.y)) { - revert InvalidPubKey(); - } - - // store the pub key as object then calculate the hash - coordinatorPubKey = _coordinatorPubKey; - // we hash it ourselves to ensure we store the correct value - coordinatorPubKeyHash = hashLeftRight(_coordinatorPubKey.x, _coordinatorPubKey.y); - // store the external contracts to interact with - extContracts = _extContracts; - // store duration of the poll - duration = _duration; - // store max values - maxValues = _maxValues; - // store tree depth - treeDepths = _treeDepths; - // Record the current timestamp - deployTime = block.timestamp; - } - - /// @notice A modifier that causes the function to revert if the voting period is - /// not over. - modifier isAfterVotingDeadline() { - uint256 secondsPassed = block.timestamp - deployTime; - if (secondsPassed <= duration) revert VotingPeriodNotOver(); - _; - } - - /// @notice A modifier that causes the function to revert if the voting period is - /// over - modifier isWithinVotingDeadline() { - uint256 secondsPassed = block.timestamp - deployTime; - if (secondsPassed >= duration) revert VotingPeriodOver(); - _; - } - - /// @notice The initialization function. - /// @dev Should be called immediately after Poll creation - /// and messageAq ownership transferred - function init() public { - if (isInit) revert PollAlreadyInit(); - // set to true so it cannot be called again - isInit = true; - - unchecked { - numMessages++; - } - - // init messageAq here by inserting placeholderLeaf - uint256[2] memory dat = [NOTHING_UP_MY_SLEEVE, 0]; - - (Message memory _message, PubKey memory _padKey, uint256 placeholderLeaf) = padAndHashMessage(dat, 1); - extContracts.messageAq.enqueue(placeholderLeaf); - - emit PublishMessage(_message, _padKey); - } - - /// @inheritdoc IPoll - function topup(uint256 stateIndex, uint256 amount) public virtual isWithinVotingDeadline { - // we check that we do not exceed the max number of messages - if (numMessages >= maxValues.maxMessages) revert TooManyMessages(); - - // cannot realistically overflow - unchecked { - numMessages++; - } - - /// @notice topupCredit is a trusted token contract which reverts if the transfer fails - extContracts.topupCredit.transferFrom(msg.sender, address(this), amount); - - uint256[2] memory dat = [stateIndex, amount]; - (Message memory _message, , uint256 messageLeaf) = padAndHashMessage(dat, 2); - - extContracts.messageAq.enqueue(messageLeaf); - - emit TopupMessage(_message); - } - - /// @inheritdoc IPoll - function publishMessage(Message memory _message, PubKey calldata _encPubKey) public virtual isWithinVotingDeadline { - // we check that we do not exceed the max number of messages - if (numMessages >= maxValues.maxMessages) revert TooManyMessages(); - - // validate that the public key is valid - if (!CurveBabyJubJub.isOnCurve(_encPubKey.x, _encPubKey.y)) { - revert InvalidPubKey(); - } - - // cannot realistically overflow - unchecked { - numMessages++; - } - - // we enforce that msgType here is 1 so we don't need checks - // at the circuit level - _message.msgType = 1; - - uint256 messageLeaf = hashMessageAndEncPubKey(_message, _encPubKey); - extContracts.messageAq.enqueue(messageLeaf); - - emit PublishMessage(_message, _encPubKey); - } - - /// @notice submit a message batch - /// @dev Can only be submitted before the voting deadline - /// @param _messages the messages - /// @param _encPubKeys the encrypted public keys - function publishMessageBatch(Message[] calldata _messages, PubKey[] calldata _encPubKeys) external { - if (_messages.length != _encPubKeys.length) { - revert InvalidBatchLength(); - } - - uint256 len = _messages.length; - for (uint256 i = 0; i < len; ) { - // an event will be published by this function already - publishMessage(_messages[i], _encPubKeys[i]); - - unchecked { - i++; - } - } - } - - /// @inheritdoc IPoll - function mergeMaciStateAqSubRoots(uint256 _numSrQueueOps, uint256 _pollId) public onlyOwner isAfterVotingDeadline { - // This function cannot be called after the stateAq was merged - if (stateAqMerged) revert StateAqAlreadyMerged(); - - // merge subroots - extContracts.maci.mergeStateAqSubRoots(_numSrQueueOps, _pollId); - - emit MergeMaciStateAqSubRoots(_numSrQueueOps); - } - - /// @inheritdoc IPoll - function mergeMaciStateAq(uint256 _pollId) public onlyOwner isAfterVotingDeadline { - // This function can only be called once per Poll after the voting - // deadline - if (stateAqMerged) revert StateAqAlreadyMerged(); - - // set merged to true so it cannot be called again - stateAqMerged = true; - - // the subtrees must have been merged first - if (!extContracts.maci.stateAq().subTreesMerged()) revert StateAqSubtreesNeedMerge(); - - mergedStateRoot = extContracts.maci.mergeStateAq(_pollId); - - // Set currentSbCommitment - uint256[3] memory sb; - sb[0] = mergedStateRoot; - sb[1] = emptyBallotRoots[treeDepths.voteOptionTreeDepth - 1]; - sb[2] = uint256(0); - - currentSbCommitment = hash3(sb); - - numSignups = extContracts.maci.numSignUps(); - emit MergeMaciStateAq(mergedStateRoot, numSignups); - } - - /// @inheritdoc IPoll - function mergeMessageAqSubRoots(uint256 _numSrQueueOps) public onlyOwner isAfterVotingDeadline { - extContracts.messageAq.mergeSubRoots(_numSrQueueOps); - emit MergeMessageAqSubRoots(_numSrQueueOps); - } - - /// @inheritdoc IPoll - function mergeMessageAq() public onlyOwner isAfterVotingDeadline { - uint256 root = extContracts.messageAq.merge(treeDepths.messageTreeDepth); - emit MergeMessageAq(root); - } - - /// @inheritdoc IPoll - function getDeployTimeAndDuration() public view returns (uint256 pollDeployTime, uint256 pollDuration) { - pollDeployTime = deployTime; - pollDuration = duration; - } - - /// @inheritdoc IPoll - function numSignUpsAndMessages() public view returns (uint256 numSUps, uint256 numMsgs) { - numSUps = numSignups; - numMsgs = numMessages; - } -} diff --git a/contracts/contracts/maci/PollFactory.sol b/contracts/contracts/maci/PollFactory.sol deleted file mode 100644 index ad91b4305..000000000 --- a/contracts/contracts/maci/PollFactory.sol +++ /dev/null @@ -1,73 +0,0 @@ -// @note This code was taken from https://github.com/privacy-scaling-explorations/maci/blob/dc18e2f046cf160f846f003c04ec4dfac502f6ae/contracts/contracts/PollFactory.sol -// TODO remove this and use MACI npm package when version greater than 1.2.0 is released - -// SPDX-License-Identifier: MIT -pragma solidity 0.8.10; - - -import { IMACI } from "maci-contracts/contracts/interfaces/IMACI.sol"; -import { AccQueue } from "maci-contracts/contracts/trees/AccQueue.sol"; -import { AccQueueQuinaryMaci } from "maci-contracts/contracts/trees/AccQueueQuinaryMaci.sol"; -import { TopupCredit } from "maci-contracts/contracts/TopupCredit.sol"; -import { Params } from "maci-contracts/contracts/utilities/Params.sol"; -import { DomainObjs } from "maci-contracts/contracts/utilities/DomainObjs.sol"; -import { Poll } from "./Poll.sol"; -import { IPollFactory } from "maci-contracts/contracts/interfaces/IPollFactory.sol"; - -/// @title PollFactory -/// @notice A factory contract which deploys Poll contracts. It allows the MACI contract -/// size to stay within the limit set by EIP-170. -contract PollFactory is Params, DomainObjs, IPollFactory { - // The number of children each node in the message tree has - uint256 internal constant TREE_ARITY = 5; - - // custom error - error InvalidMaxValues(); - - /// @notice The PollFactory constructor - // solhint-disable-next-line no-empty-blocks - constructor() payable {} - - /// @inheritdoc IPollFactory - function deploy( - uint256 _duration, - MaxValues calldata _maxValues, - TreeDepths calldata _treeDepths, - PubKey calldata _coordinatorPubKey, - address _maci, - TopupCredit _topupCredit, - address _pollOwner - ) public virtual returns (address pollAddr) { - /// @notice Validate _maxValues - /// maxVoteOptions must be less than 2 ** 50 due to circuit limitations; - /// it will be packed as a 50-bit value along with other values as one - /// of the inputs (aka packedVal) - if (_maxValues.maxVoteOptions >= (2 ** 50)) { - revert InvalidMaxValues(); - } - - /// @notice deploy a new AccQueue contract to store messages - AccQueue messageAq = new AccQueueQuinaryMaci(_treeDepths.messageTreeSubDepth); - - /// @notice the smart contracts that a Poll would interact with - ExtContracts memory extContracts = ExtContracts({ - maci: IMACI(_maci), - messageAq: messageAq, - topupCredit: _topupCredit - }); - - // deploy the poll - Poll poll = new Poll(_duration, _maxValues, _treeDepths, _coordinatorPubKey, extContracts); - - // Make the Poll contract own the messageAq contract, so only it can - // run enqueue/merge - messageAq.transferOwnership(address(poll)); - - // init Poll - poll.init(); - - poll.transferOwnership(_pollOwner); - - pollAddr = address(poll); - } -} diff --git a/contracts/contracts/recipientRegistry/BaseRecipientRegistry.sol b/contracts/contracts/recipientRegistry/BaseRecipientRegistry.sol index 8215fce92..d8c656d21 100644 --- a/contracts/contracts/recipientRegistry/BaseRecipientRegistry.sol +++ b/contracts/contracts/recipientRegistry/BaseRecipientRegistry.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import './IRecipientRegistry.sol'; diff --git a/contracts/contracts/recipientRegistry/IKlerosGTCR.sol b/contracts/contracts/recipientRegistry/IKlerosGTCR.sol index 6eda6f7cb..2326e70ba 100644 --- a/contracts/contracts/recipientRegistry/IKlerosGTCR.sol +++ b/contracts/contracts/recipientRegistry/IKlerosGTCR.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; /** * @dev Interface for Kleros Generalized TCR. diff --git a/contracts/contracts/recipientRegistry/IRecipientRegistry.sol b/contracts/contracts/recipientRegistry/IRecipientRegistry.sol index 3f139948e..82fc0c4a9 100644 --- a/contracts/contracts/recipientRegistry/IRecipientRegistry.sol +++ b/contracts/contracts/recipientRegistry/IRecipientRegistry.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; /** * @dev Interface of the recipient registry. diff --git a/contracts/contracts/recipientRegistry/KlerosGTCRAdapter.sol b/contracts/contracts/recipientRegistry/KlerosGTCRAdapter.sol index 2bf70bd6d..621e6dd45 100644 --- a/contracts/contracts/recipientRegistry/KlerosGTCRAdapter.sol +++ b/contracts/contracts/recipientRegistry/KlerosGTCRAdapter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import 'solidity-rlp/contracts/RLPReader.sol'; diff --git a/contracts/contracts/recipientRegistry/KlerosGTCRMock.sol b/contracts/contracts/recipientRegistry/KlerosGTCRMock.sol index abbc9bd16..e1988cd4e 100644 --- a/contracts/contracts/recipientRegistry/KlerosGTCRMock.sol +++ b/contracts/contracts/recipientRegistry/KlerosGTCRMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import '@openzeppelin/contracts/access/Ownable.sol'; @@ -9,7 +9,7 @@ import '@openzeppelin/contracts/access/Ownable.sol'; * This contract is a curated registry for any types of items. Just like a TCR contract it features the request-challenge protocol and appeal fees crowdfunding. * Adapted from https://github.com/kleros/tcr/blob/v2.0.0/contracts/GeneralizedTCR.sol */ -contract KlerosGTCRMock is Ownable { +contract KlerosGTCRMock is Ownable(msg.sender) { enum Status { Absent, // The item is not in the registry. diff --git a/contracts/contracts/recipientRegistry/OptimisticRecipientRegistry.sol b/contracts/contracts/recipientRegistry/OptimisticRecipientRegistry.sol index 8bc331dbb..57ac016f5 100644 --- a/contracts/contracts/recipientRegistry/OptimisticRecipientRegistry.sol +++ b/contracts/contracts/recipientRegistry/OptimisticRecipientRegistry.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import '@openzeppelin/contracts/access/Ownable.sol'; @@ -9,7 +9,7 @@ import './BaseRecipientRegistry.sol'; /** * @dev Recipient registry with optimistic execution of registrations and removals. */ -contract OptimisticRecipientRegistry is Ownable, BaseRecipientRegistry { +contract OptimisticRecipientRegistry is Ownable(msg.sender), BaseRecipientRegistry { // Enums enum RequestType { diff --git a/contracts/contracts/recipientRegistry/PermissionedRecipientRegistry.sol b/contracts/contracts/recipientRegistry/PermissionedRecipientRegistry.sol index 3833f3f77..fe8e16829 100644 --- a/contracts/contracts/recipientRegistry/PermissionedRecipientRegistry.sol +++ b/contracts/contracts/recipientRegistry/PermissionedRecipientRegistry.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import '@openzeppelin/contracts/access/Ownable.sol'; @@ -9,7 +9,7 @@ import './BaseRecipientRegistry.sol'; /** * @dev Recipient registry with permissioned execution of registrations and removals. */ -contract PermissionedRecipientRegistry is Ownable, BaseRecipientRegistry { +contract PermissionedRecipientRegistry is Ownable(msg.sender), BaseRecipientRegistry { // Enums enum RequestType { diff --git a/contracts/contracts/recipientRegistry/SimpleRecipientRegistry.sol b/contracts/contracts/recipientRegistry/SimpleRecipientRegistry.sol index bd273cea1..11c2b2014 100644 --- a/contracts/contracts/recipientRegistry/SimpleRecipientRegistry.sol +++ b/contracts/contracts/recipientRegistry/SimpleRecipientRegistry.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import '@openzeppelin/contracts/access/Ownable.sol'; @@ -9,7 +9,7 @@ import './BaseRecipientRegistry.sol'; /** * @dev A simple recipient registry managed by a trusted entity. */ -contract SimpleRecipientRegistry is Ownable, BaseRecipientRegistry { +contract SimpleRecipientRegistry is Ownable(msg.sender), BaseRecipientRegistry { // Events event RecipientAdded( diff --git a/contracts/contracts/userRegistry/BrightIdSponsor.sol b/contracts/contracts/userRegistry/BrightIdSponsor.sol index 302a80b13..d27487d2a 100644 --- a/contracts/contracts/userRegistry/BrightIdSponsor.sol +++ b/contracts/contracts/userRegistry/BrightIdSponsor.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; contract BrightIdSponsor { event Sponsor(address indexed addr); diff --git a/contracts/contracts/userRegistry/BrightIdUserRegistry.sol b/contracts/contracts/userRegistry/BrightIdUserRegistry.sol index 09557af3a..49033f0bc 100644 --- a/contracts/contracts/userRegistry/BrightIdUserRegistry.sol +++ b/contracts/contracts/userRegistry/BrightIdUserRegistry.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import './IUserRegistry.sol'; import './BrightIdSponsor.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; -contract BrightIdUserRegistry is Ownable, IUserRegistry { +contract BrightIdUserRegistry is Ownable(msg.sender), IUserRegistry { string private constant ERROR_NEWER_VERIFICATION = 'NEWER VERIFICATION REGISTERED BEFORE'; string private constant ERROR_NOT_AUTHORIZED = 'NOT AUTHORIZED'; string private constant ERROR_INVALID_VERIFIER = 'INVALID VERIFIER'; diff --git a/contracts/contracts/userRegistry/IUserRegistry.sol b/contracts/contracts/userRegistry/IUserRegistry.sol index cce90ae42..2bd12bddf 100644 --- a/contracts/contracts/userRegistry/IUserRegistry.sol +++ b/contracts/contracts/userRegistry/IUserRegistry.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; /** * @dev Interface of the registry of verified users. diff --git a/contracts/contracts/userRegistry/MerkleUserRegistry.sol b/contracts/contracts/userRegistry/MerkleUserRegistry.sol index e6ff85c0f..0c6c39303 100644 --- a/contracts/contracts/userRegistry/MerkleUserRegistry.sol +++ b/contracts/contracts/userRegistry/MerkleUserRegistry.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import '@openzeppelin/contracts/access/Ownable.sol'; @@ -13,7 +13,7 @@ import {MerkleProof} from '../utils/cryptography/MerkleProof.sol'; * a successful verification against the merkle root set by * the funding round coordinator. */ -contract MerkleUserRegistry is Ownable, IUserRegistry { +contract MerkleUserRegistry is Ownable(msg.sender), IUserRegistry { // verified users grouped by merkleRoot // merkleRoot -> user -> status diff --git a/contracts/contracts/userRegistry/SemaphoreUserRegistry.sol b/contracts/contracts/userRegistry/SemaphoreUserRegistry.sol index a141e422e..9be159b9b 100644 --- a/contracts/contracts/userRegistry/SemaphoreUserRegistry.sol +++ b/contracts/contracts/userRegistry/SemaphoreUserRegistry.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import '@openzeppelin/contracts/access/Ownable.sol'; @@ -9,7 +9,7 @@ import './IUserRegistry.sol'; /** * @dev A simple semaphore user registry managed by a trusted entity. */ -contract SemaphoreUserRegistry is Ownable, IUserRegistry { +contract SemaphoreUserRegistry is Ownable(msg.sender), IUserRegistry { mapping(address => bool) private users; mapping(uint256 => bool) private semaphoreIds; diff --git a/contracts/contracts/userRegistry/SimpleUserRegistry.sol b/contracts/contracts/userRegistry/SimpleUserRegistry.sol index 4f4a7ff00..21fcaa38a 100644 --- a/contracts/contracts/userRegistry/SimpleUserRegistry.sol +++ b/contracts/contracts/userRegistry/SimpleUserRegistry.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import '@openzeppelin/contracts/access/Ownable.sol'; @@ -9,7 +9,7 @@ import './IUserRegistry.sol'; /** * @dev A simple user registry managed by a trusted entity. */ -contract SimpleUserRegistry is Ownable, IUserRegistry { +contract SimpleUserRegistry is Ownable(msg.sender), IUserRegistry { mapping(address => bool) private users; diff --git a/contracts/contracts/userRegistry/SnapshotUserRegistry.sol b/contracts/contracts/userRegistry/SnapshotUserRegistry.sol index 754bf869c..3d7ecdd18 100644 --- a/contracts/contracts/userRegistry/SnapshotUserRegistry.sol +++ b/contracts/contracts/userRegistry/SnapshotUserRegistry.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import '@openzeppelin/contracts/access/Ownable.sol'; @@ -14,7 +14,7 @@ import {StateProofVerifier} from '../utils/cryptography/StateProofVerifier.sol'; * @dev A user registry that verifies users based on ownership of a token * at a specific block snapshot */ -contract SnapshotUserRegistry is Ownable, IUserRegistry { +contract SnapshotUserRegistry is Ownable(msg.sender), IUserRegistry { using RLPReader for RLPReader.RLPItem; using RLPReader for bytes; diff --git a/contracts/contracts/utils/cryptography/MerklePatriciaProofVerifier.sol b/contracts/contracts/utils/cryptography/MerklePatriciaProofVerifier.sol index b0a6df1d3..a24404e9e 100644 --- a/contracts/contracts/utils/cryptography/MerklePatriciaProofVerifier.sol +++ b/contracts/contracts/utils/cryptography/MerklePatriciaProofVerifier.sol @@ -4,7 +4,7 @@ * Modified from https://github.com/lidofinance/curve-merkle-oracle/blob/main/contracts/MerklePatriciaProofVerifier.sol * git commit hash 1033b3e84142317ffd8f366b52e489d5eb49c73f */ -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import {RLPReader} from 'solidity-rlp/contracts/RLPReader.sol'; diff --git a/contracts/contracts/utils/cryptography/MerkleProof.sol b/contracts/contracts/utils/cryptography/MerkleProof.sol index 08c4a87ed..dd2c0aa99 100644 --- a/contracts/contracts/utils/cryptography/MerkleProof.sol +++ b/contracts/contracts/utils/cryptography/MerkleProof.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // Modified from OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol) -pragma solidity ^0.8.10; +pragma solidity 0.8.20; /** * @dev These functions deal with verification of Merkle Tree proofs. diff --git a/contracts/contracts/utils/cryptography/StateProofVerifier.sol b/contracts/contracts/utils/cryptography/StateProofVerifier.sol index 407ccd0bc..9425345b1 100644 --- a/contracts/contracts/utils/cryptography/StateProofVerifier.sol +++ b/contracts/contracts/utils/cryptography/StateProofVerifier.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.10; +pragma solidity 0.8.20; import {RLPReader} from 'solidity-rlp/contracts/RLPReader.sol'; import {MerklePatriciaProofVerifier} from './MerklePatriciaProofVerifier.sol'; diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 470029275..7837be09c 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -119,7 +119,7 @@ export default { disambiguatePaths: false, }, solidity: { - version: '0.8.10', + version: '0.8.20', settings: { optimizer: { enabled: true, @@ -128,7 +128,6 @@ export default { }, overrides: { 'contracts/FundingRoundFactory.sol': { - version: '0.8.10', settings: { optimizer: { enabled: true, @@ -137,7 +136,6 @@ export default { }, }, 'contracts/FundingRound.sol': { - version: '0.8.10', settings: { optimizer: { enabled: true, @@ -146,7 +144,6 @@ export default { }, }, 'contracts/recipientRegistry/OptimisticRecipientRegistry.sol': { - version: '0.8.10', settings: { optimizer: { enabled: true, @@ -155,7 +152,6 @@ export default { }, }, 'contracts/userRegistry/SimpleUserRegistry.sol': { - version: '0.8.10', settings: { optimizer: { enabled: true, @@ -164,7 +160,6 @@ export default { }, }, 'contracts/userRegistry/BrightIdUserRegistry.sol': { - version: '0.8.10', settings: { optimizer: { enabled: true, diff --git a/contracts/package.json b/contracts/package.json index 9a3941562..2f70d0f24 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -15,18 +15,18 @@ "clean": "rm -rf cache && rm -rf build" }, "dependencies": { - "@openzeppelin/contracts": "4.9.0", + "@openzeppelin/contracts": "5.0.2", "@pinata/sdk": "^2.1.0", "dotenv": "^8.2.0", - "maci-contracts": "1.2.0", + "maci-contracts": "1.2.1", "solidity-rlp": "2.0.8" }, "devDependencies": { "@clrfund/common": "^0.0.1", "@clrfund/waffle-mock-contract": "^0.0.4", "@kleros/gtcr-encoder": "^1.4.0", - "@nomicfoundation/hardhat-chai-matchers": "^2.0.3", - "@nomicfoundation/hardhat-ethers": "^3.0.5", + "@nomicfoundation/hardhat-chai-matchers": "^2.0.6", + "@nomicfoundation/hardhat-ethers": "^3.0.6", "@nomicfoundation/hardhat-network-helpers": "^1.0.10", "@nomicfoundation/hardhat-toolbox": "^4.0.0", "@nomicfoundation/hardhat-verify": "^2.0.3", @@ -34,14 +34,16 @@ "@typechain/ethers-v6": "^0.5.1", "@typechain/hardhat": "^9.1.0", "@types/mocha": "^10.0.6", - "ethers": "^6.11.1", + "chai": "4", + "ethers": "^6.12.1", "hardhat": "^2.19.4", "hardhat-contract-sizer": "^2.10.0", "hardhat-gas-reporter": "^1.0.8", "ipfs-only-hash": "^2.0.1", - "maci-circuits": "^1.2.0", - "maci-cli": "^1.2.0", - "maci-domainobjs": "1.2.0", + "lowdb": "1.0.0", + "maci-circuits": "1.2.1", + "maci-cli": "1.2.1", + "maci-domainobjs": "1.2.1", "mocha": "^10.2.0", "solidity-coverage": "^0.8.1", "ts-node": "^10.9.2", diff --git a/contracts/tasks/runners/genProofs.ts b/contracts/tasks/runners/genProofs.ts index ed3061edb..708573980 100644 --- a/contracts/tasks/runners/genProofs.ts +++ b/contracts/tasks/runners/genProofs.ts @@ -187,7 +187,7 @@ task('gen-proofs', 'Generate MACI proofs offchain') quiet, outputPath: maciStateFile, pollId, - maciContractAddress: maciAddress, + maciAddress, coordinatorPrivateKey: coordinatorMacisk, ethereumProvider: providerUrl, transactionHash: maciTxHash, diff --git a/contracts/tasks/subtasks/clrfund/03-setVkRegsitry.ts b/contracts/tasks/subtasks/clrfund/03-setVkRegsitry.ts index a3fefb412..fcbe9b1bb 100644 --- a/contracts/tasks/subtasks/clrfund/03-setVkRegsitry.ts +++ b/contracts/tasks/subtasks/clrfund/03-setVkRegsitry.ts @@ -3,6 +3,7 @@ import { setVerifyingKeys } from '../../../utils/contracts' import { MaciParameters } from '../../../utils/maciParameters' import { Subtask } from '../../helpers/Subtask' import { EContracts, ISubtaskParams } from '../../helpers/types' +import { EMode } from 'maci-contracts' const subtask = Subtask.getInstance() @@ -39,13 +40,15 @@ subtask stateTreeDepth, messageTreeDepth, voteOptionTreeDepth, - messageBatchSize + messageBatchSize, + EMode.QV ) const hasTallyVk = await vkRegistryContract.hasTallyVk( stateTreeDepth, intStateTreeDepth, - voteOptionTreeDepth + voteOptionTreeDepth, + EMode.QV ) if (incremental) { diff --git a/contracts/tasks/subtasks/coordinator/01-coordinator.ts b/contracts/tasks/subtasks/coordinator/01-coordinator.ts index 3b2f0b767..10685b5a7 100644 --- a/contracts/tasks/subtasks/coordinator/01-coordinator.ts +++ b/contracts/tasks/subtasks/coordinator/01-coordinator.ts @@ -44,19 +44,30 @@ subtask clrfundContract.coordinatorPubKey(), ]) - const currentPubKey = new PubKey([coordinatorPubKey.x, coordinatorPubKey.y]) + // if the coordinator has not been set in the clrfund contract + // use allowInvalid option to prevent it from throwing in new PubKey() + const allowInvalid = true + const currentPubKey = new PubKey( + [coordinatorPubKey.x, coordinatorPubKey.y], + allowInvalid + ) const newPrivKey = PrivKey.deserialize(coordinatorMacisk) const newKeypair = new Keypair(newPrivKey) const normalizedCurrentCoordinator = getAddress(currentCoordinator) const normalizedNewCoordinator = getAddress(coordinatorAddress) - console.log('Current coordinator', normalizedCurrentCoordinator) - console.log(' New coordinator', normalizedNewCoordinator) + console.log('Current coordinator:', normalizedCurrentCoordinator) + console.log(' New coordinator:', normalizedNewCoordinator) - const serializedCurrentPubKey = currentPubKey.serialize() + let serializedCurrentPubKey = 'Not set' + try { + serializedCurrentPubKey = currentPubKey.serialize() + } catch { + // if the public key was not set, serialize will throw. + } const serializedNewPubKey = newKeypair.pubKey.serialize() - console.log('Current MACI key', serializedCurrentPubKey) - console.log(' New MACI key', serializedNewPubKey) + console.log('Current MACI key:', serializedCurrentPubKey) + console.log(' New MACI key:', serializedNewPubKey) console.log() if ( diff --git a/contracts/tasks/subtasks/round/02-deploy-round.ts b/contracts/tasks/subtasks/round/02-deploy-round.ts index 812bf75b7..707216d2c 100644 --- a/contracts/tasks/subtasks/round/02-deploy-round.ts +++ b/contracts/tasks/subtasks/round/02-deploy-round.ts @@ -15,6 +15,7 @@ import { } from '../../../typechain-types' import { ContractTransactionResponse } from 'ethers' import { ISubtaskParams } from '../../helpers/types' +import { EMode } from 'maci-contracts' const subtask = Subtask.getInstance() const storage = ContractStorage.getInstance() @@ -69,7 +70,6 @@ async function registerMaci( maciContract.pollFactory(), maciContract.messageProcessorFactory(), maciContract.tallyFactory(), - maciContract.subsidyFactory(), maciContract.signUpGatekeeper(), maciContract.initialVoiceCreditProxy(), maciContract.topupCredit(), @@ -180,7 +180,7 @@ async function registerTallyAndMessageProcessor( tallyContract.vkRegistry(), ]) - let args = [verifier, vkRegistry, poll, mp] + let args = [verifier, vkRegistry, poll, mp, EMode.QV] await storage.register({ id: EContracts.Tally, contract: tallyContract, @@ -189,7 +189,7 @@ async function registerTallyAndMessageProcessor( tx, }) - args = [verifier, vkRegistry, poll] + args = [verifier, vkRegistry, poll, EMode.QV] await storage.register({ id: EContracts.MessageProcessor, contract: messageProcessorContract, diff --git a/contracts/utils/contracts.ts b/contracts/utils/contracts.ts index 77a2bc72d..3c26cf5d8 100644 --- a/contracts/utils/contracts.ts +++ b/contracts/utils/contracts.ts @@ -12,7 +12,7 @@ import { } from '@nomicfoundation/hardhat-ethers/types' import { VkRegistry, FundingRound } from '../typechain-types' import { MaciParameters } from './maciParameters' -import { IVerifyingKeyStruct } from 'maci-contracts' +import { EMode, IVerifyingKeyStruct } from 'maci-contracts' /** * Deploy a contract @@ -54,6 +54,7 @@ export async function setVerifyingKeys( params.treeDepths.messageTreeDepth, params.treeDepths.voteOptionTreeDepth, messageBatchSize, + EMode.QV, params.processVk.asContractParam() as IVerifyingKeyStruct, params.tallyVk.asContractParam() as IVerifyingKeyStruct ) @@ -128,10 +129,6 @@ export function getQualifiedContractName(name: EContracts | string): string { let contractName = String(name) if (contractName.includes('Poseidon')) { contractName = `:${name}` - } else if (name === EContracts.PollFactory) { - contractName = 'contracts/maci/PollFactory.sol:PollFactory' - } else if (name === EContracts.Poll) { - contractName = 'contracts/maci/Poll.sol:Poll' } return contractName } diff --git a/contracts/utils/maci.ts b/contracts/utils/maci.ts index bb3e3bb0b..caa8467ba 100644 --- a/contracts/utils/maci.ts +++ b/contracts/utils/maci.ts @@ -23,7 +23,7 @@ import { verify, } from 'maci-cli' -import { getTalyFilePath, isPathExist } from './misc' +import { isPathExist } from './misc' import { getCircuitFiles } from './circuits' import { FundingRound } from '../typechain-types' @@ -303,7 +303,7 @@ export async function mergeMaciSubtrees({ await mergeMessages({ pollId, - maciContractAddress: maciAddress, + maciAddress, numQueueOps, signer, quiet, @@ -311,7 +311,7 @@ export async function mergeMaciSubtrees({ await mergeSignups({ pollId, - maciContractAddress: maciAddress, + maciAddress, numQueueOps, signer, quiet, diff --git a/subgraph/abis/MACI.json b/subgraph/abis/MACI.json index 4a09120f9..ba7b1c96a 100644 --- a/subgraph/abis/MACI.json +++ b/subgraph/abis/MACI.json @@ -12,15 +12,10 @@ "type": "address" }, { - "internalType": "contract ITallySubsidyFactory", + "internalType": "contract ITallyFactory", "name": "_tallyFactory", "type": "address" }, - { - "internalType": "contract ITallySubsidyFactory", - "name": "_subsidyFactory", - "type": "address" - }, { "internalType": "contract SignUpGatekeeper", "name": "_signUpGatekeeper", @@ -63,7 +58,29 @@ }, { "inputs": [], - "name": "MaciPubKeyLargerThanSnarkFieldSize", + "name": "InvalidPubKey", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", "type": "error" }, { @@ -140,11 +157,6 @@ "internalType": "address", "name": "tally", "type": "address" - }, - { - "internalType": "address", - "name": "subsidy", - "type": "address" } ], "indexed": false, @@ -287,9 +299,9 @@ "type": "address" }, { - "internalType": "bool", - "name": "useSubsidy", - "type": "bool" + "internalType": "enum DomainObjs.Mode", + "name": "_mode", + "type": "uint8" } ], "name": "deployPoll", @@ -310,11 +322,6 @@ "internalType": "address", "name": "tally", "type": "address" - }, - { - "internalType": "address", - "name": "subsidy", - "type": "address" } ], "internalType": "struct MACI.PollContracts", @@ -845,19 +852,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "subsidyFactory", - "outputs": [ - { - "internalType": "contract ITallySubsidyFactory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "subtreesMerged", @@ -876,7 +870,7 @@ "name": "tallyFactory", "outputs": [ { - "internalType": "contract ITallySubsidyFactory", + "internalType": "contract ITallyFactory", "name": "", "type": "address" } diff --git a/subgraph/abis/Poll.json b/subgraph/abis/Poll.json index 671177ba2..e31d07163 100644 --- a/subgraph/abis/Poll.json +++ b/subgraph/abis/Poll.json @@ -105,7 +105,29 @@ }, { "inputs": [], - "name": "MaciPubKeyLargerThanSnarkFieldSize", + "name": "InvalidPubKey", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", "type": "error" }, { @@ -142,13 +164,13 @@ "anonymous": false, "inputs": [ { - "indexed": false, + "indexed": true, "internalType": "uint256", "name": "_stateRoot", "type": "uint256" }, { - "indexed": false, + "indexed": true, "internalType": "uint256", "name": "_numSignups", "type": "uint256" @@ -161,7 +183,7 @@ "anonymous": false, "inputs": [ { - "indexed": false, + "indexed": true, "internalType": "uint256", "name": "_numSrQueueOps", "type": "uint256" @@ -174,7 +196,7 @@ "anonymous": false, "inputs": [ { - "indexed": false, + "indexed": true, "internalType": "uint256", "name": "_messageRoot", "type": "uint256" @@ -187,7 +209,7 @@ "anonymous": false, "inputs": [ { - "indexed": false, + "indexed": true, "internalType": "uint256", "name": "_numSrQueueOps", "type": "uint256" diff --git a/subgraph/generated/ClrFund/MACI.ts b/subgraph/generated/ClrFund/MACI.ts index b1b8238e1..a770b955e 100644 --- a/subgraph/generated/ClrFund/MACI.ts +++ b/subgraph/generated/ClrFund/MACI.ts @@ -54,10 +54,6 @@ export class DeployPollPollAddrStruct extends ethereum.Tuple { get tally(): Address { return this[2].toAddress(); } - - get subsidy(): Address { - return this[3].toAddress(); - } } export class OwnershipTransferred extends ethereum.Event { @@ -128,10 +124,6 @@ export class MACI__deployPollResultPollAddrStruct extends ethereum.Tuple { get tally(): Address { return this[2].toAddress(); } - - get subsidy(): Address { - return this[3].toAddress(); - } } export class MACI__deployPollInput_treeDepthsStruct extends ethereum.Tuple { @@ -298,18 +290,18 @@ export class MACI extends ethereum.SmartContract { _coordinatorPubKey: MACI__deployPollInput_coordinatorPubKeyStruct, _verifier: Address, _vkRegistry: Address, - useSubsidy: boolean, + _mode: i32, ): MACI__deployPollResultPollAddrStruct { let result = super.call( "deployPoll", - "deployPoll(uint256,(uint8,uint8,uint8,uint8),(uint256,uint256),address,address,bool):((address,address,address,address))", + "deployPoll(uint256,(uint8,uint8,uint8,uint8),(uint256,uint256),address,address,uint8):((address,address,address))", [ ethereum.Value.fromUnsignedBigInt(_duration), ethereum.Value.fromTuple(_treeDepths), ethereum.Value.fromTuple(_coordinatorPubKey), ethereum.Value.fromAddress(_verifier), ethereum.Value.fromAddress(_vkRegistry), - ethereum.Value.fromBoolean(useSubsidy), + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(_mode)), ], ); @@ -324,18 +316,18 @@ export class MACI extends ethereum.SmartContract { _coordinatorPubKey: MACI__deployPollInput_coordinatorPubKeyStruct, _verifier: Address, _vkRegistry: Address, - useSubsidy: boolean, + _mode: i32, ): ethereum.CallResult { let result = super.tryCall( "deployPoll", - "deployPoll(uint256,(uint8,uint8,uint8,uint8),(uint256,uint256),address,address,bool):((address,address,address,address))", + "deployPoll(uint256,(uint8,uint8,uint8,uint8),(uint256,uint256),address,address,uint8):((address,address,address))", [ ethereum.Value.fromUnsignedBigInt(_duration), ethereum.Value.fromTuple(_treeDepths), ethereum.Value.fromTuple(_coordinatorPubKey), ethereum.Value.fromAddress(_verifier), ethereum.Value.fromAddress(_vkRegistry), - ethereum.Value.fromBoolean(useSubsidy), + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(_mode)), ], ); if (result.reverted) { @@ -831,25 +823,6 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toI32()); } - subsidyFactory(): Address { - let result = super.call("subsidyFactory", "subsidyFactory():(address)", []); - - return result[0].toAddress(); - } - - try_subsidyFactory(): ethereum.CallResult
{ - let result = super.tryCall( - "subsidyFactory", - "subsidyFactory():(address)", - [], - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - subtreesMerged(): boolean { let result = super.call("subtreesMerged", "subtreesMerged():(bool)", []); @@ -925,24 +898,20 @@ export class ConstructorCall__Inputs { return this._call.inputValues[2].value.toAddress(); } - get _subsidyFactory(): Address { - return this._call.inputValues[3].value.toAddress(); - } - get _signUpGatekeeper(): Address { - return this._call.inputValues[4].value.toAddress(); + return this._call.inputValues[3].value.toAddress(); } get _initialVoiceCreditProxy(): Address { - return this._call.inputValues[5].value.toAddress(); + return this._call.inputValues[4].value.toAddress(); } get _topupCredit(): Address { - return this._call.inputValues[6].value.toAddress(); + return this._call.inputValues[5].value.toAddress(); } get _stateTreeDepth(): i32 { - return this._call.inputValues[7].value.toI32(); + return this._call.inputValues[6].value.toI32(); } } @@ -995,8 +964,8 @@ export class DeployPollCall__Inputs { return this._call.inputValues[4].value.toAddress(); } - get useSubsidy(): boolean { - return this._call.inputValues[5].value.toBoolean(); + get _mode(): i32 { + return this._call.inputValues[5].value.toI32(); } } @@ -1054,10 +1023,6 @@ export class DeployPollCallPollAddrStruct extends ethereum.Tuple { get tally(): Address { return this[2].toAddress(); } - - get subsidy(): Address { - return this[3].toAddress(); - } } export class MergeStateAqCall extends ethereum.Call { diff --git a/subgraph/generated/templates/MACI/MACI.ts b/subgraph/generated/templates/MACI/MACI.ts index b1b8238e1..a770b955e 100644 --- a/subgraph/generated/templates/MACI/MACI.ts +++ b/subgraph/generated/templates/MACI/MACI.ts @@ -54,10 +54,6 @@ export class DeployPollPollAddrStruct extends ethereum.Tuple { get tally(): Address { return this[2].toAddress(); } - - get subsidy(): Address { - return this[3].toAddress(); - } } export class OwnershipTransferred extends ethereum.Event { @@ -128,10 +124,6 @@ export class MACI__deployPollResultPollAddrStruct extends ethereum.Tuple { get tally(): Address { return this[2].toAddress(); } - - get subsidy(): Address { - return this[3].toAddress(); - } } export class MACI__deployPollInput_treeDepthsStruct extends ethereum.Tuple { @@ -298,18 +290,18 @@ export class MACI extends ethereum.SmartContract { _coordinatorPubKey: MACI__deployPollInput_coordinatorPubKeyStruct, _verifier: Address, _vkRegistry: Address, - useSubsidy: boolean, + _mode: i32, ): MACI__deployPollResultPollAddrStruct { let result = super.call( "deployPoll", - "deployPoll(uint256,(uint8,uint8,uint8,uint8),(uint256,uint256),address,address,bool):((address,address,address,address))", + "deployPoll(uint256,(uint8,uint8,uint8,uint8),(uint256,uint256),address,address,uint8):((address,address,address))", [ ethereum.Value.fromUnsignedBigInt(_duration), ethereum.Value.fromTuple(_treeDepths), ethereum.Value.fromTuple(_coordinatorPubKey), ethereum.Value.fromAddress(_verifier), ethereum.Value.fromAddress(_vkRegistry), - ethereum.Value.fromBoolean(useSubsidy), + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(_mode)), ], ); @@ -324,18 +316,18 @@ export class MACI extends ethereum.SmartContract { _coordinatorPubKey: MACI__deployPollInput_coordinatorPubKeyStruct, _verifier: Address, _vkRegistry: Address, - useSubsidy: boolean, + _mode: i32, ): ethereum.CallResult { let result = super.tryCall( "deployPoll", - "deployPoll(uint256,(uint8,uint8,uint8,uint8),(uint256,uint256),address,address,bool):((address,address,address,address))", + "deployPoll(uint256,(uint8,uint8,uint8,uint8),(uint256,uint256),address,address,uint8):((address,address,address))", [ ethereum.Value.fromUnsignedBigInt(_duration), ethereum.Value.fromTuple(_treeDepths), ethereum.Value.fromTuple(_coordinatorPubKey), ethereum.Value.fromAddress(_verifier), ethereum.Value.fromAddress(_vkRegistry), - ethereum.Value.fromBoolean(useSubsidy), + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(_mode)), ], ); if (result.reverted) { @@ -831,25 +823,6 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toI32()); } - subsidyFactory(): Address { - let result = super.call("subsidyFactory", "subsidyFactory():(address)", []); - - return result[0].toAddress(); - } - - try_subsidyFactory(): ethereum.CallResult
{ - let result = super.tryCall( - "subsidyFactory", - "subsidyFactory():(address)", - [], - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - subtreesMerged(): boolean { let result = super.call("subtreesMerged", "subtreesMerged():(bool)", []); @@ -925,24 +898,20 @@ export class ConstructorCall__Inputs { return this._call.inputValues[2].value.toAddress(); } - get _subsidyFactory(): Address { - return this._call.inputValues[3].value.toAddress(); - } - get _signUpGatekeeper(): Address { - return this._call.inputValues[4].value.toAddress(); + return this._call.inputValues[3].value.toAddress(); } get _initialVoiceCreditProxy(): Address { - return this._call.inputValues[5].value.toAddress(); + return this._call.inputValues[4].value.toAddress(); } get _topupCredit(): Address { - return this._call.inputValues[6].value.toAddress(); + return this._call.inputValues[5].value.toAddress(); } get _stateTreeDepth(): i32 { - return this._call.inputValues[7].value.toI32(); + return this._call.inputValues[6].value.toI32(); } } @@ -995,8 +964,8 @@ export class DeployPollCall__Inputs { return this._call.inputValues[4].value.toAddress(); } - get useSubsidy(): boolean { - return this._call.inputValues[5].value.toBoolean(); + get _mode(): i32 { + return this._call.inputValues[5].value.toI32(); } } @@ -1054,10 +1023,6 @@ export class DeployPollCallPollAddrStruct extends ethereum.Tuple { get tally(): Address { return this[2].toAddress(); } - - get subsidy(): Address { - return this[3].toAddress(); - } } export class MergeStateAqCall extends ethereum.Call { diff --git a/yarn.lock b/yarn.lock index 970c4343b..025a4e9ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -631,10 +631,10 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.6.0.tgz#ec6cd237440700bc23ca23087f513c75508958b0" integrity sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA== -"@commander-js/extra-typings@^12.0.0": - version "12.0.0" - resolved "https://registry.yarnpkg.com/@commander-js/extra-typings/-/extra-typings-12.0.0.tgz#a3ef893e75dcf08bb1e51fc7e9fe8ed2d9246bf4" - integrity sha512-7zGCwtRKOJ978LCuEZbQ9ZmLdrRkNNASphEO5i9MZb6HfOk7KfsA3f4oXqYDhko4tNrU3GmZTlHqQ/nRlYtYSw== +"@commander-js/extra-typings@^12.0.1": + version "12.0.1" + resolved "https://registry.yarnpkg.com/@commander-js/extra-typings/-/extra-typings-12.0.1.tgz#4a74a9ccf1d19ef24e71df59359c6d90a605a469" + integrity sha512-OvkMobb1eMqOCuJdbuSin/KJkkZr7n24/UNV+Lcz/0Dhepf3r2p9PaGwpRpAWej7A+gQnny4h8mGhpFl4giKkg== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" @@ -1912,6 +1912,14 @@ fastfile "0.0.20" ffjavascript "^0.2.48" +"@iden3/binfileutils@0.0.12": + version "0.0.12" + resolved "https://registry.yarnpkg.com/@iden3/binfileutils/-/binfileutils-0.0.12.tgz#3772552f57551814ff606fa68ea1e0ef52795ce3" + integrity sha512-naAmzuDufRIcoNfQ1d99d7hGHufLA3wZSibtr4dMe6ZeiOPV1KwOZWTJ1YVz4HbaWlpDuzVU72dS4ATQS4PXBQ== + dependencies: + fastfile "0.0.20" + ffjavascript "^0.3.0" + "@import-maps/resolve@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@import-maps/resolve/-/resolve-1.0.1.tgz#1e9fcadcf23aa0822256a329aabca241879d37c9" @@ -2674,6 +2682,54 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@nomicfoundation/edr-darwin-arm64@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.3.7.tgz#c204edc79643624dbd431b489b254778817d8244" + integrity sha512-6tK9Lv/lSfyBvpEQ4nsTfgxyDT1y1Uv/x8Wa+aB+E8qGo3ToexQ1BMVjxJk6PChXCDOWxB3B4KhqaZFjdhl3Ow== + +"@nomicfoundation/edr-darwin-x64@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.3.7.tgz#c3b394445084270cc5250d6c1869b0574e7ef810" + integrity sha512-1RrQ/1JPwxrYO69e0tglFv5H+ggour5Ii3bb727+yBpBShrxtOTQ7fZyfxA5h62LCN+0Z9wYOPeQ7XFcVurMaQ== + +"@nomicfoundation/edr-linux-arm64-gnu@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.3.7.tgz#6d65545a44d1323bb7ab08c3306947165d2071de" + integrity sha512-ds/CKlBoVXIihjhflhgPn13EdKWed6r5bgvMs/YwRqT5wldQAQJZWAfA2+nYm0Yi2gMGh1RUpBcfkyl4pq7G+g== + +"@nomicfoundation/edr-linux-arm64-musl@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.3.7.tgz#5368534bceac1a8c18b1be6b908caca5d39b0c03" + integrity sha512-e29udiRaPujhLkM3+R6ju7QISrcyOqpcaxb2FsDWBkuD7H8uU9JPZEyyUIpEp5uIY0Jh1eEJPKZKIXQmQAEAuw== + +"@nomicfoundation/edr-linux-x64-gnu@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.3.7.tgz#42349bf5941dbb54a5719942924c6e4e8cde348e" + integrity sha512-/xkjmTyv+bbJ4akBCW0qzFKxPOV4AqLOmqurov+s9umHb16oOv72osSa3SdzJED2gHDaKmpMITT4crxbar4Axg== + +"@nomicfoundation/edr-linux-x64-musl@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.3.7.tgz#e6babe11c9a8012f1284e6e48c3551861f2a7cd4" + integrity sha512-QwBP9xlmsbf/ldZDGLcE4QiAb8Zt46E/+WLpxHBATFhGa7MrpJh6Zse+h2VlrT/SYLPbh2cpHgSmoSlqVxWG9g== + +"@nomicfoundation/edr-win32-x64-msvc@0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.3.7.tgz#1504b98f305f03be153b0220a546985660de9dc6" + integrity sha512-j/80DEnkxrF2ewdbk/gQ2EOPvgF0XSsg8D0o4+6cKhUVAW6XwtWKzIphNL6dyD2YaWEPgIrNvqiJK/aln0ww4Q== + +"@nomicfoundation/edr@^0.3.7": + version "0.3.7" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.3.7.tgz#9c75edf1fcf601617905b2c89acf103f4786d017" + integrity sha512-v2JFWnFKRsnOa6PDUrD+sr8amcdhxnG/YbL7LzmgRGU1odWEyOF4/EwNeUajQr4ZNKVWrYnJ6XjydXtUge5OBQ== + optionalDependencies: + "@nomicfoundation/edr-darwin-arm64" "0.3.7" + "@nomicfoundation/edr-darwin-x64" "0.3.7" + "@nomicfoundation/edr-linux-arm64-gnu" "0.3.7" + "@nomicfoundation/edr-linux-arm64-musl" "0.3.7" + "@nomicfoundation/edr-linux-x64-gnu" "0.3.7" + "@nomicfoundation/edr-linux-x64-musl" "0.3.7" + "@nomicfoundation/edr-win32-x64-msvc" "0.3.7" + "@nomicfoundation/ethereumjs-block@5.0.2": version "5.0.2" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz#13a7968f5964f1697da941281b7f7943b0465d04" @@ -2687,18 +2743,6 @@ ethereum-cryptography "0.1.3" ethers "^5.7.1" -"@nomicfoundation/ethereumjs-block@5.0.4": - version "5.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.4.tgz#ff2acb98a86b9290e35e315a6abfb9aebb9cf39e" - integrity sha512-AcyacJ9eX/uPEvqsPiB+WO1ymE+kyH48qGGiGV+YTojdtas8itUTW5dehDSOXEEItWGbbzEJ4PRqnQZlWaPvDw== - dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-trie" "6.0.4" - "@nomicfoundation/ethereumjs-tx" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - ethereum-cryptography "0.1.3" - "@nomicfoundation/ethereumjs-blockchain@7.0.2": version "7.0.2" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.2.tgz#45323b673b3d2fab6b5008535340d1b8fea7d446" @@ -2718,22 +2762,6 @@ lru-cache "^5.1.1" memory-level "^1.0.0" -"@nomicfoundation/ethereumjs-blockchain@7.0.4": - version "7.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.4.tgz#b77511b389290b186c8d999e70f4b15c27ef44ea" - integrity sha512-jYsd/kwzbmpnxx86tXsYV8wZ5xGvFL+7/P0c6OlzpClHsbFzeF41KrYA9scON8Rg6bZu3ZTv6JOAgj3t7USUfg== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.4" - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-ethash" "3.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-trie" "6.0.4" - "@nomicfoundation/ethereumjs-tx" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - lru-cache "^10.0.0" - "@nomicfoundation/ethereumjs-common@4.0.2": version "4.0.2" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.2.tgz#a15d1651ca36757588fdaf2a7d381a150662a3c3" @@ -2761,17 +2789,6 @@ bigint-crypto-utils "^3.0.23" ethereum-cryptography "0.1.3" -"@nomicfoundation/ethereumjs-ethash@3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.4.tgz#06cb2502b3012fb6c11cffd44af08aecf71310da" - integrity sha512-xvIrwIMl9sSaiYKRem68+O7vYdj7Q2XWv5P7JXiIkn83918QzWHvqbswTRsH7+r6X1UEvdsURRnZbvZszEjAaQ== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - bigint-crypto-utils "^3.2.2" - ethereum-cryptography "0.1.3" - "@nomicfoundation/ethereumjs-evm@2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.2.tgz#4c2f4b84c056047102a4fa41c127454e3f0cfcf6" @@ -2786,20 +2803,6 @@ mcl-wasm "^0.7.1" rustbn.js "~0.2.0" -"@nomicfoundation/ethereumjs-evm@2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.4.tgz#c9c761767283ac53946185474362230b169f8f63" - integrity sha512-lTyZZi1KpeMHzaO6cSVisR2tjiTTedjo7PcmhI/+GNFo9BmyY6QYzGeSti0sFttmjbEMioHgXxl5yrLNRg6+1w== - dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-statemanager" "2.0.4" - "@nomicfoundation/ethereumjs-tx" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - "@types/debug" "^4.1.9" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - rustbn-wasm "^0.2.0" - "@nomicfoundation/ethereumjs-rlp@5.0.2": version "5.0.2" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.2.tgz#4fee8dc58a53ac6ae87fb1fca7c15dc06c6b5dea" @@ -2822,20 +2825,6 @@ ethers "^5.7.1" js-sdsl "^4.1.4" -"@nomicfoundation/ethereumjs-statemanager@2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.4.tgz#bf14415e1f31b5ea8b98a0c027c547d0555059b6" - integrity sha512-HPDjeFrxw6llEi+BzqXkZ+KkvFnTOPczuHBtk21hRlDiuKuZz32dPzlhpRsDBGV1b5JTmRDUVqCS1lp3Gghw4Q== - dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-trie" "6.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - js-sdsl "^4.1.4" - lru-cache "^10.0.0" - "@nomicfoundation/ethereumjs-trie@6.0.2": version "6.0.2" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.2.tgz#9a6dbd28482dca1bc162d12b3733acab8cd12835" @@ -2847,18 +2836,6 @@ ethereum-cryptography "0.1.3" readable-stream "^3.6.0" -"@nomicfoundation/ethereumjs-trie@6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.4.tgz#688a3f76646c209365ee6d959c3d7330ede5e609" - integrity sha512-3nSwQiFMvr2VFe/aZUyinuohYvtytUqZCUCvIWcPJ/BwJH6oQdZRB42aNFBJ/8nAh2s3OcroWpBLskzW01mFKA== - dependencies: - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - "@types/readable-stream" "^2.3.13" - ethereum-cryptography "0.1.3" - lru-cache "^10.0.0" - readable-stream "^3.6.0" - "@nomicfoundation/ethereumjs-tx@5.0.2": version "5.0.2" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.2.tgz#117813b69c0fdc14dd0446698a64be6df71d7e56" @@ -2898,16 +2875,6 @@ "@nomicfoundation/ethereumjs-rlp" "5.0.4" ethereum-cryptography "0.1.3" -"@nomicfoundation/ethereumjs-verkle@0.0.2": - version "0.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-verkle/-/ethereumjs-verkle-0.0.2.tgz#7686689edec775b2efea5a71548f417c18f7dea4" - integrity sha512-bjnfZElpYGK/XuuVRmLS3yDvr+cDs85D9oonZ0YUa5A3lgFgokWMp76zXrxX2jVQ0BfHaw12y860n1+iOi6yFQ== - dependencies: - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - lru-cache "^10.0.0" - rust-verkle-wasm "^0.0.1" - "@nomicfoundation/ethereumjs-vm@7.0.2": version "7.0.2" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.2.tgz#3b0852cb3584df0e18c182d0672a3596c9ca95e6" @@ -2927,27 +2894,10 @@ mcl-wasm "^0.7.1" rustbn.js "~0.2.0" -"@nomicfoundation/ethereumjs-vm@7.0.4": - version "7.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.4.tgz#e5a6eec4877dc62dda93003c6d7afd1fe4b9625b" - integrity sha512-gsA4IhmtWHI4BofKy3kio9W+dqZQs5Ji5mLjLYxHCkat+JQBUt5szjRKra2F9nGDJ2XcI/wWb0YWUFNgln4zRQ== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.4" - "@nomicfoundation/ethereumjs-blockchain" "7.0.4" - "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-evm" "2.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-statemanager" "2.0.4" - "@nomicfoundation/ethereumjs-trie" "6.0.4" - "@nomicfoundation/ethereumjs-tx" "5.0.4" - "@nomicfoundation/ethereumjs-util" "9.0.4" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - -"@nomicfoundation/hardhat-chai-matchers@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.3.tgz#f4c074d39b74bd283c99e2c2bf143e3cef51ae18" - integrity sha512-A40s7EAK4Acr8UP1Yudgi9GGD9Cca/K3LHt3DzmRIje14lBfHtg9atGQ7qK56vdPcTwKmeaGn30FzxMUfPGEMw== +"@nomicfoundation/hardhat-chai-matchers@^2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.6.tgz#ef88be3bd666adf29c06ac7882e96c8dbaaa32ba" + integrity sha512-Te1Uyo9oJcTCF0Jy9dztaLpshmlpjLf2yPtWXlXuLjMt3RRSmJLm/+rKVTW6gfadAEs12U/it6D0ZRnnRGiICQ== dependencies: "@types/chai-as-promised" "^7.1.3" chai-as-promised "^7.1.1" @@ -2962,6 +2912,14 @@ debug "^4.1.1" lodash.isequal "^4.5.0" +"@nomicfoundation/hardhat-ethers@^3.0.6": + version "3.0.6" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.6.tgz#e8ba7f9719de360c03501b85dae4999bb3a7e1c5" + integrity sha512-/xzkFQAaHQhmIAYOQmvHBPwL+NkwLzT9gRZBsgWUYeV+E6pzXsBQsHfRYbAZ3XEYare+T7S+5Tg/1KDJgepSkA== + dependencies: + debug "^4.1.1" + lodash.isequal "^4.5.0" + "@nomicfoundation/hardhat-network-helpers@^1.0.10": version "1.0.10" resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.10.tgz#c61042ceb104fdd6c10017859fdef6529c1d6585" @@ -2974,6 +2932,11 @@ resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-4.0.0.tgz#eb1f619218dd1414fa161dfec92d3e5e53a2f407" integrity sha512-jhcWHp0aHaL0aDYj8IJl80v4SZXWMS1A2XxXa1CA6pBiFfJKuZinCkO6wb+POAt0LIfXB3gA3AgdcOccrcwBwA== +"@nomicfoundation/hardhat-toolbox@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-5.0.0.tgz#165b47f8a3d2bf668cc5d453ce7f496a1156948d" + integrity sha512-FnUtUC5PsakCbwiVNsqlXVIWG5JIb5CEZoSXbJUsEBun22Bivx2jhF1/q9iQbzuaGpJKFQyOhemPB2+XlEE6pQ== + "@nomicfoundation/hardhat-verify@^2.0.3": version "2.0.3" resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.3.tgz#173557f8cfa53c8c9da23a326f54d24fe459ae68" @@ -3272,15 +3235,10 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.6.0.tgz#de2c6823203d6f319511898bb5de7e70f5267e19" integrity sha512-OWlrQAnWn9577PhVgqjUvMr1pg57Bc4jv0iL4w0PRuOSRvq67rvHW9Ie/dZVMvCzhSCB+UxhcY/PmCmFj33Q+g== -"@openzeppelin/contracts@4.9.0": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.0.tgz#683f33b6598970051bc5f0806fd8660da9e018dd" - integrity sha512-DUP74AFGKlic2sQb/CmgrN2aUPMFGxRrmCTUxLHsiU2RzwWqVuMPZBxiAyvlff6Pea77uylAX6B5x9W6evEbhA== - -"@openzeppelin/contracts@^4.8.0": - version "4.9.5" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.5.tgz#1eed23d4844c861a1835b5d33507c1017fa98de8" - integrity sha512-ZK+W5mVhRppff9BE6YdR8CC52C8zAvsVAiWhEtQ5+oNxFE6h1WdeWo+FJSF8KKvtxxVYZ7MTP/5KoVpAU3aSWg== +"@openzeppelin/contracts@5.0.2", "@openzeppelin/contracts@^5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.0.2.tgz#b1d03075e49290d06570b2fd42154d76c2a5d210" + integrity sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA== "@openzeppelin/merkle-tree@^1.0.5": version "1.0.5" @@ -3544,7 +3502,7 @@ resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.6.1.tgz#9ab8f811930d7af3e3d549183a50884f9eb83f36" integrity sha512-UY+FGM/2jjMkzQLn8pxcHGMaVLh9aEitG3zY2CiY7XHdLiz3bZOwa6oDxNqEMv7zZkV+cj5DOdz0cQ1BP5Hjgw== -"@scure/base@^1.1.1", "@scure/base@~1.1.0": +"@scure/base@~1.1.0": version "1.1.5" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.5.tgz#1d85d17269fe97694b9c592552dd9e5e33552157" integrity sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ== @@ -3964,13 +3922,6 @@ dependencies: "@types/node" "*" -"@types/debug@^4.1.9": - version "4.1.12" - resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.12.tgz#a155f21690871953410df4b6b6f53187f0500917" - integrity sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ== - dependencies: - "@types/ms" "*" - "@types/estree@^1.0.0": version "1.0.5" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" @@ -4091,11 +4042,6 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.6.tgz#818551d39113081048bdddbef96701b4e8bb9d1b" integrity sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg== -"@types/ms@*": - version "0.7.34" - resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433" - integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g== - "@types/node@*", "@types/node@>=13.7.0": version "20.11.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.2.tgz#39cea3fe02fbbc2f80ed283e94e1d24f2d3856fb" @@ -4956,40 +4902,62 @@ resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== -"@zk-kit/baby-jubjub@0.1.1", "@zk-kit/baby-jubjub@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@zk-kit/baby-jubjub/-/baby-jubjub-0.1.1.tgz#8da922d1c0138ca8668c6ba1134ec04f51b24804" - integrity sha512-eWpUSpKKpllGZXE6mdS1IVuegRjY2Yu+3Qccyfg0+gMI8+p0ruioMM/MCK3tg2lRIUJTVd+16UghVcK0145yWg== +"@zk-kit/baby-jubjub@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@zk-kit/baby-jubjub/-/baby-jubjub-0.2.0.tgz#71c5396ddacb97e4e3db677933f74bde3332b236" + integrity sha512-pqiPq621oKpwiIkf1KcVh5MdbFX0V67s9gCmiEkhLMeafZaIXEwVt5qmIu1d2HB4mjXgr4Ys8Jpn2Rw4KXxnFQ== dependencies: - "@zk-kit/utils" "0.1.0" + "@zk-kit/utils" "0.3.0" -"@zk-kit/circuits@^0.3.0": +"@zk-kit/baby-jubjub@0.3.0", "@zk-kit/baby-jubjub@^0.3.0": version "0.3.0" - resolved "https://registry.yarnpkg.com/@zk-kit/circuits/-/circuits-0.3.0.tgz#716d932e9b09f33c71c7ff940a507e519ce0a6f4" - integrity sha512-v46KHC3sBRXUJbYi8d5PTAm3zCdBeArvWw3de+A2LcW/C9beYqBo8QJ/h6NWKZWOgpwqvCHzJa5HvyG6x3lIZQ== + resolved "https://registry.yarnpkg.com/@zk-kit/baby-jubjub/-/baby-jubjub-0.3.0.tgz#78b8d3226670dd02dc8ced713aec64d6bb2a6e62" + integrity sha512-mA3/M/+4C2vDtc0SpXf/q/nsvwBh+s42ou176sgDzqIBQD/u/N+LaLGorDh+X5AD3dVMHb8rheFpnnrJmjsqdA== + dependencies: + "@zk-kit/utils" "0.6.0" + +"@zk-kit/circuits@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@zk-kit/circuits/-/circuits-0.4.0.tgz#17a8333e8afe5a4e79260600a2dcefb2bc751a8f" + integrity sha512-Di7mokhwBS3qxVeCfHxGeNIpDg1kTnr1JXmsWiQMZLkRTn3Hugh6Tl07J394rWD0pIWRwPQsinaMVL2sB4F8yQ== dependencies: circomlib "^2.0.5" -"@zk-kit/eddsa-poseidon@^0.5.1": - version "0.5.1" - resolved "https://registry.yarnpkg.com/@zk-kit/eddsa-poseidon/-/eddsa-poseidon-0.5.1.tgz#7fef431f441f5385f82e6005cdf83d72d298e8c2" - integrity sha512-sPyoyjwg9EZ+tHLGxOG+FDj9XJK1knVjm27nTMV4ZSiQIf0427QWnLhOk7b6zMvFmEpBWTG9gneJ5pr3jzJ4zg== +"@zk-kit/eddsa-poseidon@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@zk-kit/eddsa-poseidon/-/eddsa-poseidon-0.11.0.tgz#f648b50a79ce660df75896d8fafa30c0f6eb9a43" + integrity sha512-8XgIVSD+nTnTEjvdrFVvju6lVQ5rxCfkBnf/nCFN/IteiIpYX7LnxrTOV7pIp3RrWL29WuTvNrT8TlBrHRrUFA== dependencies: - "@zk-kit/baby-jubjub" "0.1.1" - "@zk-kit/utils" "0.1.0" + "@zk-kit/baby-jubjub" "0.3.0" + "@zk-kit/utils" "0.8.1" + buffer "6.0.3" -"@zk-kit/poseidon-cipher@^0.2.1": - version "0.2.1" - resolved "https://registry.yarnpkg.com/@zk-kit/poseidon-cipher/-/poseidon-cipher-0.2.1.tgz#74cd80144b6755eff8e92643c4ef3f828f5822c5" - integrity sha512-/k7lUzYPuzFmdjBCvl8yTE4aDCnqxoVC46Txa9Z0i7rb+ilXHp2EEwfig/G7moTukSiOB3hywF3im/QGs3cYHg== +"@zk-kit/poseidon-cipher@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@zk-kit/poseidon-cipher/-/poseidon-cipher-0.3.0.tgz#e05a5d8a39a2d3a9aadb1b9997c2580713eacfff" + integrity sha512-Byszt7dxssgsR7hog2nf9AMaBKYr8LrgtlU/PPHPEe2OkJwIeQSshoxqquLlZsyfOn2c1ZmTJb4Mo4aHY11pCA== dependencies: - "@zk-kit/baby-jubjub" "0.1.1" - "@zk-kit/utils" "0.1.0" + "@zk-kit/baby-jubjub" "0.2.0" + "@zk-kit/utils" "0.3.0" -"@zk-kit/utils@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@zk-kit/utils/-/utils-0.1.0.tgz#6c134c22541efc6e634d4a89884c8bfe209b2da1" - integrity sha512-MZmuw2w2StB7XOSNg1TW4VwnBJ746UDmdXTvxwDO/U85UZfGfM3zb53gG35qz5sWpQo/DjfoKqaScmh6HUtQpA== +"@zk-kit/utils@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@zk-kit/utils/-/utils-0.3.0.tgz#ca85ab40540ee76b3a09b91df66a55d7f319a71d" + integrity sha512-yVBczOwOSV+evSgdsJ0tpPn3oQpbL7a7fRqANDogleaLLte1IFxKTFLz3WNcgd28Asq2guMGiU6SmiEc61uHAg== + +"@zk-kit/utils@0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@zk-kit/utils/-/utils-0.6.0.tgz#30124e98df8e29f7af31e19ce4dc6302f178c0a4" + integrity sha512-sUF1yVjlGmm7/NIN/+d+N8WOcI77bTzgV5+vZmp/S7lXcy4fmO+5TdHERRsDbs8Ep8K33EOC6V+U+JXzmjSe5A== + dependencies: + buffer "^6.0.3" + +"@zk-kit/utils@0.8.1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@zk-kit/utils/-/utils-0.8.1.tgz#9d358542e6b223dde35f32f3e161d1d3a41b0644" + integrity sha512-m5cvnYo5IBZQCO8H5X0Mw3rGRGEoSqlYXVVF1+4M9IT3olDWcJHLPRqtYGF9zNf+vXV/21srpZ0hX3X2Lzp1TQ== + dependencies: + buffer "^6.0.3" JSONStream@1.3.2: version "1.3.2" @@ -6464,7 +6432,7 @@ bfj@^7.0.2: jsonpath "^1.1.1" tryer "^1.0.1" -bigint-crypto-utils@^3.0.23, bigint-crypto-utils@^3.2.2: +bigint-crypto-utils@^3.0.23: version "3.3.0" resolved "https://registry.yarnpkg.com/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz#72ad00ae91062cf07f2b1def9594006c279c1d77" integrity sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg== @@ -6896,7 +6864,7 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -"buffer-polyfill@npm:buffer@^6.0.3", buffer@^6.0.1, buffer@^6.0.3: +"buffer-polyfill@npm:buffer@^6.0.3", buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.3: name buffer-polyfill version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" @@ -7180,7 +7148,7 @@ chai-as-promised@^7.1.1: dependencies: check-error "^1.0.2" -chai@^4.2.0, chai@^4.3.6, chai@^4.3.7: +chai@4, chai@^4.2.0, chai@^4.3.6, chai@^4.3.7: version "4.4.1" resolved "https://registry.yarnpkg.com/chai/-/chai-4.4.1.tgz#3603fa6eba35425b0f2ac91a009fe924106e50d1" integrity sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g== @@ -7407,6 +7375,13 @@ circom_runtime@0.1.24: dependencies: ffjavascript "0.2.60" +circom_runtime@0.1.25: + version "0.1.25" + resolved "https://registry.yarnpkg.com/circom_runtime/-/circom_runtime-0.1.25.tgz#62a33b371f4633f30238db7a326c43d988e3a170" + integrity sha512-xBGsBFF5Uv6AKvbpgExYqpHfmfawH2HKe+LyjfKSRevqEV8u63i9KGHVIILsbJNW+0c5bm/66f0PUYQ7qZSkJA== + dependencies: + ffjavascript "0.3.0" + circom_tester@^0.0.19: version "0.0.19" resolved "https://registry.yarnpkg.com/circom_tester/-/circom_tester-0.0.19.tgz#e8bed494d080f8186bd0ac6571755d00ccec83bd" @@ -7421,10 +7396,10 @@ circom_tester@^0.0.19: tmp-promise "^3.0.3" util "^0.12.4" -circomkit@^0.0.24: - version "0.0.24" - resolved "https://registry.yarnpkg.com/circomkit/-/circomkit-0.0.24.tgz#11db0ba17da9f5bd3e58bc87d5b39bb8375e3bf8" - integrity sha512-lw5Kj6zAWS8NYZjlDCGEDeA1e0/Vpa6t6W3GT0AxfhswUoqK0Nu3sz5hu8ZQ+Efh0Ss3eLoD0y+9sOkySEwgEA== +circomkit@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/circomkit/-/circomkit-0.1.0.tgz#f44cf86d46b3a3dff5a4958b6450f494d6fa9970" + integrity sha512-Mnc9IuOoaN7FitfURvbg2Q5j62S7/zQl6l18u5dcIhZg3Ot9MZYLiGIotCaF1Gfp/vAUKnvO2lnS3Xc1TdTISA== dependencies: chai "^4.3.7" circom_tester "^0.0.19" @@ -10182,6 +10157,19 @@ ethers@^6.11.1: tslib "2.4.0" ws "8.5.0" +ethers@^6.12.0, ethers@^6.12.1: + version "6.12.1" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.12.1.tgz#517ff6d66d4fd5433e38e903051da3e57c87ff37" + integrity sha512-j6wcVoZf06nqEcBbDWkKg8Fp895SS96dSnTCjiXT+8vt2o02raTn4Lo9ERUuIVU5bAjoPYeA+7ytQFexFmLuVw== + dependencies: + "@adraffy/ens-normalize" "1.10.1" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@types/node" "18.15.13" + aes-js "4.0.0-beta.5" + tslib "2.4.0" + ws "8.5.0" + ethers@^6.9.2: version "6.10.0" resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.10.0.tgz#20f3c63c60d59a993f8090ad423d8a3854b3b1cd" @@ -10708,6 +10696,15 @@ ffjavascript@0.2.63, ffjavascript@^0.2.45, ffjavascript@^0.2.48, ffjavascript@^0 wasmcurves "0.2.2" web-worker "1.2.0" +ffjavascript@0.3.0, ffjavascript@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/ffjavascript/-/ffjavascript-0.3.0.tgz#442cd8fbb1ee4cbb1be9d26fd7b2951a1ea45d6a" + integrity sha512-l7sR5kmU3gRwDy8g0Z2tYBXy5ttmafRPFOqY7S6af5cq51JqJWt5eQ/lSR/rs2wQNbDYaYlQr5O+OSUf/oMLoQ== + dependencies: + wasmbuilder "0.0.16" + wasmcurves "0.2.2" + web-worker "1.2.0" + figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" @@ -11960,24 +11957,17 @@ hardhat@^2.19.4: uuid "^8.3.2" ws "^7.4.6" -hardhat@^2.20.1: - version "2.20.1" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.20.1.tgz#3ad8f2b003a96c9ce80a55fec3575580ff2ddcd4" - integrity sha512-q75xDQiQtCZcTMBwjTovrXEU5ECr49baxr4/OBkIu/ULTPzlB20yk1dRWNmD2IFbAeAeXggaWvQAdpiScaHtPw== +hardhat@^2.22.3: + version "2.22.4" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.4.tgz#766227b6cefca5dbf4fd15ab5b5a68138fa13baf" + integrity sha512-09qcXJFBHQUaraJkYNr7XlmwjOj27xBB0SL2rYS024hTj9tPMbp26AFjlf5quBMO9SR4AJFg+4qWahcYcvXBuQ== dependencies: "@ethersproject/abi" "^5.1.2" "@metamask/eth-sig-util" "^4.0.0" - "@nomicfoundation/ethereumjs-block" "5.0.4" - "@nomicfoundation/ethereumjs-blockchain" "7.0.4" + "@nomicfoundation/edr" "^0.3.7" "@nomicfoundation/ethereumjs-common" "4.0.4" - "@nomicfoundation/ethereumjs-evm" "2.0.4" - "@nomicfoundation/ethereumjs-rlp" "5.0.4" - "@nomicfoundation/ethereumjs-statemanager" "2.0.4" - "@nomicfoundation/ethereumjs-trie" "6.0.4" "@nomicfoundation/ethereumjs-tx" "5.0.4" "@nomicfoundation/ethereumjs-util" "9.0.4" - "@nomicfoundation/ethereumjs-verkle" "0.0.2" - "@nomicfoundation/ethereumjs-vm" "7.0.4" "@nomicfoundation/solidity-analyzer" "^0.1.0" "@sentry/node" "^5.18.1" "@types/bn.js" "^5.1.0" @@ -13328,6 +13318,11 @@ is-potential-custom-element-name@^1.0.1: resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== +is-promise@^2.1.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" + integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== + is-promise@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-4.0.0.tgz#42ff9f84206c1991d26debf520dd5c01042dd2f3" @@ -14714,16 +14709,16 @@ lodash.upperfirst@^4.3.1: resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" integrity sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg== +lodash@4, lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@~4.17.0: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + lodash@4.17.20: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== -lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@~4.17.0: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - log-process-errors@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/log-process-errors/-/log-process-errors-8.0.0.tgz#f88a9556e4914037ad97ceee24b148dc1b566dfd" @@ -14837,6 +14832,17 @@ loupe@^2.3.6: dependencies: get-func-name "^2.0.1" +lowdb@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lowdb/-/lowdb-1.0.0.tgz#5243be6b22786ccce30e50c9a33eac36b20c8064" + integrity sha512-2+x8esE/Wb9SQ1F9IHaYWfsC9FIecLOPrK4g17FGEayjUWH172H6nwicRovGvSE2CPZouc2MCIqCI7h9d+GftQ== + dependencies: + graceful-fs "^4.1.3" + is-promise "^2.1.0" + lodash "4" + pify "^3.0.0" + steno "^0.4.1" + lower-case-first@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/lower-case-first/-/lower-case-first-2.0.2.tgz#64c2324a2250bf7c37c5901e76a5b5309301160b" @@ -14873,11 +14879,6 @@ lru-cache@5.1.1, lru-cache@^5.1.1: dependencies: yallist "^3.0.2" -lru-cache@^10.0.0: - version "10.2.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3" - integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q== - lru-cache@^10.0.2, "lru-cache@^9.1.1 || ^10.0.0": version "10.1.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.1.0.tgz#2098d41c2dc56500e6c88584aa656c84de7d0484" @@ -14917,78 +14918,78 @@ luxon@^3.1.1, luxon@^3.2.1: resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.4.4.tgz#cf20dc27dc532ba41a169c43fdcc0063601577af" integrity sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA== -maci-circuits@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/maci-circuits/-/maci-circuits-1.2.0.tgz#9b1f9c64d48e4dc3c3c7c8ffc4d0f254d60cce3e" - integrity sha512-51VMv7prUfRuko+PWDJOhwl9dLP82lAW2WHA39x+SFn1tkGAF3K3gw5TcIu7P6DQcwDblmbufn4OlrMc6jQXZg== +maci-circuits@1.2.1, maci-circuits@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/maci-circuits/-/maci-circuits-1.2.1.tgz#8012ac317736c7324af492eaf6e25e34b8e44519" + integrity sha512-Rch7UFOlrt9ENT8E8QQuAH7vNRVaMFcsk6Eg3C/BRQqKwb+f2A+PSb8qFEGGrqj51DaVEVZWL5KDPDbFpW5DoQ== dependencies: - "@zk-kit/circuits" "^0.3.0" - circomkit "^0.0.24" + "@zk-kit/circuits" "^0.4.0" + circomkit "^0.1.0" circomlib "^2.0.5" - maci-core "^1.2.0" - maci-crypto "^1.2.0" - maci-domainobjs "^1.2.0" - snarkjs "^0.7.3" + maci-core "^1.2.1" + maci-crypto "^1.2.1" + maci-domainobjs "^1.2.1" + snarkjs "^0.7.4" -maci-cli@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/maci-cli/-/maci-cli-1.2.0.tgz#caf8756d7e8dbfef61af6c7ac14068dfbc7d5db4" - integrity sha512-l3HYHvcafD6Z9ctPOBsYfZ5H/hdiS4rh0X3vEeLlncnsfKRPIpAej+2RHzsTooBH3ZvAp2f6wh+m2C9fRiU/7A== +maci-cli@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/maci-cli/-/maci-cli-1.2.1.tgz#0a23092163c24d215ddb392b98834f1d526e8340" + integrity sha512-48XZzRKONc4NGVJB1dnqL0Jou+f0WdMkwn7uP5PUhXBTbUY9lySZuHzWFUtWJ9ooW8s1acYgjAhpbmkHZatL4Q== dependencies: - "@commander-js/extra-typings" "^12.0.0" - "@nomicfoundation/hardhat-toolbox" "^4.0.0" + "@commander-js/extra-typings" "^12.0.1" + "@nomicfoundation/hardhat-toolbox" "^5.0.0" commander "^12.0.0" dotenv "^16.4.5" - ethers "^6.11.1" - hardhat "^2.20.1" - maci-circuits "^1.2.0" - maci-contracts "^1.2.0" - maci-core "^1.2.0" - maci-crypto "^1.2.0" - maci-domainobjs "^1.2.0" + ethers "^6.12.0" + hardhat "^2.22.3" + maci-circuits "^1.2.1" + maci-contracts "^1.2.1" + maci-core "^1.2.1" + maci-crypto "^1.2.1" + maci-domainobjs "^1.2.1" prompt "^1.3.0" -maci-contracts@1.2.0, maci-contracts@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/maci-contracts/-/maci-contracts-1.2.0.tgz#a724b3e757d2402442d822c34a5221660ef43b94" - integrity sha512-zLYmGzBIBTygw7FiukK9nLNFnDdEWDmizuHruXFjpawCIwH+kzBsGImRy77Rn58SOe9XORdlGZOQckEGvaT4QQ== +maci-contracts@1.2.1, maci-contracts@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/maci-contracts/-/maci-contracts-1.2.1.tgz#ac9f44dc895573d8fe026f19a21edb255fe822ea" + integrity sha512-/B5P82nZgKpSBvxZ3xUoF1mTPDZRMviCWG0ItF93TLnxPTJSMBqFrqJy3mXOHS7sK2/7M5E4NXC1TQ/oFVUATg== dependencies: "@nomicfoundation/hardhat-ethers" "^3.0.5" - "@nomicfoundation/hardhat-toolbox" "^4.0.0" - "@openzeppelin/contracts" "^4.8.0" + "@nomicfoundation/hardhat-toolbox" "^5.0.0" + "@openzeppelin/contracts" "^5.0.2" circomlibjs "^0.1.7" - ethers "^6.11.1" - hardhat "^2.20.1" - maci-circuits "^1.2.0" - maci-core "^1.2.0" - maci-crypto "^1.2.0" - maci-domainobjs "^1.2.0" + ethers "^6.12.0" + hardhat "^2.22.3" + maci-circuits "^1.2.1" + maci-core "^1.2.1" + maci-crypto "^1.2.1" + maci-domainobjs "^1.2.1" solidity-docgen "^0.6.0-beta.36" -maci-core@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/maci-core/-/maci-core-1.2.0.tgz#57ff4b92c457f42a3043fe5b34cfef98a9ac1cf5" - integrity sha512-odqIpafdQmSN0VlvaPESyPQybVcQzxxg9Zvh/DEUSiPMNHBJfHd0ke+CIUVdBN0z2pLaN9VlAFyMDf/CYEuivw== +maci-core@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/maci-core/-/maci-core-1.2.1.tgz#546f5a4ea0df0e1525df0ccfb3c54c4bb569c81f" + integrity sha512-8AXzvgcmQFdq5oQCvVZClK7FmTVLzPMDNgKAkc8waTtxLJIhP7Of3SMxfX5zu9Gay1ZGc9YMbC4NVdvdJTsC7g== dependencies: - maci-crypto "^1.2.0" - maci-domainobjs "^1.2.0" + maci-crypto "^1.2.1" + maci-domainobjs "^1.2.1" -maci-crypto@1.2.0, maci-crypto@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/maci-crypto/-/maci-crypto-1.2.0.tgz#b894810fa2ab379d93f77a2518f55abfe2f22dbe" - integrity sha512-OOQvI+uDR0Q8wji9cbBqfDcwQgjoIIiv5r1pnne4ST15taxgMygep13rsA6UCU/A007rYBa93YAR3vnnBTnmrw== +maci-crypto@1.2.1, maci-crypto@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/maci-crypto/-/maci-crypto-1.2.1.tgz#46999c233f43556960a50bec60c5437443dcd108" + integrity sha512-NERlCuBXYBsTSrE4GMozEgP9x8cL0Wk5ng9XZ/aBp4ib2HAJWyJC78gslRpwhjNNiRFw7TsYH0fcHqHjQ7YCKg== dependencies: - "@zk-kit/baby-jubjub" "^0.1.1" - "@zk-kit/eddsa-poseidon" "^0.5.1" - "@zk-kit/poseidon-cipher" "^0.2.1" - ethers "^6.11.1" + "@zk-kit/baby-jubjub" "^0.3.0" + "@zk-kit/eddsa-poseidon" "^0.11.0" + "@zk-kit/poseidon-cipher" "^0.3.0" + ethers "^6.12.0" -maci-domainobjs@1.2.0, maci-domainobjs@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/maci-domainobjs/-/maci-domainobjs-1.2.0.tgz#27a6a9e05b3712e54c48dd080dcfc0c1d6035f93" - integrity sha512-9ItdA/EVSVqDMOD+Foe+OkDdj/LEfpwSAtXLCxG900TeAZpI486qiAbiJoI5sR8gnoRfSvwnZGJqiB+w0BPgSQ== +maci-domainobjs@1.2.1, maci-domainobjs@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/maci-domainobjs/-/maci-domainobjs-1.2.1.tgz#7bb0ecc6131ed11aba1e73ad6112d7ad6ad807ac" + integrity sha512-oA/Qgigvr8UAvlBx+avNnN2QYd7tREW/SjMiNtHrhnn64cHCqrnuWGSylGYFec0CUaYHQ5RGho1tvHdce1xBLA== dependencies: - maci-crypto "^1.2.0" + maci-crypto "^1.2.1" macos-release@^3.1.0: version "3.2.0" @@ -17173,6 +17174,11 @@ pify@^2.3.0: resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== + pify@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" @@ -17827,6 +17833,16 @@ r1csfile@0.0.47: fastfile "0.0.20" ffjavascript "0.2.60" +r1csfile@0.0.48: + version "0.0.48" + resolved "https://registry.yarnpkg.com/r1csfile/-/r1csfile-0.0.48.tgz#a317fc75407a9da92631666c75bdfc13f0a7835a" + integrity sha512-kHRkKUJNaor31l05f2+RFzvcH5XSa7OfEfd/l4hzjte6NL6fjRkSMfZ4BjySW9wmfdwPOtq3mXurzPvPGEf5Tw== + dependencies: + "@iden3/bigarray" "0.0.2" + "@iden3/binfileutils" "0.0.12" + fastfile "0.0.20" + ffjavascript "0.3.0" + rabin-wasm@~0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/rabin-wasm/-/rabin-wasm-0.0.8.tgz#5b61b1d519d0377453435fbca5f82510b3f956cb" @@ -18491,18 +18507,6 @@ run-parallel@^1.1.4, run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rust-verkle-wasm@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/rust-verkle-wasm/-/rust-verkle-wasm-0.0.1.tgz#fd8396a7060d8ee8ea10da50ab6e862948095a74" - integrity sha512-BN6fiTsxcd2dCECz/cHtGTt9cdLJR925nh7iAuRcj8ymKw7OOaPmCneQZ7JePOJ/ia27TjEL91VdOi88Yf+mcA== - -rustbn-wasm@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/rustbn-wasm/-/rustbn-wasm-0.2.0.tgz#0407521fb55ae69eeb4968d01885d63efd1c4ff9" - integrity sha512-FThvYFNTqrEKGqXuseeg0zR7yROh/6U1617mCHF68OVqrN1tNKRN7Tdwy4WayPVsCmmK+eMxtIZX1qL6JxTkMg== - dependencies: - "@scure/base" "^1.1.1" - rustbn.js@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" @@ -19064,7 +19068,7 @@ snarkjs@0.5.0: logplease "^1.2.15" r1csfile "0.0.41" -snarkjs@^0.7.0, snarkjs@^0.7.3: +snarkjs@^0.7.0: version "0.7.3" resolved "https://registry.yarnpkg.com/snarkjs/-/snarkjs-0.7.3.tgz#7f703d05b810235255f2d0a70d8a9b8b3ea916e5" integrity sha512-cDLpWqdqEJSCQNc+cXYX1XTKdUZBtYEisuOsgmXf/HUsN5WmGN+FO7HfCS+cMQT1Nzbm1a9gAEpKH6KRtDtS1Q== @@ -19080,6 +19084,22 @@ snarkjs@^0.7.0, snarkjs@^0.7.3: logplease "^1.2.15" r1csfile "0.0.47" +snarkjs@^0.7.4: + version "0.7.4" + resolved "https://registry.yarnpkg.com/snarkjs/-/snarkjs-0.7.4.tgz#b9ad5813f055ab84d33f1831a6f1f34a71b6cd46" + integrity sha512-x4cOCR4YXSyBlLtfnUUwfbZrw8wFd/Y0lk83eexJzKwZB8ELdpH+10ts8YtDsm2/a3WK7c7p514bbE8NpqxW8w== + dependencies: + "@iden3/binfileutils" "0.0.12" + bfj "^7.0.2" + blake2b-wasm "^2.4.0" + circom_runtime "0.1.25" + ejs "^3.1.6" + fastfile "0.0.20" + ffjavascript "0.3.0" + js-sha3 "^0.8.0" + logplease "^1.2.15" + r1csfile "0.0.48" + solc@0.7.3: version "0.7.3" resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" @@ -19400,6 +19420,13 @@ stdin-discarder@^0.1.0: dependencies: bl "^5.0.0" +steno@^0.4.1: + version "0.4.4" + resolved "https://registry.yarnpkg.com/steno/-/steno-0.4.4.tgz#071105bdfc286e6615c0403c27e9d7b5dcb855cb" + integrity sha512-EEHMVYHNXFHfGtgjNITnka0aHhiAlo93F7z2/Pwd+g0teG9CnM3JIINM7hVVB5/rhw9voufD7Wukwgtw2uqh6w== + dependencies: + graceful-fs "^4.1.3" + stream-browserify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f" From bb48206d91b09bb2f0db4723c3c1169faaa26311 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Thu, 16 May 2024 07:35:21 -0400 Subject: [PATCH 12/21] use hardhat ^v2.22.3 to fix Invalid Chai property: revertedWith --- contracts/package.json | 2 +- contracts/tests/maciFactory.ts | 5 +- contracts/tests/recipientRegistry.ts | 12 +- contracts/tests/round.ts | 14 +- contracts/tests/userRegistry.ts | 14 +- contracts/tests/userRegistryMerkle.ts | 5 +- contracts/tests/userRegistrySemaphore.ts | 12 +- contracts/utils/testutils.ts | 5 +- yarn.lock | 351 +---------------------- 9 files changed, 53 insertions(+), 367 deletions(-) diff --git a/contracts/package.json b/contracts/package.json index 2f70d0f24..c4b870f22 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -36,7 +36,7 @@ "@types/mocha": "^10.0.6", "chai": "4", "ethers": "^6.12.1", - "hardhat": "^2.19.4", + "hardhat": "^2.22.3", "hardhat-contract-sizer": "^2.10.0", "hardhat-gas-reporter": "^1.0.8", "ipfs-only-hash": "^2.0.1", diff --git a/contracts/tests/maciFactory.ts b/contracts/tests/maciFactory.ts index 3f23d58ad..fcaf8d483 100644 --- a/contracts/tests/maciFactory.ts +++ b/contracts/tests/maciFactory.ts @@ -89,7 +89,10 @@ describe('MACI factory', () => { coordinatorMaciFactory.setMaciParameters( ...maciParameters.asContractParam() ) - ).to.be.revertedWith('Ownable: caller is not the owner') + ).to.be.revertedWithCustomError( + coordinatorMaciFactory, + 'OwnableUnauthorizedAccount' + ) }) it('deploys MACI', async () => { diff --git a/contracts/tests/recipientRegistry.ts b/contracts/tests/recipientRegistry.ts index ea5932993..1e0124376 100644 --- a/contracts/tests/recipientRegistry.ts +++ b/contracts/tests/recipientRegistry.ts @@ -154,7 +154,10 @@ describe('Simple Recipient Registry', async () => { const registryAsRecipient = registry.connect(recipient) as Contract await expect( registryAsRecipient.addRecipient(recipientAddress, metadata) - ).to.be.revertedWith('Ownable: caller is not the owner') + ).to.be.revertedWithCustomError( + registryAsRecipient, + 'OwnableUnauthorizedAccount' + ) }) it('should not accept zero-address as recipient address', async () => { @@ -218,7 +221,10 @@ describe('Simple Recipient Registry', async () => { const registryAsRecipient = registry.connect(recipient) as Contract await expect( registryAsRecipient.removeRecipient(recipientId) - ).to.be.revertedWith('Ownable: caller is not the owner') + ).to.be.revertedWithCustomError( + registryAsRecipient, + 'OwnableUnauthorizedAccount' + ) }) it('reverts if recipient is not in registry', async () => { @@ -762,7 +768,7 @@ describe('Optimistic recipient registry', () => { recipientId, requester.address ) - ).to.be.revertedWith('Ownable: caller is not the owner') + ).to.be.revertedWithCustomError(registry, 'OwnableUnauthorizedAccount') }) it('should not allow to challenge resolved request', async () => { diff --git a/contracts/tests/round.ts b/contracts/tests/round.ts index 4e480ff34..887e9224a 100644 --- a/contracts/tests/round.ts +++ b/contracts/tests/round.ts @@ -249,7 +249,7 @@ describe('Funding Round', () => { it('requires approval', async () => { await expect( fundingRoundAsContributor.contribute(userPubKey, contributionAmount) - ).to.be.revertedWith('ERC20: insufficient allowance') + ).to.be.revertedWithCustomError(token, 'ERC20InsufficientAllowance') }) it('rejects contributions from unverified users', async () => { @@ -750,7 +750,10 @@ describe('Funding Round', () => { newResultCommitment, perVOSpentVoiceCreditsHash ) - ).to.be.revertedWith('Ownable: caller is not the owner') + ).to.be.revertedWithCustomError( + fundingRoundAsCoordinator, + 'OwnableUnauthorizedAccount' + ) }) }) @@ -811,8 +814,11 @@ describe('Funding Round', () => { const fundingRoundAsCoordinator = fundingRound.connect( coordinator ) as Contract - await expect(fundingRoundAsCoordinator.cancel()).to.be.revertedWith( - 'Ownable: caller is not the owner' + await expect( + fundingRoundAsCoordinator.cancel() + ).to.be.revertedWithCustomError( + fundingRoundAsCoordinator, + 'OwnableUnauthorizedAccount' ) }) }) diff --git a/contracts/tests/userRegistry.ts b/contracts/tests/userRegistry.ts index 63d05e76f..7d0c9e7bc 100644 --- a/contracts/tests/userRegistry.ts +++ b/contracts/tests/userRegistry.ts @@ -44,8 +44,11 @@ describe('Simple User Registry', () => { it('allows only owner to add users', async () => { const registryAsUser = registry.connect(user) as Contract - await expect(registryAsUser.addUser(user.address)).to.be.revertedWith( - 'Ownable: caller is not the owner' + await expect( + registryAsUser.addUser(user.address) + ).to.be.revertedWithCustomError( + registryAsUser, + 'OwnableUnauthorizedAccount' ) }) @@ -66,8 +69,11 @@ describe('Simple User Registry', () => { it('allows only owner to remove users', async () => { await registry.addUser(user.address) const registryAsUser = registry.connect(user) as Contract - await expect(registryAsUser.removeUser(user.address)).to.be.revertedWith( - 'Ownable: caller is not the owner' + await expect( + registryAsUser.removeUser(user.address) + ).to.be.revertedWithCustomError( + registryAsUser, + 'OwnableUnauthorizedAccount' ) }) }) diff --git a/contracts/tests/userRegistryMerkle.ts b/contracts/tests/userRegistryMerkle.ts index 87c021a55..8761e33dc 100644 --- a/contracts/tests/userRegistryMerkle.ts +++ b/contracts/tests/userRegistryMerkle.ts @@ -39,7 +39,10 @@ describe('Merkle User Registry', () => { const registryAsUser = registry.connect(signers[user1.address]) as Contract await expect( registryAsUser.setMerkleRoot(randomBytes(32), 'non owner') - ).to.be.revertedWith('Ownable: caller is not the owner') + ).to.be.revertedWithCustomError( + registryAsUser, + 'OwnableUnauthorizedAccount' + ) }) describe('registration', () => { diff --git a/contracts/tests/userRegistrySemaphore.ts b/contracts/tests/userRegistrySemaphore.ts index 95a71c4ef..af500261f 100644 --- a/contracts/tests/userRegistrySemaphore.ts +++ b/contracts/tests/userRegistrySemaphore.ts @@ -66,7 +66,10 @@ describe('Semaphore User Registry', () => { const registryAsUser = registry.connect(user) as Contract await expect( registryAsUser.addUser(user.address, semaphoreId) - ).to.be.revertedWith('Ownable: caller is not the owner') + ).to.be.revertedWithCustomError( + registryAsUser, + 'OwnableUnauthorizedAccount' + ) }) it('allows owner to remove user', async () => { @@ -88,8 +91,11 @@ describe('Semaphore User Registry', () => { const semaphoreId = 1 await registry.addUser(user.address, semaphoreId) const registryAsUser = registry.connect(user) as Contract - await expect(registryAsUser.removeUser(user.address)).to.be.revertedWith( - 'Ownable: caller is not the owner' + await expect( + registryAsUser.removeUser(user.address) + ).to.be.revertedWithCustomError( + registryAsUser, + 'OwnableUnauthorizedAccount' ) }) diff --git a/contracts/utils/testutils.ts b/contracts/utils/testutils.ts index e5ace7da7..e423421fd 100644 --- a/contracts/utils/testutils.ts +++ b/contracts/utils/testutils.ts @@ -9,6 +9,7 @@ import { EContracts } from './types' import { Libraries } from 'hardhat/types' import { MACIFactory, VkRegistry } from '../typechain-types' import { ZERO_ADDRESS } from './constants' +import { EMode } from 'maci-contracts' /** * Deploy a mock contract with the given contract name @@ -236,7 +237,6 @@ export async function deployTestFundingRound( factories.pollFactory, factories.messageProcessorFactory, factories.tallyFactory, - factories.subsidyFactory, fundingRound.target, fundingRound.target, topupToken.target, @@ -254,8 +254,7 @@ export async function deployTestFundingRound( coordinatorPubKey.asContractParam(), mockVerifier.target, vkRegistry.target, - // pass false to not deploy the subsidy contract - false + EMode.QV ) const pollAddr = await getEventArg( deployPollTx, diff --git a/yarn.lock b/yarn.lock index 025a4e9ea..3b91a1800 100644 --- a/yarn.lock +++ b/yarn.lock @@ -578,42 +578,6 @@ resolved "https://registry.yarnpkg.com/@bugsnag/safe-json-stringify/-/safe-json-stringify-6.0.0.tgz#22abdcd83e008c369902976730c34c150148a758" integrity sha512-htzFO1Zc57S8kgdRK9mLcPVTW1BY2ijfH7Dk2CeZmspTWKdKqSo1iwmqrq2WtRjFlo8aRZYgLX0wFrDXF/9DLA== -"@chainsafe/as-sha256@^0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz#3639df0e1435cab03f4d9870cc3ac079e57a6fc9" - integrity sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg== - -"@chainsafe/persistent-merkle-tree@^0.4.2": - version "0.4.2" - resolved "https://registry.yarnpkg.com/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz#4c9ee80cc57cd3be7208d98c40014ad38f36f7ff" - integrity sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ== - dependencies: - "@chainsafe/as-sha256" "^0.3.1" - -"@chainsafe/persistent-merkle-tree@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz#2b4a62c9489a5739dedd197250d8d2f5427e9f63" - integrity sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw== - dependencies: - "@chainsafe/as-sha256" "^0.3.1" - -"@chainsafe/ssz@^0.10.0": - version "0.10.2" - resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.10.2.tgz#c782929e1bb25fec66ba72e75934b31fd087579e" - integrity sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg== - dependencies: - "@chainsafe/as-sha256" "^0.3.1" - "@chainsafe/persistent-merkle-tree" "^0.5.0" - -"@chainsafe/ssz@^0.9.2": - version "0.9.4" - resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.9.4.tgz#696a8db46d6975b600f8309ad3a12f7c0e310497" - integrity sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ== - dependencies: - "@chainsafe/as-sha256" "^0.3.1" - "@chainsafe/persistent-merkle-tree" "^0.4.2" - case "^1.6.3" - "@clrfund/waffle-mock-contract@^0.0.4": version "0.0.4" resolved "https://registry.yarnpkg.com/@clrfund/waffle-mock-contract/-/waffle-mock-contract-0.0.4.tgz#97bb6b20df60a77b8a501e45fb4f049bdaebbea0" @@ -1157,7 +1121,7 @@ dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.1", "@ethersproject/providers@^5.7.2": +"@ethersproject/providers@5.7.2": version "5.7.2" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== @@ -2730,46 +2694,6 @@ "@nomicfoundation/edr-linux-x64-musl" "0.3.7" "@nomicfoundation/edr-win32-x64-msvc" "0.3.7" -"@nomicfoundation/ethereumjs-block@5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz#13a7968f5964f1697da941281b7f7943b0465d04" - integrity sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q== - dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.2" - "@nomicfoundation/ethereumjs-rlp" "5.0.2" - "@nomicfoundation/ethereumjs-trie" "6.0.2" - "@nomicfoundation/ethereumjs-tx" "5.0.2" - "@nomicfoundation/ethereumjs-util" "9.0.2" - ethereum-cryptography "0.1.3" - ethers "^5.7.1" - -"@nomicfoundation/ethereumjs-blockchain@7.0.2": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.2.tgz#45323b673b3d2fab6b5008535340d1b8fea7d446" - integrity sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.2" - "@nomicfoundation/ethereumjs-common" "4.0.2" - "@nomicfoundation/ethereumjs-ethash" "3.0.2" - "@nomicfoundation/ethereumjs-rlp" "5.0.2" - "@nomicfoundation/ethereumjs-trie" "6.0.2" - "@nomicfoundation/ethereumjs-tx" "5.0.2" - "@nomicfoundation/ethereumjs-util" "9.0.2" - abstract-level "^1.0.3" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - level "^8.0.0" - lru-cache "^5.1.1" - memory-level "^1.0.0" - -"@nomicfoundation/ethereumjs-common@4.0.2": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.2.tgz#a15d1651ca36757588fdaf2a7d381a150662a3c3" - integrity sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg== - dependencies: - "@nomicfoundation/ethereumjs-util" "9.0.2" - crc-32 "^1.2.0" - "@nomicfoundation/ethereumjs-common@4.0.4": version "4.0.4" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.4.tgz#9901f513af2d4802da87c66d6f255b510bef5acb" @@ -2777,77 +2701,11 @@ dependencies: "@nomicfoundation/ethereumjs-util" "9.0.4" -"@nomicfoundation/ethereumjs-ethash@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.2.tgz#da77147f806401ee996bfddfa6487500118addca" - integrity sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.2" - "@nomicfoundation/ethereumjs-rlp" "5.0.2" - "@nomicfoundation/ethereumjs-util" "9.0.2" - abstract-level "^1.0.3" - bigint-crypto-utils "^3.0.23" - ethereum-cryptography "0.1.3" - -"@nomicfoundation/ethereumjs-evm@2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.2.tgz#4c2f4b84c056047102a4fa41c127454e3f0cfcf6" - integrity sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ== - dependencies: - "@ethersproject/providers" "^5.7.1" - "@nomicfoundation/ethereumjs-common" "4.0.2" - "@nomicfoundation/ethereumjs-tx" "5.0.2" - "@nomicfoundation/ethereumjs-util" "9.0.2" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - mcl-wasm "^0.7.1" - rustbn.js "~0.2.0" - -"@nomicfoundation/ethereumjs-rlp@5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.2.tgz#4fee8dc58a53ac6ae87fb1fca7c15dc06c6b5dea" - integrity sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA== - "@nomicfoundation/ethereumjs-rlp@5.0.4": version "5.0.4" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz#66c95256fc3c909f6fb18f6a586475fc9762fa30" integrity sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw== -"@nomicfoundation/ethereumjs-statemanager@2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.2.tgz#3ba4253b29b1211cafe4f9265fee5a0d780976e0" - integrity sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA== - dependencies: - "@nomicfoundation/ethereumjs-common" "4.0.2" - "@nomicfoundation/ethereumjs-rlp" "5.0.2" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - ethers "^5.7.1" - js-sdsl "^4.1.4" - -"@nomicfoundation/ethereumjs-trie@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.2.tgz#9a6dbd28482dca1bc162d12b3733acab8cd12835" - integrity sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ== - dependencies: - "@nomicfoundation/ethereumjs-rlp" "5.0.2" - "@nomicfoundation/ethereumjs-util" "9.0.2" - "@types/readable-stream" "^2.3.13" - ethereum-cryptography "0.1.3" - readable-stream "^3.6.0" - -"@nomicfoundation/ethereumjs-tx@5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.2.tgz#117813b69c0fdc14dd0446698a64be6df71d7e56" - integrity sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g== - dependencies: - "@chainsafe/ssz" "^0.9.2" - "@ethersproject/providers" "^5.7.2" - "@nomicfoundation/ethereumjs-common" "4.0.2" - "@nomicfoundation/ethereumjs-rlp" "5.0.2" - "@nomicfoundation/ethereumjs-util" "9.0.2" - ethereum-cryptography "0.1.3" - "@nomicfoundation/ethereumjs-tx@5.0.4": version "5.0.4" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz#b0ceb58c98cc34367d40a30d255d6315b2f456da" @@ -2858,15 +2716,6 @@ "@nomicfoundation/ethereumjs-util" "9.0.4" ethereum-cryptography "0.1.3" -"@nomicfoundation/ethereumjs-util@9.0.2": - version "9.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.2.tgz#16bdc1bb36f333b8a3559bbb4b17dac805ce904d" - integrity sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ== - dependencies: - "@chainsafe/ssz" "^0.10.0" - "@nomicfoundation/ethereumjs-rlp" "5.0.2" - ethereum-cryptography "0.1.3" - "@nomicfoundation/ethereumjs-util@9.0.4": version "9.0.4" resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.4.tgz#84c5274e82018b154244c877b76bc049a4ed7b38" @@ -2875,25 +2724,6 @@ "@nomicfoundation/ethereumjs-rlp" "5.0.4" ethereum-cryptography "0.1.3" -"@nomicfoundation/ethereumjs-vm@7.0.2": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.2.tgz#3b0852cb3584df0e18c182d0672a3596c9ca95e6" - integrity sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA== - dependencies: - "@nomicfoundation/ethereumjs-block" "5.0.2" - "@nomicfoundation/ethereumjs-blockchain" "7.0.2" - "@nomicfoundation/ethereumjs-common" "4.0.2" - "@nomicfoundation/ethereumjs-evm" "2.0.2" - "@nomicfoundation/ethereumjs-rlp" "5.0.2" - "@nomicfoundation/ethereumjs-statemanager" "2.0.2" - "@nomicfoundation/ethereumjs-trie" "6.0.2" - "@nomicfoundation/ethereumjs-tx" "5.0.2" - "@nomicfoundation/ethereumjs-util" "9.0.2" - debug "^4.3.3" - ethereum-cryptography "0.1.3" - mcl-wasm "^0.7.1" - rustbn.js "~0.2.0" - "@nomicfoundation/hardhat-chai-matchers@^2.0.6": version "2.0.6" resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.6.tgz#ef88be3bd666adf29c06ac7882e96c8dbaaa32ba" @@ -4103,14 +3933,6 @@ resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.11.tgz#208d8a30bc507bd82e03ada29e4732ea46a6bbda" integrity sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ== -"@types/readable-stream@^2.3.13": - version "2.3.15" - resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-2.3.15.tgz#3d79c9ceb1b6a57d5f6e6976f489b9b5384321ae" - integrity sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ== - dependencies: - "@types/node" "*" - safe-buffer "~5.1.1" - "@types/resolve@^0.0.8": version "0.0.8" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" @@ -4997,19 +4819,6 @@ abort-controller@^3.0.0: dependencies: event-target-shim "^5.0.0" -abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/abstract-level/-/abstract-level-1.0.3.tgz#78a67d3d84da55ee15201486ab44c09560070741" - integrity sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA== - dependencies: - buffer "^6.0.3" - catering "^2.1.0" - is-buffer "^2.0.5" - level-supports "^4.0.0" - level-transcoder "^1.0.1" - module-error "^1.0.1" - queue-microtask "^1.2.3" - abstract-leveldown@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-3.0.0.tgz#5cb89f958a44f526779d740d1440e743e0c30a57" @@ -6432,11 +6241,6 @@ bfj@^7.0.2: jsonpath "^1.1.1" tryer "^1.0.1" -bigint-crypto-utils@^3.0.23: - version "3.3.0" - resolved "https://registry.yarnpkg.com/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz#72ad00ae91062cf07f2b1def9594006c279c1d77" - integrity sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg== - bignumber.js@^9.0.0: version "9.1.2" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" @@ -6702,16 +6506,6 @@ brorand@^1.0.1, brorand@^1.1.0: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== -browser-level@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browser-level/-/browser-level-1.0.1.tgz#36e8c3183d0fe1c405239792faaab5f315871011" - integrity sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ== - dependencies: - abstract-level "^1.0.2" - catering "^2.1.1" - module-error "^1.0.2" - run-parallel-limit "^1.1.0" - browser-readablestream-to-it@^1.0.0, browser-readablestream-to-it@^1.0.1, browser-readablestream-to-it@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/browser-readablestream-to-it/-/browser-readablestream-to-it-1.0.3.tgz#ac3e406c7ee6cdf0a502dd55db33bab97f7fba76" @@ -7114,21 +6908,11 @@ cardinal@^2.1.1: ansicolors "~0.3.2" redeyed "~2.1.0" -case@^1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" - integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ== - caseless@^0.12.0, caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== -catering@^2.1.0, catering@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/catering/-/catering-2.1.1.tgz#66acba06ed5ee28d5286133982a927de9a04b510" - integrity sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w== - cbor@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/cbor/-/cbor-8.1.0.tgz#cfc56437e770b73417a2ecbfc9caf6b771af60d5" @@ -7443,17 +7227,6 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -classic-level@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/classic-level/-/classic-level-1.3.0.tgz#5e36680e01dc6b271775c093f2150844c5edd5c8" - integrity sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg== - dependencies: - abstract-level "^1.0.2" - catering "^2.1.0" - module-error "^1.0.1" - napi-macros "^2.2.2" - node-gyp-build "^4.3.0" - clean-deep@3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/clean-deep/-/clean-deep-3.4.0.tgz#c465c4de1003ae13a1a859e6c69366ab96069f75" @@ -8442,7 +8215,7 @@ debug@3.2.6: dependencies: ms "^2.1.1" -debug@4, debug@4.3.4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: +debug@4, debug@4.3.4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -10108,7 +9881,7 @@ ethereumjs-wallet@0.6.5: utf8 "^3.0.0" uuid "^3.3.2" -ethers@^5.0.3, ethers@^5.5.1, ethers@^5.7.1, ethers@^5.7.2: +ethers@^5.0.3, ethers@^5.5.1, ethers@^5.7.2: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== @@ -11903,60 +11676,6 @@ hardhat-gas-reporter@^1.0.8: eth-gas-reporter "^0.2.25" sha1 "^1.1.1" -hardhat@^2.19.4: - version "2.19.4" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.19.4.tgz#5112c30295d8be2e18e55d847373c50483ed1902" - integrity sha512-fTQJpqSt3Xo9Mn/WrdblNGAfcANM6XC3tAEi6YogB4s02DmTf93A8QsGb8uR0KR8TFcpcS8lgiW4ugAIYpnbrQ== - dependencies: - "@ethersproject/abi" "^5.1.2" - "@metamask/eth-sig-util" "^4.0.0" - "@nomicfoundation/ethereumjs-block" "5.0.2" - "@nomicfoundation/ethereumjs-blockchain" "7.0.2" - "@nomicfoundation/ethereumjs-common" "4.0.2" - "@nomicfoundation/ethereumjs-evm" "2.0.2" - "@nomicfoundation/ethereumjs-rlp" "5.0.2" - "@nomicfoundation/ethereumjs-statemanager" "2.0.2" - "@nomicfoundation/ethereumjs-trie" "6.0.2" - "@nomicfoundation/ethereumjs-tx" "5.0.2" - "@nomicfoundation/ethereumjs-util" "9.0.2" - "@nomicfoundation/ethereumjs-vm" "7.0.2" - "@nomicfoundation/solidity-analyzer" "^0.1.0" - "@sentry/node" "^5.18.1" - "@types/bn.js" "^5.1.0" - "@types/lru-cache" "^5.1.0" - adm-zip "^0.4.16" - aggregate-error "^3.0.0" - ansi-escapes "^4.3.0" - chalk "^2.4.2" - chokidar "^3.4.0" - ci-info "^2.0.0" - debug "^4.1.1" - enquirer "^2.3.0" - env-paths "^2.2.0" - ethereum-cryptography "^1.0.3" - ethereumjs-abi "^0.6.8" - find-up "^2.1.0" - fp-ts "1.19.3" - fs-extra "^7.0.1" - glob "7.2.0" - immutable "^4.0.0-rc.12" - io-ts "1.10.4" - keccak "^3.0.2" - lodash "^4.17.11" - mnemonist "^0.38.0" - mocha "^10.0.0" - p-map "^4.0.0" - raw-body "^2.4.1" - resolve "1.17.0" - semver "^6.3.0" - solc "0.7.3" - source-map-support "^0.5.13" - stacktrace-parser "^0.1.10" - tsort "0.0.1" - undici "^5.14.0" - uuid "^8.3.2" - ws "^7.4.6" - hardhat@^2.22.3: version "2.22.4" resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.4.tgz#766227b6cefca5dbf4fd15ab5b5a68138fa13baf" @@ -13019,11 +12738,6 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" - integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== - is-builtin-module@^3.1.0: version "3.2.1" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" @@ -13690,11 +13404,6 @@ jose@^4.11.4: resolved "https://registry.yarnpkg.com/jose/-/jose-4.15.4.tgz#02a9a763803e3872cf55f29ecef0dfdcc218cc03" integrity sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ== -js-sdsl@^4.1.4: - version "4.4.2" - resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.2.tgz#2e3c031b1f47d3aca8b775532e3ebb0818e7f847" - integrity sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w== - js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" @@ -14279,11 +13988,6 @@ level-sublevel@6.6.4: typewiselite "~1.0.0" xtend "~4.0.0" -level-supports@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-4.0.1.tgz#431546f9d81f10ff0fea0e74533a0e875c08c66a" - integrity sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA== - level-supports@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-1.0.1.tgz#2f530a596834c7301622521988e2c36bb77d122d" @@ -14291,14 +13995,6 @@ level-supports@~1.0.0: dependencies: xtend "^4.0.2" -level-transcoder@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/level-transcoder/-/level-transcoder-1.0.1.tgz#f8cef5990c4f1283d4c86d949e73631b0bc8ba9c" - integrity sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w== - dependencies: - buffer "^6.0.3" - module-error "^1.0.1" - level-ws@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-0.0.0.tgz#372e512177924a00424b0b43aef2bb42496d228b" @@ -14326,14 +14022,6 @@ level@^5.0.1: leveldown "^5.0.0" opencollective-postinstall "^2.0.0" -level@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/level/-/level-8.0.0.tgz#41b4c515dabe28212a3e881b61c161ffead14394" - integrity sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ== - dependencies: - browser-level "^1.0.1" - classic-level "^1.2.0" - leveldown@^5.0.0: version "5.6.0" resolved "https://registry.yarnpkg.com/leveldown/-/leveldown-5.6.0.tgz#16ba937bb2991c6094e13ac5a6898ee66d3eee98" @@ -15106,11 +14794,6 @@ maxstache@^1.0.0: resolved "https://registry.yarnpkg.com/maxstache/-/maxstache-1.0.7.tgz#2231d5180ba783d5ecfc31c45fedac7ae4276984" integrity sha512-53ZBxHrZM+W//5AcRVewiLpDunHnucfdzZUGz54Fnvo4tE+J3p8EL66kBrs2UhBXvYKTWckWYYWBqJqoTcenqg== -mcl-wasm@^0.7.1: - version "0.7.9" - resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.9.tgz#c1588ce90042a8700c3b60e40efb339fc07ab87f" - integrity sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ== - md5-hex@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-3.0.1.tgz#be3741b510591434b2784d79e556eefc2c9a8e5c" @@ -15176,15 +14859,6 @@ memoize-one@^6.0.0: resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-6.0.0.tgz#b2591b871ed82948aee4727dc6abceeeac8c1045" integrity sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw== -memory-level@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/memory-level/-/memory-level-1.0.0.tgz#7323c3fd368f9af2f71c3cd76ba403a17ac41692" - integrity sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og== - dependencies: - abstract-level "^1.0.0" - functional-red-black-tree "^1.0.1" - module-error "^1.0.1" - memorystream@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" @@ -15605,11 +15279,6 @@ module-definition@^5.0.1: ast-module-types "^5.0.0" node-source-walk "^6.0.1" -module-error@^1.0.1, module-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/module-error/-/module-error-1.0.2.tgz#8d1a48897ca883f47a45816d4fb3e3c6ba404d86" - integrity sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA== - moize@^6.1.0, moize@^6.1.3: version "6.1.6" resolved "https://registry.yarnpkg.com/moize/-/moize-6.1.6.tgz#ac2e723e74b951875fe2c0c3433405c2b098c3e6" @@ -15857,11 +15526,6 @@ napi-build-utils@^1.0.1: resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== -napi-macros@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.2.2.tgz#817fef20c3e0e40a963fbf7b37d1600bd0201044" - integrity sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g== - napi-macros@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.0.0.tgz#2b6bae421e7b96eb687aa6c77a7858640670001b" @@ -17783,7 +17447,7 @@ querystringify@^2.1.1: resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== -queue-microtask@^1.2.2, queue-microtask@^1.2.3: +queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== @@ -18493,13 +18157,6 @@ run-async@^2.2.0, run-async@^2.4.0: resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== -run-parallel-limit@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz#be80e936f5768623a38a963262d6bef8ff11e7ba" - integrity sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw== - dependencies: - queue-microtask "^1.2.2" - run-parallel@^1.1.4, run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" From 4194fea493104ff61b20cfe9301ef1dccf95d9ed Mon Sep 17 00:00:00 2001 From: yuetloo Date: Thu, 16 May 2024 09:27:48 -0400 Subject: [PATCH 13/21] use MACI v1.2.2 --- common/package.json | 4 +-- contracts/package.json | 8 ++--- yarn.lock | 81 +++++++++++++++++++++--------------------- 3 files changed, 47 insertions(+), 46 deletions(-) diff --git a/common/package.json b/common/package.json index 713437020..fe0e1c90e 100644 --- a/common/package.json +++ b/common/package.json @@ -23,8 +23,8 @@ "dependencies": { "@openzeppelin/merkle-tree": "^1.0.5", "ethers": "^6.11.1", - "maci-crypto": "1.2.1", - "maci-domainobjs": "1.2.1" + "maci-crypto": "1.2.2", + "maci-domainobjs": "1.2.2" }, "repository": { "type": "git", diff --git a/contracts/package.json b/contracts/package.json index c4b870f22..9706cfdbe 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -18,7 +18,7 @@ "@openzeppelin/contracts": "5.0.2", "@pinata/sdk": "^2.1.0", "dotenv": "^8.2.0", - "maci-contracts": "1.2.1", + "maci-contracts": "1.2.2", "solidity-rlp": "2.0.8" }, "devDependencies": { @@ -41,9 +41,9 @@ "hardhat-gas-reporter": "^1.0.8", "ipfs-only-hash": "^2.0.1", "lowdb": "1.0.0", - "maci-circuits": "1.2.1", - "maci-cli": "1.2.1", - "maci-domainobjs": "1.2.1", + "maci-circuits": "1.2.2", + "maci-cli": "1.2.2", + "maci-domainobjs": "1.2.2", "mocha": "^10.2.0", "solidity-coverage": "^0.8.1", "ts-node": "^10.9.2", diff --git a/yarn.lock b/yarn.lock index 3b91a1800..d013c2646 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14520,7 +14520,7 @@ loupe@^2.3.6: dependencies: get-func-name "^2.0.1" -lowdb@1.0.0: +lowdb@1.0.0, lowdb@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lowdb/-/lowdb-1.0.0.tgz#5243be6b22786ccce30e50c9a33eac36b20c8064" integrity sha512-2+x8esE/Wb9SQ1F9IHaYWfsC9FIecLOPrK4g17FGEayjUWH172H6nwicRovGvSE2CPZouc2MCIqCI7h9d+GftQ== @@ -14606,23 +14606,23 @@ luxon@^3.1.1, luxon@^3.2.1: resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.4.4.tgz#cf20dc27dc532ba41a169c43fdcc0063601577af" integrity sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA== -maci-circuits@1.2.1, maci-circuits@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/maci-circuits/-/maci-circuits-1.2.1.tgz#8012ac317736c7324af492eaf6e25e34b8e44519" - integrity sha512-Rch7UFOlrt9ENT8E8QQuAH7vNRVaMFcsk6Eg3C/BRQqKwb+f2A+PSb8qFEGGrqj51DaVEVZWL5KDPDbFpW5DoQ== +maci-circuits@1.2.2, maci-circuits@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/maci-circuits/-/maci-circuits-1.2.2.tgz#2c3823dce9a8d29675eaeb8f1d9e9b1eb8d7437a" + integrity sha512-CBKeLfT5uywgUC+l4W+ZpDf7Av3ZGNpVX//tjgiy0Bgaps5bOhAScmKpAZIfB3aTitpOtiao9E9veb9syTNhnw== dependencies: "@zk-kit/circuits" "^0.4.0" circomkit "^0.1.0" circomlib "^2.0.5" - maci-core "^1.2.1" - maci-crypto "^1.2.1" - maci-domainobjs "^1.2.1" + maci-core "^1.2.2" + maci-crypto "^1.2.2" + maci-domainobjs "^1.2.2" snarkjs "^0.7.4" -maci-cli@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/maci-cli/-/maci-cli-1.2.1.tgz#0a23092163c24d215ddb392b98834f1d526e8340" - integrity sha512-48XZzRKONc4NGVJB1dnqL0Jou+f0WdMkwn7uP5PUhXBTbUY9lySZuHzWFUtWJ9ooW8s1acYgjAhpbmkHZatL4Q== +maci-cli@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/maci-cli/-/maci-cli-1.2.2.tgz#187f4c204f1ab46919b13c042508a8216a10d3c9" + integrity sha512-l5L7FpUH5eH5NkNFPsqXrWvJkdgkdSSZmjy28FR3SBNIGzfbgfT32x0hBoNSDs2QIb+72KZ3rgGyorc/icTXlg== dependencies: "@commander-js/extra-typings" "^12.0.1" "@nomicfoundation/hardhat-toolbox" "^5.0.0" @@ -14630,17 +14630,17 @@ maci-cli@1.2.1: dotenv "^16.4.5" ethers "^6.12.0" hardhat "^2.22.3" - maci-circuits "^1.2.1" - maci-contracts "^1.2.1" - maci-core "^1.2.1" - maci-crypto "^1.2.1" - maci-domainobjs "^1.2.1" + maci-circuits "^1.2.2" + maci-contracts "^1.2.2" + maci-core "^1.2.2" + maci-crypto "^1.2.2" + maci-domainobjs "^1.2.2" prompt "^1.3.0" -maci-contracts@1.2.1, maci-contracts@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/maci-contracts/-/maci-contracts-1.2.1.tgz#ac9f44dc895573d8fe026f19a21edb255fe822ea" - integrity sha512-/B5P82nZgKpSBvxZ3xUoF1mTPDZRMviCWG0ItF93TLnxPTJSMBqFrqJy3mXOHS7sK2/7M5E4NXC1TQ/oFVUATg== +maci-contracts@1.2.2, maci-contracts@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/maci-contracts/-/maci-contracts-1.2.2.tgz#65892940f04cff2f7abeed0e32ca3a3275b96887" + integrity sha512-Iws+V2EOe6z8hobEwGnVTV90i6eyCHixFAYdAcVU34bCwksFgL03EssXLi5baS+a3Uig3VgjUE4QbidpBFi0Jw== dependencies: "@nomicfoundation/hardhat-ethers" "^3.0.5" "@nomicfoundation/hardhat-toolbox" "^5.0.0" @@ -14648,36 +14648,37 @@ maci-contracts@1.2.1, maci-contracts@^1.2.1: circomlibjs "^0.1.7" ethers "^6.12.0" hardhat "^2.22.3" - maci-circuits "^1.2.1" - maci-core "^1.2.1" - maci-crypto "^1.2.1" - maci-domainobjs "^1.2.1" + lowdb "^1.0.0" + maci-circuits "^1.2.2" + maci-core "^1.2.2" + maci-crypto "^1.2.2" + maci-domainobjs "^1.2.2" solidity-docgen "^0.6.0-beta.36" -maci-core@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/maci-core/-/maci-core-1.2.1.tgz#546f5a4ea0df0e1525df0ccfb3c54c4bb569c81f" - integrity sha512-8AXzvgcmQFdq5oQCvVZClK7FmTVLzPMDNgKAkc8waTtxLJIhP7Of3SMxfX5zu9Gay1ZGc9YMbC4NVdvdJTsC7g== +maci-core@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/maci-core/-/maci-core-1.2.2.tgz#a0a570838ff820a347c18738cac4fa9c75c15f55" + integrity sha512-a4OdSnlP7Rk9g4rn5D8oCjQIIYSMxd5DH1Entgj1JnJ7G4GuIEoC1RP2zw/Bh7wolDi1J9IYFmwFIzdS332ggA== dependencies: - maci-crypto "^1.2.1" - maci-domainobjs "^1.2.1" + maci-crypto "^1.2.2" + maci-domainobjs "^1.2.2" -maci-crypto@1.2.1, maci-crypto@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/maci-crypto/-/maci-crypto-1.2.1.tgz#46999c233f43556960a50bec60c5437443dcd108" - integrity sha512-NERlCuBXYBsTSrE4GMozEgP9x8cL0Wk5ng9XZ/aBp4ib2HAJWyJC78gslRpwhjNNiRFw7TsYH0fcHqHjQ7YCKg== +maci-crypto@1.2.2, maci-crypto@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/maci-crypto/-/maci-crypto-1.2.2.tgz#cd90a741ec9e8713e54c142c01c0648a1d414e7c" + integrity sha512-N752cmfC+guhCrV+2szXsf+1ChFBsVRVGiFLJAGw+rKIERlct4jJryzM4kTVIfL0qFSKBsw8NsQQfrRacLMlFQ== dependencies: "@zk-kit/baby-jubjub" "^0.3.0" "@zk-kit/eddsa-poseidon" "^0.11.0" "@zk-kit/poseidon-cipher" "^0.3.0" ethers "^6.12.0" -maci-domainobjs@1.2.1, maci-domainobjs@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/maci-domainobjs/-/maci-domainobjs-1.2.1.tgz#7bb0ecc6131ed11aba1e73ad6112d7ad6ad807ac" - integrity sha512-oA/Qgigvr8UAvlBx+avNnN2QYd7tREW/SjMiNtHrhnn64cHCqrnuWGSylGYFec0CUaYHQ5RGho1tvHdce1xBLA== +maci-domainobjs@1.2.2, maci-domainobjs@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/maci-domainobjs/-/maci-domainobjs-1.2.2.tgz#7b72d93ad88d7306342b3d9691247396f3bc870a" + integrity sha512-Wdtb/baKeITXGTAfA+6X573bcarCxD0KGXaSxoEuxZDbdamwhBqYdTRBcLNBFLK4eWC0RethzwW7lAQuGJfPdg== dependencies: - maci-crypto "^1.2.1" + maci-crypto "^1.2.2" macos-release@^3.1.0: version "3.2.0" From e3ff6058ea2bef815baf8ceb9de5a0e38dc628ff Mon Sep 17 00:00:00 2001 From: yuetloo Date: Thu, 16 May 2024 21:23:34 -0400 Subject: [PATCH 14/21] remove unused variable --- contracts/tasks/runners/verifyAll.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/tasks/runners/verifyAll.ts b/contracts/tasks/runners/verifyAll.ts index c010df8ff..74972fe0c 100644 --- a/contracts/tasks/runners/verifyAll.ts +++ b/contracts/tasks/runners/verifyAll.ts @@ -286,7 +286,7 @@ task('verify-all', 'Verify contracts listed in storage') .addOptionalParam('clrfund', 'The ClrFund contract address') .addFlag('force', 'Ignore verified status') .setAction(async ({ clrfund }, hre) => { - const { ethers, config, network } = hre + const { ethers, network } = hre const storage = ContractStorage.getInstance() const clrfundContractAddress = From 5d5d67e1b4d6f5a39ff6dc13572279b96a0a3993 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Thu, 16 May 2024 21:36:57 -0400 Subject: [PATCH 15/21] remove lowdb since it is added in maci-contracts now --- contracts/package.json | 1 - yarn.lock | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/contracts/package.json b/contracts/package.json index 9706cfdbe..a762f7d4a 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -40,7 +40,6 @@ "hardhat-contract-sizer": "^2.10.0", "hardhat-gas-reporter": "^1.0.8", "ipfs-only-hash": "^2.0.1", - "lowdb": "1.0.0", "maci-circuits": "1.2.2", "maci-cli": "1.2.2", "maci-domainobjs": "1.2.2", diff --git a/yarn.lock b/yarn.lock index d013c2646..108db9ee4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14520,7 +14520,7 @@ loupe@^2.3.6: dependencies: get-func-name "^2.0.1" -lowdb@1.0.0, lowdb@^1.0.0: +lowdb@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lowdb/-/lowdb-1.0.0.tgz#5243be6b22786ccce30e50c9a33eac36b20c8064" integrity sha512-2+x8esE/Wb9SQ1F9IHaYWfsC9FIecLOPrK4g17FGEayjUWH172H6nwicRovGvSE2CPZouc2MCIqCI7h9d+GftQ== From 3a5143684ef1eec9cb834527a3ae48338422e538 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Thu, 16 May 2024 21:37:43 -0400 Subject: [PATCH 16/21] use ethers 6.12.1 --- vue-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vue-app/package.json b/vue-app/package.json index 1c7267fbd..5d05ae141 100644 --- a/vue-app/package.json +++ b/vue-app/package.json @@ -34,7 +34,7 @@ "@walletconnect/modal": "^2.6.0", "crypto-js": "^4.1.1", "ethereum-blockies-base64": "^1.0.2", - "ethers": "^6.11.1", + "ethers": "^6.12.1", "floating-vue": "^2.0.0-beta.20", "google-spreadsheet": "^3.3.0", "graphql": "^16.6.0", From 916e5e2c3d9c72629c62b4bbc736ba8005ff305a Mon Sep 17 00:00:00 2001 From: yuetloo Date: Fri, 17 May 2024 16:14:20 -0400 Subject: [PATCH 17/21] update waffle-mock-contract to v0.0.11 --- contracts/package.json | 2 +- yarn.lock | 28 +++++----------------------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/contracts/package.json b/contracts/package.json index a762f7d4a..1bb19275e 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "@clrfund/common": "^0.0.1", - "@clrfund/waffle-mock-contract": "^0.0.4", + "@clrfund/waffle-mock-contract": "^0.0.11", "@kleros/gtcr-encoder": "^1.4.0", "@nomicfoundation/hardhat-chai-matchers": "^2.0.6", "@nomicfoundation/hardhat-ethers": "^3.0.6", diff --git a/yarn.lock b/yarn.lock index 108db9ee4..2e8eb68ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,11 +7,6 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@adraffy/ens-normalize@1.10.0": - version "1.10.0" - resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7" - integrity sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q== - "@adraffy/ens-normalize@1.10.1": version "1.10.1" resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz#63430d04bd8c5e74f8d7d049338f1cd9d4f02069" @@ -578,12 +573,12 @@ resolved "https://registry.yarnpkg.com/@bugsnag/safe-json-stringify/-/safe-json-stringify-6.0.0.tgz#22abdcd83e008c369902976730c34c150148a758" integrity sha512-htzFO1Zc57S8kgdRK9mLcPVTW1BY2ijfH7Dk2CeZmspTWKdKqSo1iwmqrq2WtRjFlo8aRZYgLX0wFrDXF/9DLA== -"@clrfund/waffle-mock-contract@^0.0.4": - version "0.0.4" - resolved "https://registry.yarnpkg.com/@clrfund/waffle-mock-contract/-/waffle-mock-contract-0.0.4.tgz#97bb6b20df60a77b8a501e45fb4f049bdaebbea0" - integrity sha512-YRAMIFIHVpvu99b7mvVY0+XsN1JWJ57St7xv5M2VzBTXB/ARPLZENAdfpyjr1xPdpyFVed6TCurdsR6K8SWWpQ== +"@clrfund/waffle-mock-contract@^0.0.11": + version "0.0.11" + resolved "https://registry.yarnpkg.com/@clrfund/waffle-mock-contract/-/waffle-mock-contract-0.0.11.tgz#4e5917ca19ce90ae9e3160b6a1d5858e7121e408" + integrity sha512-PkaTsujg4Ybbwuq7QjWlakO3io1B88GGVesfc3VlY5EWptA3LuNqfv51KpK7L1qoWpbyZP8vsBheL8GxHwfw6A== dependencies: - ethers "^6.9.2" + ethers "^6.12.1" "@colors/colors@1.5.0": version "1.5.0" @@ -9943,19 +9938,6 @@ ethers@^6.12.0, ethers@^6.12.1: tslib "2.4.0" ws "8.5.0" -ethers@^6.9.2: - version "6.10.0" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.10.0.tgz#20f3c63c60d59a993f8090ad423d8a3854b3b1cd" - integrity sha512-nMNwYHzs6V1FR3Y4cdfxSQmNgZsRj1RiTU25JwvnJLmyzw9z3SKxNc2XKDuiXXo/v9ds5Mp9m6HBabgYQQ26tA== - dependencies: - "@adraffy/ens-normalize" "1.10.0" - "@noble/curves" "1.2.0" - "@noble/hashes" "1.3.2" - "@types/node" "18.15.13" - aes-js "4.0.0-beta.5" - tslib "2.4.0" - ws "8.5.0" - ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" From 8f79a271817608f456379a91f2defb6e477ee936 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Sat, 18 May 2024 21:16:53 -0400 Subject: [PATCH 18/21] use ethers v6.12.1 --- common/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/package.json b/common/package.json index fe0e1c90e..9e3d72dc2 100644 --- a/common/package.json +++ b/common/package.json @@ -22,7 +22,7 @@ }, "dependencies": { "@openzeppelin/merkle-tree": "^1.0.5", - "ethers": "^6.11.1", + "ethers": "^6.12.1", "maci-crypto": "1.2.2", "maci-domainobjs": "1.2.2" }, From 98611cea39d51e5bcb745de7e8a00946c9abd32b Mon Sep 17 00:00:00 2001 From: yuetloo Date: Sat, 18 May 2024 21:17:56 -0400 Subject: [PATCH 19/21] update for MACI v1.2.2 interface change --- contracts/contracts/MACICommon.sol | 3 -- contracts/contracts/MACIFactory.sol | 1 - contracts/e2e/index.ts | 10 +---- .../tasks/helpers/ConstructorArguments.ts | 1 - contracts/tasks/runners/proveOnChain.ts | 1 - .../tasks/subtasks/clrfund/08-maciFactory.ts | 2 - contracts/utils/testutils.ts | 2 - subgraph/abis/MACIFactory.json | 42 ++++++++++--------- yarn.lock | 13 ------ 9 files changed, 24 insertions(+), 51 deletions(-) diff --git a/contracts/contracts/MACICommon.sol b/contracts/contracts/MACICommon.sol index 05762874e..f41843794 100644 --- a/contracts/contracts/MACICommon.sol +++ b/contracts/contracts/MACICommon.sol @@ -16,9 +16,6 @@ contract MACICommon { struct Factories { address pollFactory; address tallyFactory; - // subsidyFactory is not currently used, it's just a place holder here - address subsidyFactory; address messageProcessorFactory; } - } \ No newline at end of file diff --git a/contracts/contracts/MACIFactory.sol b/contracts/contracts/MACIFactory.sol index 2bccc4655..16a6f6e48 100644 --- a/contracts/contracts/MACIFactory.sol +++ b/contracts/contracts/MACIFactory.sol @@ -41,7 +41,6 @@ contract MACIFactory is Ownable(msg.sender), Params, SnarkCommon, DomainObjs, MA error InvalidVkRegistry(); error InvalidPollFactory(); error InvalidTallyFactory(); - error InvalidSubsidyFactory(); error InvalidMessageProcessorFactory(); error InvalidVerifier(); diff --git a/contracts/e2e/index.ts b/contracts/e2e/index.ts index f3ad49b7c..52d949abe 100644 --- a/contracts/e2e/index.ts +++ b/contracts/e2e/index.ts @@ -16,11 +16,7 @@ import { DEFAULT_GET_LOG_BATCH_SIZE, DEFAULT_SR_QUEUE_OPS, } from '../utils/constants' -import { - getContractAt, - getEventArg, - getQualifiedContractName, -} from '../utils/contracts' +import { getContractAt, getEventArg } from '../utils/contracts' import { deployPoseidonLibraries, deployMaciFactory } from '../utils/testutils' import { getIpfsHash } from '../utils/ipfs' import { @@ -37,7 +33,7 @@ import { DEFAULT_CIRCUIT } from '../utils/circuits' import { MaciParameters } from '../utils/maciParameters' import { existsSync, mkdirSync } from 'fs' import path from 'path' -import { FundingRound, Poll } from '../typechain-types' +import { FundingRound } from '../typechain-types' import { JSONFile } from '../utils/JSONFile' import { EContracts } from '../utils/types' import { getTalyFilePath } from '../utils/misc' @@ -398,7 +394,6 @@ describe('End-to-end Tests', function () { await proveOnChain({ pollId, proofDir: genProofArgs.outputDir, - subsidyEnabled: false, maciAddress, messageProcessorAddress, tallyAddress, @@ -418,7 +413,6 @@ describe('End-to-end Tests', function () { await proveOnChain({ pollId, proofDir: genProofArgs.outputDir, - subsidyEnabled: false, maciAddress, messageProcessorAddress, tallyAddress, diff --git a/contracts/tasks/helpers/ConstructorArguments.ts b/contracts/tasks/helpers/ConstructorArguments.ts index 751a8bbc4..3f77d336b 100644 --- a/contracts/tasks/helpers/ConstructorArguments.ts +++ b/contracts/tasks/helpers/ConstructorArguments.ts @@ -70,7 +70,6 @@ async function getMaciConstructorArguments( maci.pollFactory(), maci.messageProcessorFactory(), maci.tallyFactory(), - maci.subsidyFactory(), maci.signUpGatekeeper(), maci.initialVoiceCreditProxy(), maci.topupCredit(), diff --git a/contracts/tasks/runners/proveOnChain.ts b/contracts/tasks/runners/proveOnChain.ts index af777ed12..40946ba62 100644 --- a/contracts/tasks/runners/proveOnChain.ts +++ b/contracts/tasks/runners/proveOnChain.ts @@ -90,7 +90,6 @@ task('prove-on-chain', 'Prove on chain with the MACI proofs') await proveOnChain({ pollId, proofDir, - subsidyEnabled: false, maciAddress, messageProcessorAddress, tallyAddress, diff --git a/contracts/tasks/subtasks/clrfund/08-maciFactory.ts b/contracts/tasks/subtasks/clrfund/08-maciFactory.ts index cfaf146a6..c21c41817 100644 --- a/contracts/tasks/subtasks/clrfund/08-maciFactory.ts +++ b/contracts/tasks/subtasks/clrfund/08-maciFactory.ts @@ -48,8 +48,6 @@ subtask const factories = { pollFactory: pollFactoryContractAddress, tallyFactory: tallyFactoryContractAddress, - // subsidy is not currently used - subsidyFactory: ZERO_ADDRESS, messageProcessorFactory: messageProcessorFactoryContractAddress, } diff --git a/contracts/utils/testutils.ts b/contracts/utils/testutils.ts index e423421fd..8a306cf41 100644 --- a/contracts/utils/testutils.ts +++ b/contracts/utils/testutils.ts @@ -128,8 +128,6 @@ export async function deployMaciFactory({ const factories = { pollFactory: pollFactory.target, tallyFactory: tallyFactory.target, - // subsidy is not currently used - subsidyFactory: ZERO_ADDRESS, messageProcessorFactory: messageProcessorFactory.target, } diff --git a/subgraph/abis/MACIFactory.json b/subgraph/abis/MACIFactory.json index c8ab362b8..7f3ae7c07 100644 --- a/subgraph/abis/MACIFactory.json +++ b/subgraph/abis/MACIFactory.json @@ -18,11 +18,6 @@ "name": "tallyFactory", "type": "address" }, - { - "internalType": "address", - "name": "subsidyFactory", - "type": "address" - }, { "internalType": "address", "name": "messageProcessorFactory", @@ -52,11 +47,6 @@ "name": "InvalidPollFactory", "type": "error" }, - { - "inputs": [], - "name": "InvalidSubsidyFactory", - "type": "error" - }, { "inputs": [], "name": "InvalidTallyFactory", @@ -77,6 +67,28 @@ "name": "NotInitialized", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, { "inputs": [], "name": "ProcessVkNotSet", @@ -224,11 +236,6 @@ "internalType": "address", "name": "tally", "type": "address" - }, - { - "internalType": "address", - "name": "subsidy", - "type": "address" } ], "internalType": "struct MACI.PollContracts", @@ -253,11 +260,6 @@ "name": "tallyFactory", "type": "address" }, - { - "internalType": "address", - "name": "subsidyFactory", - "type": "address" - }, { "internalType": "address", "name": "messageProcessorFactory", diff --git a/yarn.lock b/yarn.lock index 2e8eb68ed..0f640e5d7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9912,19 +9912,6 @@ ethers@^5.0.3, ethers@^5.5.1, ethers@^5.7.2: "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" -ethers@^6.11.1: - version "6.11.1" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.11.1.tgz#96aae00b627c2e35f9b0a4d65c7ab658259ee6af" - integrity sha512-mxTAE6wqJQAbp5QAe/+o+rXOID7Nw91OZXvgpjDa1r4fAbq2Nu314oEZSbjoRLacuCzs7kUC3clEvkCQowffGg== - dependencies: - "@adraffy/ens-normalize" "1.10.1" - "@noble/curves" "1.2.0" - "@noble/hashes" "1.3.2" - "@types/node" "18.15.13" - aes-js "4.0.0-beta.5" - tslib "2.4.0" - ws "8.5.0" - ethers@^6.12.0, ethers@^6.12.1: version "6.12.1" resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.12.1.tgz#517ff6d66d4fd5433e38e903051da3e57c87ff37" From d7173562bede3f5f807d8ecc624a7ba688546614 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Sat, 18 May 2024 22:43:32 -0400 Subject: [PATCH 20/21] fix decode recipient metadata error --- vue-app/src/api/recipient-registry-simple.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vue-app/src/api/recipient-registry-simple.ts b/vue-app/src/api/recipient-registry-simple.ts index 852e85f4c..8b8f581db 100644 --- a/vue-app/src/api/recipient-registry-simple.ts +++ b/vue-app/src/api/recipient-registry-simple.ts @@ -6,6 +6,7 @@ import { provider, ipfsGatewayUrl } from './core' import type { Project } from './projects' import type { RegistryInfo, RecipientApplicationData } from './types' import { formToRecipientData } from './recipient' +import { getNumber } from 'ethers' function decodeRecipientAdded(event: EventLog): Project { const args = event.args as any @@ -28,7 +29,7 @@ function decodeRecipientAdded(event: EventLog): Project { discordUrl: metadata.discordUrl, bannerImageUrl: `${ipfsGatewayUrl}/ipfs/${metadata.bannerImageHash}`, thumbnailImageUrl: `${ipfsGatewayUrl}/ipfs/${metadata.thumbnailImageHash}`, - index: args._index.toNumber(), + index: getNumber(args._index), isHidden: false, isLocked: false, } From 43b161d8b8604e9944672cbba18e2b7b60e4cc7b Mon Sep 17 00:00:00 2001 From: yuetloo Date: Sun, 19 May 2024 20:55:58 -0400 Subject: [PATCH 21/21] remove an issue already fixed in MACI --- docs/tally-verify.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/tally-verify.md b/docs/tally-verify.md index 9ce6bc7dd..080d219c1 100644 --- a/docs/tally-verify.md +++ b/docs/tally-verify.md @@ -87,6 +87,4 @@ Also, lack of memory can also cause `core dump`, try to work around it by settin export NODE_OPTIONS=--max-old-space-size=4096 ``` -If you notice `Error at message index 0 - failed decryption due to either wrong encryption public key or corrupted ciphertext` while running the tally script, don't worry, it's just a warning. This issue is tracked [here](https://github.com/privacy-scaling-explorations/maci/issues/1134) - `Error at message index n - invalid nonce` is also a warning, not an error. This error occurs when users reallocated their contribution.