From d8cd50ca00108896cfe5746291a56509b91b05a8 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Thu, 16 May 2024 06:04:03 -0400 Subject: [PATCH] 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"