@maci-protocol/cli 0.0.0-ci.26f28d6 → 0.0.0-ci.284a4fe

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/ts/index.js CHANGED
@@ -45,6 +45,7 @@ const fs_1 = __importDefault(require("fs"));
45
45
  const path_1 = __importDefault(require("path"));
46
46
  require("./cliInit");
47
47
  const utils_1 = require("./utils");
48
+ const constants_1 = require("./utils/constants");
48
49
  const defaults_1 = require("./utils/defaults");
49
50
  // set the description version and name of the cli tool
50
51
  const { description, version, name } = JSON.parse(fs_1.default.readFileSync(path_1.default.resolve(__dirname, "..", "package.json"), "utf8"));
@@ -60,25 +61,33 @@ program
60
61
  .option("--poseidonT5Address <poseidonT5Address>", "PoseidonT5 contract address")
61
62
  .option("--poseidonT6Address <poseidonT6Address>", "PoseidonT6 contract address")
62
63
  .option("-g, --signupPolicyAddress <signupPolicyAddress>", "the signup policy contract address")
64
+ .option("--freeForAllCheckerFactoryAddress <freeForAllCheckerFactoryAddress>", "the free for all checker factory address (optional, using for deployment optimization)")
65
+ .option("--freeForAllPolicyFactoryAddress <freeForAllPolicyFactoryAddress>", "the free for all policy factory address (optional, using for deployment optimization)")
63
66
  .requiredOption("--signupPolicyContractName <signupPolicyContractName>", "the signup policy contract name")
64
67
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
65
68
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
66
69
  .requiredOption("-s, --stateTreeDepth <stateTreeDepth>", "the state tree depth", parseInt)
67
- .action(async (cmdOptions) => {
70
+ .action(async (args) => {
68
71
  try {
69
72
  const signer = await getSigner();
70
- (0, utils_1.banner)(cmdOptions.quiet);
73
+ (0, utils_1.banner)(args.quiet);
71
74
  const network = await signer.provider?.getNetwork();
72
75
  const [poseidonT3, poseidonT4, poseidonT5, poseidonT6] = (0, utils_1.readContractAddresses)({
73
76
  contractNames: [sdk_1.EContracts.PoseidonT3, sdk_1.EContracts.PoseidonT4, sdk_1.EContracts.PoseidonT5, sdk_1.EContracts.PoseidonT6],
74
77
  network: network?.name,
75
78
  });
76
79
  let [signupPolicyContractAddress] = (0, utils_1.readContractAddresses)({
77
- contractNames: [cmdOptions.signupPolicyContractName.toString()],
80
+ contractNames: [args.signupPolicyContractName.toString()],
78
81
  network: network?.name,
79
82
  });
80
83
  if (!signupPolicyContractAddress) {
81
- const [contract] = await (0, sdk_1.deployFreeForAllSignUpPolicy)(signer, true);
84
+ const checkerFactory = args.freeForAllCheckerFactoryAddress
85
+ ? sdk_1.FreeForAllCheckerFactory__factory.connect(args.freeForAllCheckerFactoryAddress, signer)
86
+ : undefined;
87
+ const policyFactory = args.freeForAllPolicyFactoryAddress
88
+ ? sdk_1.FreeForAllPolicyFactory__factory.connect(args.freeForAllPolicyFactoryAddress, signer)
89
+ : undefined;
90
+ const [contract] = await (0, sdk_1.deployFreeForAllSignUpPolicy)({ checker: checkerFactory, policy: policyFactory }, signer, true);
82
91
  signupPolicyContractAddress = await contract.getAddress();
83
92
  }
84
93
  // deploy a verifier contract
@@ -94,13 +103,13 @@ program
94
103
  poseidonT6,
95
104
  },
96
105
  signer,
97
- stateTreeDepth: cmdOptions.stateTreeDepth,
106
+ stateTreeDepth: args.stateTreeDepth,
98
107
  });
99
- const emptyBallotRoots = (0, sdk_1.genEmptyBallotRoots)(cmdOptions.stateTreeDepth);
108
+ const emptyBallotRoots = (0, sdk_1.generateEmptyBallotRoots)(args.stateTreeDepth);
100
109
  // save to the JSON File
101
110
  await (0, utils_1.storeContractAddresses)({
102
111
  data: {
103
- [cmdOptions.signupPolicyContractName]: { address: signupPolicyContractAddress, args: [] },
112
+ [args.signupPolicyContractName]: { address: signupPolicyContractAddress, args: [] },
104
113
  [sdk_1.EContracts.Verifier]: { address: verifierContractAddress, args: [] },
105
114
  [sdk_1.EContracts.MACI]: {
106
115
  address: maciContractAddress,
@@ -109,7 +118,7 @@ program
109
118
  messageProcessorFactoryContractAddress,
110
119
  tallyFactoryContractAddress,
111
120
  signupPolicyContractAddress,
112
- cmdOptions.stateTreeDepth,
121
+ args.stateTreeDepth,
113
122
  emptyBallotRoots.map((root) => root.toString()),
114
123
  ],
115
124
  },
@@ -123,7 +132,7 @@ program
123
132
  },
124
133
  signer,
125
134
  });
126
- (0, sdk_1.logGreen)({ quiet: cmdOptions.quiet, text: (0, sdk_1.success)(`MACI deployed at: ${maciContractAddress}`) });
135
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.success)(`MACI deployed at: ${maciContractAddress}`) });
127
136
  }
128
137
  catch (error) {
129
138
  program.error(error.message, { exitCode: 1 });
@@ -132,75 +141,81 @@ program
132
141
  program
133
142
  .command("checkVerifyingKeys")
134
143
  .description("check that the verifying keys in the contract match the local ones")
135
- .option("-u, --use-quadratic-voting <useQuadraticVoting>", "whether to use quadratic voting", (value) => value === "true", true)
144
+ .option("-m, --mode <mode>", "Voting mode (qv, non-qv, full)", (value) => constants_1.MODE_NAME_TO_ENUM[value], sdk_1.EMode.QV)
136
145
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
137
146
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
138
- .option("-k, --vk-contract <vkContract>", "the VkRegistry contract address")
147
+ .option("-k, --vk-contract <vkContract>", "the VerifyingKeysRegistry contract address")
139
148
  .requiredOption("-s, --state-tree-depth <stateTreeDepth>", "the state tree depth", parseInt)
140
- .requiredOption("-i, --int-state-tree-depth <intStateTreeDepth>", "the intermediate state tree depth", parseInt)
149
+ .requiredOption("-i, --tally-processing-state-tree-depth <tallyProcessingStateTreeDepth>", "the intermediate state tree depth", parseInt)
141
150
  .requiredOption("-v, --vote-option-tree-depth <voteOptionTreeDepth>", "the vote option tree depth", parseInt)
142
- .requiredOption("-b, --msg-batch-size <messageBatchSize>", "the message batch size", parseInt)
143
- .requiredOption("-p, --process-messages-zkey <processMessagesZkeyPath>", "the process messages zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
144
- .requiredOption("-t, --tally-votes-zkey <tallyVotesZkeyPath>", "the tally votes zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
151
+ .requiredOption("-b, --message-batch-size <messageBatchSize>", "the message batch size", parseInt)
152
+ .requiredOption("-p, --message-processor-zkey <messageProcessorZkeyPath>", "the message processor zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
153
+ .requiredOption("-t, --vote-tally-zkey <voteTallyZkeyPath>", "the vote tally zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
145
154
  .requiredOption("--poll-joining-zkey <pollJoiningZkey>", "the poll joining zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
146
155
  .requiredOption("--poll-joined-zkey <pollJoinedZkey>", "the poll joined zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
147
- .action(async (cmdOptions) => {
156
+ .action(async (args) => {
148
157
  try {
149
158
  const signer = await getSigner();
150
159
  const network = await signer.provider?.getNetwork();
151
- const [vkContractAddress] = (0, utils_1.readContractAddresses)({
152
- contractNames: [sdk_1.EContracts.VkRegistry],
160
+ const [contractAddress] = (0, utils_1.readContractAddresses)({
161
+ contractNames: [sdk_1.EContracts.VerifyingKeysRegistry],
153
162
  network: network?.name,
154
- defaultAddresses: [cmdOptions.vkContract],
163
+ defaultAddresses: [args.vkContract],
155
164
  });
156
- (0, sdk_1.logYellow)({ quiet: cmdOptions.quiet, text: (0, sdk_1.info)("Retrieving verifying keys from the contract...") });
165
+ (0, sdk_1.logYellow)({ quiet: args.quiet, text: (0, sdk_1.info)("Retrieving verifying keys from the contract...") });
157
166
  await (0, sdk_1.checkVerifyingKeys)({
158
- stateTreeDepth: cmdOptions.stateTreeDepth,
159
- intStateTreeDepth: cmdOptions.intStateTreeDepth,
160
- voteOptionTreeDepth: cmdOptions.voteOptionTreeDepth,
161
- messageBatchSize: cmdOptions.msgBatchSize,
162
- processMessagesZkeyPath: cmdOptions.processMessagesZkey,
163
- tallyVotesZkeyPath: cmdOptions.tallyVotesZkey,
164
- pollJoiningZkeyPath: cmdOptions.pollJoiningZkey,
165
- pollJoinedZkeyPath: cmdOptions.pollJoinedZkey,
166
- vkRegistry: vkContractAddress,
167
- useQuadraticVoting: cmdOptions.useQuadraticVoting,
167
+ stateTreeDepth: args.stateTreeDepth,
168
+ tallyProcessingStateTreeDepth: args.tallyProcessingStateTreeDepth,
169
+ voteOptionTreeDepth: args.voteOptionTreeDepth,
170
+ messageBatchSize: args.messageBatchSize,
171
+ messageProcessorZkeyPath: args.messageProcessorZkey,
172
+ voteTallyZkeyPath: args.voteTallyZkey,
173
+ pollJoiningZkeyPath: args.pollJoiningZkey,
174
+ pollJoinedZkeyPath: args.pollJoinedZkey,
175
+ verifyingKeysRegistry: contractAddress,
176
+ mode: args.mode,
168
177
  signer,
169
178
  });
170
- (0, sdk_1.logGreen)({ quiet: cmdOptions.quiet, text: (0, sdk_1.success)("Verifying keys match") });
179
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.success)("Verifying keys match") });
171
180
  }
172
181
  catch (error) {
173
182
  program.error(error.message, { exitCode: 1 });
174
183
  }
175
184
  });
176
185
  program
177
- .command("genMaciPubKey")
186
+ .command("generateMaciPubKey")
178
187
  .description("generate a new MACI public key")
179
- .requiredOption("-k, --privkey <privkey>", "the private key")
188
+ .requiredOption("-k, --private-key <privateKey>", "the private key")
180
189
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
181
190
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
182
- .action((cmdObj) => {
183
- const publicKey = (0, sdk_1.generateMaciPublicKey)(cmdObj.privkey);
184
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.success)(`Public key: ${publicKey}`) });
191
+ .action((args) => {
192
+ const publicKey = (0, sdk_1.generateMaciPublicKey)(args.privateKey);
193
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.success)(`Public key: ${publicKey}`) });
185
194
  });
186
195
  program
187
- .command("genMaciKeyPair")
196
+ .command("generateMaciKeyPair")
188
197
  .description("generate a new MACI key pair")
189
198
  .option("-s, --seed <seed>", "seed value for keypair", (value) => (value ? BigInt(value) : undefined), undefined)
190
199
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
191
- .action((cmdObj) => {
192
- const { publicKey, privateKey } = (0, sdk_1.generateKeypair)({ seed: cmdObj.seed });
193
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.success)(`Public key: ${publicKey}`) });
194
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.success)(`Private key: ${privateKey}`) });
200
+ .action((args) => {
201
+ const { publicKey, privateKey, publicKeyAsContractParam } = (0, sdk_1.generateKeypair)({ seed: args.seed });
202
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.success)(`Public key: ${publicKey}`) });
203
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.success)(`Private key: ${privateKey}`) });
204
+ (0, sdk_1.logGreen)({
205
+ quiet: args.quiet,
206
+ text: (0, sdk_1.success)(`Public key as contract param:
207
+ X: ${publicKeyAsContractParam.x}
208
+ Y: ${publicKeyAsContractParam.y}`),
209
+ });
195
210
  });
196
211
  program
197
- .command("deployVkRegistry")
212
+ .command("deployVerifyingKeysRegistry")
198
213
  .description("deploy a new verification key registry contract")
199
214
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
200
215
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
201
- .action(async (cmdObj) => {
216
+ .action(async (args) => {
202
217
  try {
203
- (0, utils_1.banner)(cmdObj.quiet);
218
+ (0, utils_1.banner)(args.quiet);
204
219
  const signer = await getSigner();
205
220
  // assume that the vkRegistry contract is the first one to be deployed
206
221
  const isContractAddressesStoreExists = fs_1.default.existsSync(utils_1.contractAddressesStorePath);
@@ -209,12 +224,15 @@ program
209
224
  (0, utils_1.resetContractAddresses)(network?.name);
210
225
  }
211
226
  // deploy and store the address
212
- const vkRegistryAddress = await (0, sdk_1.deployVkRegistryContract)({ signer });
227
+ const verifyingKeysRegistryAddress = await (0, sdk_1.deployVerifyingKeysRegistryContract)({ signer });
213
228
  await (0, utils_1.storeContractAddresses)({
214
- data: { [sdk_1.EContracts.VkRegistry]: { address: vkRegistryAddress, args: [] } },
229
+ data: { [sdk_1.EContracts.VerifyingKeysRegistry]: { address: verifyingKeysRegistryAddress, args: [] } },
215
230
  signer,
216
231
  });
217
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.success)(`VkRegistry deployed at: ${vkRegistryAddress}`) });
232
+ (0, sdk_1.logGreen)({
233
+ quiet: args.quiet,
234
+ text: (0, sdk_1.success)(`VerifyingKeysRegistry deployed at: ${verifyingKeysRegistryAddress}`),
235
+ });
218
236
  }
219
237
  catch (error) {
220
238
  program.error(error.message, { exitCode: 1 });
@@ -241,36 +259,38 @@ program
241
259
  program
242
260
  .command("deployPoll")
243
261
  .description("deploy a new poll")
244
- .option("-k, --vkRegistryAddress <vkRegistryAddress>", "the vk registry contract address")
245
- .requiredOption("-s, --start <pollStartDate>", "the poll start date", parseInt)
246
- .requiredOption("-e, --end <pollEndDate>", "the poll end date", parseInt)
247
- .requiredOption("-i, --int-state-tree-depth <intStateTreeDepth>", "the int state tree depth", parseInt)
248
- .requiredOption("-b, --msg-batch-size <messageBatchSize>", "the message batch size", parseInt)
262
+ .option("-k, --verifyingKeysRegistryAddress <verifyingKeysRegistryAddress>", "the vk registry contract address")
263
+ .requiredOption("--start <pollStartDate>", "the poll start date", parseInt)
264
+ .requiredOption("--end <pollEndDate>", "the poll end date", parseInt)
265
+ .requiredOption("-i, --tally-processing-state-tree-depth <tallyProcessingStateTreeDepth>", "the int state tree depth", parseInt)
266
+ .requiredOption("-b, --message-batch-size <messageBatchSize>", "the message batch size", parseInt)
267
+ .requiredOption("-s, --state-tree-depth <stateTreeDepth>", "the state tree depth", parseInt)
249
268
  .requiredOption("-v, --vote-option-tree-depth <voteOptionTreeDepth>", "the vote option tree depth", parseInt)
250
- .requiredOption("-p, --pubkey <coordinatorPubkey>", "the coordinator public key")
251
- .option("-u, --use-quadratic-voting <useQuadraticVoting>", "whether to use quadratic voting", (value) => value === "true", true)
269
+ .requiredOption("-p, --public-key <publicKey>", "the coordinator public key")
270
+ .option("-m, --mode <mode>", "Voting mode (qv, non-qv, full)", (value) => constants_1.MODE_NAME_TO_ENUM[value], sdk_1.EMode.QV)
252
271
  .option("-x, --maci-address <maciAddress>", "the MACI contract address")
253
- .option("-m, --relayers <relayers>", "the relayer addresses", (value) => value.split(",").map((item) => item.trim()))
272
+ .option("--relayers <relayers>", "the relayer addresses", (value) => value.split(",").map((item) => item.trim()))
254
273
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
255
274
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
256
275
  .option("-o, --vote-options <voteOptions>", "the number of vote options", parseInt)
257
276
  .option("--initial-voice-credits <initialVoiceCredits>", "the initial voice credits", parseInt)
258
277
  .option("--initial-voice-credits-proxy <initialVoiceCreditsProxy>", "the initial voice credits proxy address")
259
278
  .option("--signup-policy <signupPolicy>", "the signup policy contract address")
260
- .action(async (cmdObj) => {
279
+ .action(async (args) => {
261
280
  try {
262
- (0, utils_1.banner)(cmdObj.quiet);
281
+ (0, utils_1.banner)(args.quiet);
263
282
  const signer = await getSigner();
264
283
  const network = await signer.provider?.getNetwork();
265
- const [vkRegistryAddress, maciAddress, initialVoiceCreditProxyAddress, verifierContractAddress] = (0, utils_1.readContractAddresses)({
284
+ const [verifyingKeysRegistryAddress, maciAddress, initialVoiceCreditProxyAddress, initialVoiceCreditProxyFactoryAddress, verifierContractAddress,] = (0, utils_1.readContractAddresses)({
266
285
  contractNames: [
267
- sdk_1.EContracts.VkRegistry,
286
+ sdk_1.EContracts.VerifyingKeysRegistry,
268
287
  sdk_1.EContracts.MACI,
269
288
  sdk_1.EContracts.ConstantInitialVoiceCreditProxy,
289
+ sdk_1.EContracts.ConstantInitialVoiceCreditProxyFactory,
270
290
  sdk_1.EContracts.Verifier,
271
291
  ],
272
292
  network: network?.name,
273
- defaultAddresses: [cmdObj.vkRegistryAddress, cmdObj.maciAddress, cmdObj.initialVoiceCreditsProxy],
293
+ defaultAddresses: [args.verifyingKeysRegistryAddress, args.maciAddress, args.initialVoiceCreditsProxy],
274
294
  });
275
295
  const maciContract = sdk_1.MACI__factory.connect(maciAddress, signer);
276
296
  const nextPollId = await maciContract.nextPollId();
@@ -280,39 +300,41 @@ program
280
300
  contractNames: [policyContractName.toString()],
281
301
  keys: [nextPollId.toString()],
282
302
  network: network?.name,
283
- defaultAddresses: [cmdObj.signupPolicy],
303
+ defaultAddresses: [args.signupPolicy],
284
304
  });
285
305
  const { pollId, pollContractAddress, tallyContractAddress, messageProcessorContractAddress, initialVoiceCreditProxyContractAddress, policyContractAddress, } = await (0, sdk_1.deployPoll)({
286
- initialVoiceCredits: cmdObj.initialVoiceCredits || defaults_1.DEFAULT_INITIAL_VOICE_CREDITS,
287
- pollStartTimestamp: cmdObj.start,
288
- pollEndTimestamp: cmdObj.end,
289
- intStateTreeDepth: cmdObj.intStateTreeDepth,
290
- messageBatchSize: cmdObj.msgBatchSize,
291
- voteOptionTreeDepth: cmdObj.voteOptionTreeDepth,
292
- coordinatorPubKey: domainobjs_1.PubKey.deserialize(cmdObj.pubkey),
306
+ initialVoiceCredits: args.initialVoiceCredits || defaults_1.DEFAULT_INITIAL_VOICE_CREDITS,
307
+ pollStartTimestamp: args.start,
308
+ pollEndTimestamp: args.end,
309
+ tallyProcessingStateTreeDepth: args.tallyProcessingStateTreeDepth,
310
+ messageBatchSize: args.messageBatchSize,
311
+ stateTreeDepth: args.stateTreeDepth,
312
+ voteOptionTreeDepth: args.voteOptionTreeDepth,
313
+ coordinatorPublicKey: domainobjs_1.PublicKey.deserialize(args.publicKey),
293
314
  maciAddress,
294
- vkRegistryContractAddress: vkRegistryAddress,
295
- relayers: cmdObj.relayers ?? [ethers_1.ZeroAddress],
296
- mode: cmdObj.useQuadraticVoting ? sdk_1.EMode.QV : sdk_1.EMode.NON_QV,
315
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
316
+ relayers: args.relayers ?? [ethers_1.ZeroAddress],
317
+ mode: args.mode,
297
318
  signer,
298
- voteOptions: cmdObj.voteOptions ?? defaults_1.DEFAULT_VOTE_OPTIONS,
319
+ voteOptions: args.voteOptions ?? defaults_1.DEFAULT_VOTE_OPTIONS,
299
320
  verifierContractAddress,
300
321
  policyContractAddress: signupPolicyContractAddress,
322
+ initialVoiceCreditProxyFactoryAddress,
301
323
  initialVoiceCreditProxyContractAddress: initialVoiceCreditProxyAddress,
302
324
  });
303
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.success)(`Poll ID: ${pollId}`) });
304
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.success)(`Poll contract address: ${pollContractAddress}`) });
305
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.success)(`Tally contract address: ${tallyContractAddress}`) });
325
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.success)(`Poll ID: ${pollId}`) });
326
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.success)(`Poll contract address: ${pollContractAddress}`) });
327
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.success)(`Tally contract address: ${tallyContractAddress}`) });
306
328
  (0, sdk_1.logGreen)({
307
- quiet: cmdObj.quiet,
329
+ quiet: args.quiet,
308
330
  text: (0, sdk_1.success)(`Message processor contract address: ${messageProcessorContractAddress}`),
309
331
  });
310
332
  (0, sdk_1.logGreen)({
311
- quiet: cmdObj.quiet,
333
+ quiet: args.quiet,
312
334
  text: (0, sdk_1.success)(`Initial voice credit proxy contract address: ${initialVoiceCreditProxyContractAddress}`),
313
335
  });
314
336
  (0, sdk_1.logGreen)({
315
- quiet: cmdObj.quiet,
337
+ quiet: args.quiet,
316
338
  text: (0, sdk_1.success)(`Signup policy contract address: ${policyContractAddress}`),
317
339
  });
318
340
  }
@@ -323,8 +345,7 @@ program
323
345
  program
324
346
  .command("joinPoll")
325
347
  .description("join the poll")
326
- .requiredOption("-k, --priv-key <privKey>", "the private key")
327
- .option("-i, --state-index <stateIndex>", "the user's state index", BigInt)
348
+ .requiredOption("-k, --private-key <privateKey>", "the private key")
328
349
  .option("-s, --sg-data <sgData>", "the signup policy data")
329
350
  .option("-v, --ivcp-data <ivcpData>", "the initial voice credit proxy data")
330
351
  .option("-n, --new-voice-credit-balance <newVoiceCreditBalance>", "the voice credit balance of the user for the poll", BigInt)
@@ -340,38 +361,37 @@ program
340
361
  .requiredOption("--poll-joining-zkey <pollZkeyPath>", "the poll join zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
341
362
  .option("-w, --wasm", "whether to use the wasm binaries")
342
363
  .option("-r, --rapidsnark <rapidsnark>", "the path to the rapidsnark binary")
343
- .option("-g, --poll-witnessgen <pollWitnessgen>", "the path to the poll witness generation binary")
344
- .action(async (cmdObj) => {
364
+ .option("-g, --poll-witness-generator <pollWitnessGenerator>", "the path to the poll witness generation binary")
365
+ .action(async (args) => {
345
366
  try {
346
367
  const signer = await getSigner();
347
368
  const network = await signer.provider?.getNetwork();
348
369
  const [maciAddress] = (0, utils_1.readContractAddresses)({
349
370
  contractNames: [sdk_1.EContracts.MACI],
350
371
  network: network?.name,
351
- defaultAddresses: [cmdObj.maciAddress],
372
+ defaultAddresses: [args.maciAddress],
352
373
  });
353
- const privateKey = cmdObj.privKey || (await (0, utils_1.promptSensitiveValue)("Insert your MACI private key"));
374
+ const privateKey = args.privateKey || (await (0, utils_1.promptSensitiveValue)("Insert your MACI private key"));
354
375
  const data = await (0, sdk_1.joinPoll)({
355
376
  maciAddress,
356
377
  privateKey,
357
- stateIndex: cmdObj.stateIndex,
358
- stateFile: cmdObj.stateFile,
359
- pollId: cmdObj.pollId,
378
+ stateFile: args.stateFile,
379
+ pollId: args.pollId,
360
380
  signer,
361
- startBlock: cmdObj.startBlock,
362
- endBlock: cmdObj.endBlock,
363
- blocksPerBatch: cmdObj.blocksPerBatch,
364
- pollJoiningZkey: cmdObj.pollJoiningZkey,
365
- pollWasm: cmdObj.pollWasm,
366
- useWasm: cmdObj.wasm,
367
- rapidsnark: cmdObj.rapidsnark,
368
- pollWitgen: cmdObj.pollWitnessgen,
369
- sgDataArg: cmdObj.sgData ?? utils_1.DEFAULT_SG_DATA,
370
- ivcpDataArg: cmdObj.ivcpData ?? utils_1.DEFAULT_IVCP_DATA,
371
- });
372
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.info)(`User joined poll with nullifier: ${data.nullifier}`) });
373
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.info)(`User joined poll with state index: ${data.pollStateIndex}`) });
374
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.info)(`User joined poll with ${data.voiceCredits} voice credits`) });
381
+ startBlock: args.startBlock,
382
+ endBlock: args.endBlock,
383
+ blocksPerBatch: args.blocksPerBatch,
384
+ pollJoiningZkey: args.pollJoiningZkey,
385
+ pollWasm: args.pollWasm,
386
+ useWasm: args.wasm,
387
+ rapidsnark: args.rapidsnark,
388
+ pollWitnessGenerator: args.pollWitnessGenerator,
389
+ sgDataArg: args.sgData ?? utils_1.DEFAULT_SG_DATA,
390
+ ivcpDataArg: args.ivcpData ?? utils_1.DEFAULT_IVCP_DATA,
391
+ });
392
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.info)(`User joined poll with nullifier: ${data.nullifier}`) });
393
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.info)(`User joined poll with state index: ${data.pollStateIndex}`) });
394
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.info)(`User joined poll with ${data.voiceCredits} voice credits`) });
375
395
  }
376
396
  catch (error) {
377
397
  program.error(error.message, { exitCode: 1 });
@@ -381,47 +401,70 @@ program
381
401
  .command("setVerifyingKeys")
382
402
  .description("set the verifying keys")
383
403
  .requiredOption("-s, --state-tree-depth <stateTreeDepth>", "the state tree depth", parseInt)
384
- .requiredOption("-i, --int-state-tree-depth <intStateTreeDepth>", "the intermediate state tree depth", parseInt)
404
+ .requiredOption("-i, --tally-processing-state-tree-depth <tallyProcessingStateTreeDepth>", "the intermediate state tree depth", parseInt)
385
405
  .requiredOption("-v, --vote-option-tree-depth <voteOptionTreeDepth>", "the vote option tree depth", parseInt)
386
- .requiredOption("-b, --msg-batch-size <messageBatchSize>", "the message batch size", parseInt)
406
+ .requiredOption("-b, --message-batch-size <messageBatchSize>", "the message batch size", parseInt)
407
+ .option("--poll-state-tree-depth <pollStateTreeDepth>", "the poll state tree depth", parseInt)
387
408
  .option("--poll-joining-zkey <pollJoiningZkeyPath>", "the poll joining zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
388
409
  .option("--poll-joined-zkey <pollJoinedZkeyPath>", "the poll joined zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
389
- .option("--process-messages-zkey-qv <processMessagesZkeyPathQv>", "the process messages qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
390
- .option("--tally-votes-zkey-qv <tallyVotesZkeyPathQv>", "the tally votes qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
391
- .option("--process-messages-zkey-non-qv <processMessagesZkeyPathNonQv>", "the process messages non-qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
392
- .option("--tally-votes-zkey-non-qv <tallyVotesZkeyPathNonQv>", "the tally votes non-qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
393
- .option("-u, --use-quadratic-voting <useQuadraticVoting>", "whether to use quadratic voting", (value) => value === "true", true)
410
+ .option("--message-processor-zkey-qv <messageProcessorZkeyPathQv>", "the message processor qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
411
+ .option("--vote-tally-zkey-qv <voteTallyZkeyPathQv>", "the vote tally qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
412
+ .option("--message-processor-zkey-non-qv <messageProcessorZkeyPathNonQv>", "the message processor non-qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
413
+ .option("--vote-tally-zkey-non-qv <voteTallyZkeyPathNonQv>", "the vote tally non-qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
414
+ .option("--message-processor-zkey-full <messageProcessorZkeyPathFull>", "the message processor full zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
415
+ .option("--vote-tally-zkey-full <tallyVotesZkeyPathFull>", "the vote tally full zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
416
+ .option("-m, --modes <modes>", "Comma-separated list of voting modes (qv, non-qv, full)", (value) => value.split(",").map((v) => constants_1.MODE_NAME_TO_ENUM[v.trim()]), [sdk_1.EMode.QV])
394
417
  .option("-k, --vk-registry <vkRegistry>", "the vk registry contract address")
395
418
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
396
419
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
397
- .action(async (cmdObj) => {
420
+ .action(async (args) => {
398
421
  try {
399
422
  const signer = await getSigner();
400
423
  const network = await signer.provider?.getNetwork();
401
- const [vkRegistryAddress] = (0, utils_1.readContractAddresses)({
402
- contractNames: [sdk_1.EContracts.VkRegistry],
424
+ const [verifyingKeysRegistryAddress] = (0, utils_1.readContractAddresses)({
425
+ contractNames: [sdk_1.EContracts.VerifyingKeysRegistry],
403
426
  network: network?.name,
404
- defaultAddresses: [cmdObj.vkRegistry],
427
+ defaultAddresses: [args.vkRegistry],
405
428
  });
406
- const { pollJoiningVk, pollJoinedVk, processVk, tallyVk } = await (0, sdk_1.extractAllVks)({
407
- pollJoiningZkeyPath: cmdObj.pollJoiningZkey,
408
- pollJoinedZkeyPath: cmdObj.pollJoinedZkey,
409
- processMessagesZkeyPath: cmdObj.useQuadraticVoting
410
- ? cmdObj.processMessagesZkeyQv
411
- : cmdObj.processMessagesZkeyNonQv,
412
- tallyVotesZkeyPath: cmdObj.useQuadraticVoting ? cmdObj.tallyVotesZkeyQv : cmdObj.tallyVotesZkeyQv,
429
+ const processKeys = {
430
+ [sdk_1.EMode.QV]: args.messageProcessorZkeyQv,
431
+ [sdk_1.EMode.NON_QV]: args.messageProcessorZkeyNonQv,
432
+ [sdk_1.EMode.FULL]: args.messageProcessorZkeyFull,
433
+ };
434
+ const tallyKeys = {
435
+ [sdk_1.EMode.QV]: args.voteTallyZkeyQv,
436
+ [sdk_1.EMode.NON_QV]: args.voteTallyZkeyNonQv,
437
+ [sdk_1.EMode.FULL]: args.voteTallyZkeyFull,
438
+ };
439
+ const { pollJoiningVerifyingKey, pollJoinedVerifyingKey } = await (0, sdk_1.extractAllVerifyingKeys)({
440
+ pollJoiningZkeyPath: args.pollJoiningZkey,
441
+ pollJoinedZkeyPath: args.pollJoinedZkey,
442
+ });
443
+ const keysResults = await Promise.all(args.modes.map((mode) => (0, sdk_1.extractAllVerifyingKeys)({
444
+ messageProcessorZkeyPath: processKeys[mode],
445
+ voteTallyZkeyPath: tallyKeys[mode],
446
+ })));
447
+ const processVerifyingKeys = [];
448
+ const tallyVerifyingKeys = [];
449
+ keysResults.forEach(({ processVerifyingKey, tallyVerifyingKey }, idx) => {
450
+ if (!processVerifyingKey || !tallyVerifyingKey) {
451
+ throw new Error(`Verifying keys for mode ${args.modes[idx]} are not valid`);
452
+ }
453
+ processVerifyingKeys.push(processVerifyingKey);
454
+ tallyVerifyingKeys.push(tallyVerifyingKey);
413
455
  });
414
456
  await (0, sdk_1.setVerifyingKeys)({
415
- stateTreeDepth: cmdObj.stateTreeDepth,
416
- intStateTreeDepth: cmdObj.intStateTreeDepth,
417
- voteOptionTreeDepth: cmdObj.voteOptionTreeDepth,
418
- messageBatchSize: cmdObj.msgBatchSize,
419
- pollJoiningVk: pollJoiningVk,
420
- pollJoinedVk: pollJoinedVk,
421
- processMessagesVk: processVk,
422
- tallyVotesVk: tallyVk,
423
- vkRegistryAddress,
424
- mode: cmdObj.useQuadraticVoting ? sdk_1.EMode.QV : sdk_1.EMode.NON_QV,
457
+ stateTreeDepth: args.stateTreeDepth,
458
+ tallyProcessingStateTreeDepth: args.tallyProcessingStateTreeDepth,
459
+ voteOptionTreeDepth: args.voteOptionTreeDepth,
460
+ messageBatchSize: args.messageBatchSize,
461
+ pollStateTreeDepth: args.pollStateTreeDepth || args.stateTreeDepth,
462
+ pollJoiningVerifyingKey: pollJoiningVerifyingKey,
463
+ pollJoinedVerifyingKey: pollJoinedVerifyingKey,
464
+ processMessagesVerifyingKeys: processVerifyingKeys,
465
+ tallyVotesVerifyingKeys: tallyVerifyingKeys,
466
+ verifyingKeysRegistryAddress,
467
+ modes: args.modes,
425
468
  signer,
426
469
  });
427
470
  }
@@ -432,9 +475,9 @@ program
432
475
  program
433
476
  .command("publish")
434
477
  .description("publish a new message to a MACI Poll contract")
435
- .requiredOption("-p, --pubkey <pubkey>", "the MACI public key which should replace the user's public key in the state tree")
478
+ .requiredOption("-p, --public-key <publicKey>", "the MACI public key which should replace the user's public key in the state tree")
436
479
  .option("-x, --maci-address <maciAddress>", "the MACI contract address")
437
- .option("-k, --privkey <privkey>", "your serialized MACI private key")
480
+ .option("-k, --private-key <privateKey>", "your serialized MACI private key")
438
481
  .requiredOption("-i, --state-index <stateIndex>", "the user's state index", BigInt)
439
482
  .requiredOption("-v, --vote-option-index <voteOptionIndex>", "the vote option index", BigInt)
440
483
  .requiredOption("-n, --nonce <nonce>", "the message nonce", BigInt)
@@ -443,25 +486,25 @@ program
443
486
  .requiredOption("-w, --new-vote-weight <newVoteWeight>", "the new vote weight", BigInt)
444
487
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
445
488
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
446
- .action(async (cmdObj) => {
489
+ .action(async (args) => {
447
490
  try {
448
491
  const signer = await getSigner();
449
492
  const network = await signer.provider?.getNetwork();
450
493
  const [maciAddress] = (0, utils_1.readContractAddresses)({
451
494
  contractNames: [sdk_1.EContracts.MACI],
452
495
  network: network?.name,
453
- defaultAddresses: [cmdObj.maciAddress],
496
+ defaultAddresses: [args.maciAddress],
454
497
  });
455
- const privateKey = cmdObj.privkey || (await (0, utils_1.promptSensitiveValue)("Insert your MACI private key"));
498
+ const privateKey = args.privateKey || (await (0, utils_1.promptSensitiveValue)("Insert your MACI private key"));
456
499
  await (0, sdk_1.publish)({
457
- pubkey: cmdObj.pubkey,
458
- stateIndex: cmdObj.stateIndex,
459
- voteOptionIndex: cmdObj.voteOptionIndex,
460
- nonce: cmdObj.nonce,
461
- pollId: cmdObj.pollId,
462
- newVoteWeight: cmdObj.newVoteWeight,
500
+ publicKey: args.publicKey,
501
+ stateIndex: args.stateIndex,
502
+ voteOptionIndex: args.voteOptionIndex,
503
+ nonce: args.nonce,
504
+ pollId: args.pollId,
505
+ newVoteWeight: args.newVoteWeight,
463
506
  maciAddress,
464
- salt: cmdObj.salt,
507
+ salt: args.salt,
465
508
  privateKey,
466
509
  signer,
467
510
  });
@@ -476,23 +519,23 @@ program
476
519
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
477
520
  .option("-x, --maci-address <maciAddress>", "the MACI contract address")
478
521
  .requiredOption("-p, --poll-id <pollId>", "the poll id", BigInt)
479
- .action(async (cmdObj) => {
522
+ .action(async (args) => {
480
523
  try {
481
524
  const signer = await getSigner();
482
525
  const network = await signer.provider?.getNetwork();
483
526
  const [maciAddress] = (0, utils_1.readContractAddresses)({
484
527
  contractNames: [sdk_1.EContracts.MACI],
485
528
  network: network?.name,
486
- defaultAddresses: [cmdObj.maciAddress],
529
+ defaultAddresses: [args.maciAddress],
487
530
  });
488
531
  const receipt = await (0, sdk_1.mergeSignups)({
489
- pollId: cmdObj.pollId,
532
+ pollId: args.pollId,
490
533
  maciAddress,
491
534
  signer,
492
535
  });
493
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.info)(`Transaction hash: ${receipt.hash}`) });
536
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.info)(`Transaction hash: ${receipt.hash}`) });
494
537
  (0, sdk_1.logGreen)({
495
- quiet: cmdObj.quiet,
538
+ quiet: args.quiet,
496
539
  text: (0, sdk_1.success)(`Executed mergeSignups(); gas used: ${receipt.gasUsed.toString()}`),
497
540
  });
498
541
  }
@@ -506,37 +549,39 @@ program
506
549
  .requiredOption("-s, --seconds <seconds>", "the number of seconds to fast-forward", parseInt)
507
550
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
508
551
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
509
- .action(async (cmdObj) => {
552
+ .action(async (args) => {
510
553
  try {
511
- (0, utils_1.banner)(cmdObj.quiet);
554
+ (0, utils_1.banner)(args.quiet);
512
555
  const signer = await getSigner();
513
- await (0, sdk_1.timeTravel)({ seconds: cmdObj.seconds, signer });
514
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.success)(`Fast-forwarded ${cmdObj.seconds} seconds`) });
556
+ await (0, sdk_1.timeTravel)({ seconds: args.seconds, signer });
557
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.success)(`Fast-forwarded ${args.seconds} seconds`) });
515
558
  }
516
559
  catch (error) {
517
560
  program.error(error.message, { exitCode: 1 });
518
561
  }
519
562
  });
520
563
  program
521
- .command("extractVkToFile")
564
+ .command("extractVerifyingKeyToFile")
522
565
  .description("extract vkey to json file")
523
566
  .requiredOption("--poll-joining-zkey <pollJoiningZkey>", "the poll joining zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
524
567
  .requiredOption("--poll-joined-zkey <pollJoinedZkey>", "the poll joined zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
525
- .requiredOption("--process-messages-zkey-qv <processMessagesZkeyPathQv>", "the process messages qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
526
- .requiredOption("--tally-votes-zkey-qv <tallyVotesZkeyPathQv>", "the tally votes qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
527
- .requiredOption("--process-messages-zkey-non-qv <processMessagesZkeyPathNonQv>", "the process messages non-qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
528
- .requiredOption("--tally-votes-zkey-non-qv <tallyVotesZkeyPathNonQv>", "the tally votes non-qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
568
+ .requiredOption("--message-processor-zkey-qv <messageProcessorZkeyPathQv>", "the message processor qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
569
+ .requiredOption("--vote-tally-zkey-qv <voteTallyZkeyPathQv>", "the vote tally qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
570
+ .requiredOption("--message-processor-zkey-non-qv <messageProcessorZkeyPathNonQv>", "the message processor non-qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
571
+ .requiredOption("--message-processor-zkey-full <messageProcessorZkeyPathFull>", "the message processor full zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
572
+ .requiredOption("--vote-tally-zkey-non-qv <voteTallyZkeyPathNonQv>", "the vote tally non-qv zkey path (see different options for zkey files to use specific circuits https://maci.pse.dev/docs/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)")
529
573
  .requiredOption("-o, --output-file <outputFile>", "the output file path of extracted vkeys")
530
- .action(async (cmdObj) => {
574
+ .action(async (args) => {
531
575
  try {
532
- await (0, sdk_1.extractVkToFile)({
533
- processMessagesZkeyPathQv: cmdObj.processMessagesZkeyQv,
534
- tallyVotesZkeyPathQv: cmdObj.tallyVotesZkeyQv,
535
- processMessagesZkeyPathNonQv: cmdObj.processMessagesZkeyNonQv,
536
- tallyVotesZkeyPathNonQv: cmdObj.tallyVotesZkeyNonQv,
537
- pollJoiningZkeyPath: cmdObj.pollJoiningZkey,
538
- pollJoinedZkeyPath: cmdObj.pollJoinedZkey,
539
- outputFilePath: cmdObj.outputFile,
576
+ await (0, sdk_1.extractVerifyingKeyToFile)({
577
+ messageProcessorZkeyPathQv: args.messageProcessorZkeyQv,
578
+ messageProcessorZkeyPathFull: args.messageProcessorZkeyFull,
579
+ voteTallyZkeyPathQv: args.voteTallyZkeyQv,
580
+ messageProcessorZkeyPathNonQv: args.messageProcessorZkeyNonQv,
581
+ voteTallyZkeyPathNonQv: args.voteTallyZkeyNonQv,
582
+ pollJoiningZkeyPath: args.pollJoiningZkey,
583
+ pollJoinedZkeyPath: args.pollJoinedZkey,
584
+ outputFilePath: args.outputFile,
540
585
  });
541
586
  }
542
587
  catch (error) {
@@ -546,28 +591,28 @@ program
546
591
  program
547
592
  .command("signup")
548
593
  .description("Sign up to a MACI contract")
549
- .requiredOption("-p, --pubkey <maciPubKey>", "the MACI public key")
594
+ .requiredOption("-p, --public-key <publicKey>", "the MACI public key")
550
595
  .option("-x, --maci-address <maciAddress>", "the MACI contract address")
551
596
  .option("-s, --sg-data <sgData>", "the signup gateway data")
552
597
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
553
598
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
554
- .action(async (cmdObj) => {
599
+ .action(async (args) => {
555
600
  try {
556
601
  const signer = await getSigner();
557
602
  const network = await signer.provider?.getNetwork();
558
603
  const [maciAddress] = (0, utils_1.readContractAddresses)({
559
604
  contractNames: [sdk_1.EContracts.MACI],
560
605
  network: network?.name,
561
- defaultAddresses: [cmdObj.maciAddress],
606
+ defaultAddresses: [args.maciAddress],
562
607
  });
563
608
  const data = await (0, sdk_1.signup)({
564
- maciPubKey: cmdObj.pubkey,
609
+ maciPublicKey: args.publicKey,
565
610
  maciAddress,
566
- sgData: cmdObj.sgData ?? utils_1.DEFAULT_SG_DATA,
611
+ sgData: args.sgData ?? utils_1.DEFAULT_SG_DATA,
567
612
  signer,
568
613
  });
569
614
  (0, sdk_1.logGreen)({
570
- quiet: cmdObj.quiet,
615
+ quiet: args.quiet,
571
616
  text: (0, sdk_1.success)(`State index: ${data.stateIndex.toString()}\n Transaction hash: ${data.transactionHash}`),
572
617
  });
573
618
  }
@@ -578,28 +623,28 @@ program
578
623
  program
579
624
  .command("isRegisteredUser")
580
625
  .description("Checks if user is registered with their public key and get their data")
581
- .requiredOption("-p, --pubkey <maciPubKey>", "the MACI public key")
626
+ .requiredOption("-p, --public-key <publicKey>", "the MACI public key")
582
627
  .option("-x, --maci-address <maciAddress>", "the MACI contract address")
583
628
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
584
- .action(async (cmdObj) => {
629
+ .action(async (args) => {
585
630
  try {
586
631
  const signer = await getSigner();
587
632
  const network = await signer.provider?.getNetwork();
588
633
  const [maciAddress] = (0, utils_1.readContractAddresses)({
589
634
  contractNames: [sdk_1.EContracts.MACI],
590
635
  network: network?.name,
591
- defaultAddresses: [cmdObj.maciAddress],
636
+ defaultAddresses: [args.maciAddress],
592
637
  });
593
638
  const data = await (0, sdk_1.getSignedupUserData)({
594
- maciPubKey: cmdObj.pubkey,
639
+ maciPublicKey: args.publicKey,
595
640
  maciAddress,
596
641
  signer,
597
642
  });
598
643
  if (data.isRegistered) {
599
- (0, sdk_1.logGreen)({ quiet: cmdObj.quiet, text: (0, sdk_1.success)(`State index: ${data.stateIndex?.toString()}`) });
644
+ (0, sdk_1.logGreen)({ quiet: args.quiet, text: (0, sdk_1.success)(`State index: ${data.stateIndex?.toString()}`) });
600
645
  }
601
646
  else {
602
- (0, sdk_1.logRed)({ quiet: cmdObj.quiet, text: "User is not registered" });
647
+ (0, sdk_1.logRed)({ quiet: args.quiet, text: "User is not registered" });
603
648
  }
604
649
  }
605
650
  catch (error) {
@@ -609,32 +654,32 @@ program
609
654
  program
610
655
  .command("isJoinedUser")
611
656
  .description("Checks if user is joined to the poll with public key")
612
- .requiredOption("-p, --pubkey <pubkey>", "the MACI public key")
657
+ .requiredOption("-p, --public-key <publicKey>", "the MACI public key")
613
658
  .option("-x, --maci-address <maciAddress>", "the MACI contract address")
614
659
  .requiredOption("-o, --poll-id <pollId>", "the poll id", BigInt)
615
660
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
616
661
  .option("--start-block <startBlock>", "the block number to start looking for events from", parseInt)
617
662
  .option("--end-block <endBlock>", "the block number to end looking for events from", parseInt)
618
663
  .option("--blocks-per-batch <blockPerBatch>", "the number of blocks to process per batch", parseInt)
619
- .action(async (cmdObj) => {
664
+ .action(async (args) => {
620
665
  try {
621
666
  const signer = await getSigner();
622
667
  const network = await signer.provider?.getNetwork();
623
668
  const [maciAddress] = (0, utils_1.readContractAddresses)({
624
669
  contractNames: [sdk_1.EContracts.MACI],
625
670
  network: network?.name,
626
- defaultAddresses: [cmdObj.maciAddress],
671
+ defaultAddresses: [args.maciAddress],
627
672
  });
628
673
  const data = await (0, sdk_1.getJoinedUserData)({
629
- pollPubKey: cmdObj.pubkey,
630
- startBlock: cmdObj.startBlock,
674
+ pollPublicKey: args.publicKey,
675
+ startBlock: args.startBlock,
631
676
  maciAddress,
632
- pollId: cmdObj.pollId,
677
+ pollId: args.pollId,
633
678
  signer,
634
679
  });
635
680
  if (data.isJoined) {
636
681
  (0, sdk_1.logGreen)({
637
- quiet: cmdObj.quiet,
682
+ quiet: args.quiet,
638
683
  text: (0, sdk_1.success)([
639
684
  `Poll state index: ${data.pollStateIndex?.toString()}, registered: ${data.isJoined}`,
640
685
  `Voice credits: ${data.voiceCredits?.toString()}`,
@@ -642,7 +687,7 @@ program
642
687
  });
643
688
  }
644
689
  else {
645
- (0, sdk_1.logRed)({ quiet: cmdObj.quiet, text: "User has not joined the poll" });
690
+ (0, sdk_1.logRed)({ quiet: args.quiet, text: "User has not joined the poll" });
646
691
  }
647
692
  }
648
693
  catch (error) {
@@ -654,29 +699,34 @@ program
654
699
  .description("Get deployed poll from MACI contract")
655
700
  .option("-p, --poll <poll>", "the poll id")
656
701
  .option("-x, --maci-address <maciAddress>", "the MACI contract address")
657
- .action(async (cmdObj) => {
702
+ .action(async (args) => {
658
703
  try {
659
704
  const signer = await getSigner();
660
705
  const network = await signer.provider?.getNetwork();
661
706
  const [maciAddress] = (0, utils_1.readContractAddresses)({
662
707
  contractNames: [sdk_1.EContracts.MACI],
663
708
  network: network?.name,
664
- defaultAddresses: [cmdObj.maciAddress],
709
+ defaultAddresses: [args.maciAddress],
665
710
  });
666
711
  const details = await (0, sdk_1.getPoll)({
667
- pollId: cmdObj.poll,
712
+ pollId: args.poll,
668
713
  maciAddress,
669
714
  signer,
670
715
  });
716
+ const modeNames = {
717
+ [sdk_1.EMode.QV]: "Quadratic Voting",
718
+ [sdk_1.EMode.NON_QV]: "Non-Quadratic Voting",
719
+ [sdk_1.EMode.FULL]: "Full Credits Voting",
720
+ };
671
721
  (0, sdk_1.logGreen)({
672
722
  quiet: true,
673
723
  text: (0, sdk_1.success)([
674
724
  `ID: ${details.id}`,
675
725
  `Start time: ${new Date(Number(details.startDate) * 1000).toString()}`,
676
726
  `End time: ${new Date(Number(details.endDate) * 1000).toString()}`,
677
- `Number of signups ${details.numSignups}`,
727
+ `Number of signups ${details.totalSignups}`,
678
728
  `State tree merged: ${details.isMerged}`,
679
- `Mode: ${details.mode === 0n ? "Quadratic Voting" : "Non-Quadratic Voting"}`,
729
+ `Mode: ${modeNames[details.mode]}`,
680
730
  ].join("\n")),
681
731
  });
682
732
  }
@@ -691,15 +741,15 @@ program
691
741
  .requiredOption("-w, --address <address>", "the address to fund")
692
742
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
693
743
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
694
- .action(async (cmdObj) => {
744
+ .action(async (args) => {
695
745
  try {
696
- (0, utils_1.banner)(cmdObj.quiet);
746
+ (0, utils_1.banner)(args.quiet);
697
747
  const signer = await getSigner();
698
- const hash = await (0, sdk_1.fundWallet)({ amount: cmdObj.amount, address: cmdObj.address, signer });
699
- (0, sdk_1.logYellow)({ quiet: cmdObj.quiet, text: (0, sdk_1.info)(`Transaction hash: ${hash}`) });
748
+ const hash = await (0, sdk_1.fundWallet)({ amount: args.amount, address: args.address, signer });
749
+ (0, sdk_1.logYellow)({ quiet: args.quiet, text: (0, sdk_1.info)(`Transaction hash: ${hash}`) });
700
750
  (0, sdk_1.logGreen)({
701
- quiet: cmdObj.quiet,
702
- text: (0, sdk_1.success)(`Successfully funded ${cmdObj.address} with ${cmdObj.amount} wei`),
751
+ quiet: args.quiet,
752
+ text: (0, sdk_1.success)(`Successfully funded ${args.address} with ${args.amount} wei`),
703
753
  });
704
754
  }
705
755
  catch (error) {
@@ -714,34 +764,34 @@ program
714
764
  .option("-x, --maci-address <maciAddress>", "the MACI contract address")
715
765
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
716
766
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
717
- .action(async (cmdObj) => {
767
+ .action(async (args) => {
718
768
  try {
719
- (0, utils_1.banner)(cmdObj.quiet);
769
+ (0, utils_1.banner)(args.quiet);
720
770
  const signer = await getSigner();
721
771
  const network = await signer.provider?.getNetwork();
722
772
  // read the tally file
723
- const isTallyFileExists = fs_1.default.existsSync(cmdObj.tallyFile);
724
- if (!cmdObj.tallyFile || !isTallyFileExists) {
725
- throw new Error(`Unable to open ${cmdObj.tallyFile}`);
773
+ const isTallyFileExists = fs_1.default.existsSync(args.tallyFile);
774
+ if (!args.tallyFile || !isTallyFileExists) {
775
+ throw new Error(`Unable to open ${args.tallyFile}`);
726
776
  }
727
- const tallyData = await (0, utils_1.readJSONFile)(cmdObj.tallyFile);
777
+ const tallyData = await (0, utils_1.readJSONFile)(args.tallyFile);
728
778
  const [maciAddress] = (0, utils_1.readContractAddresses)({
729
779
  contractNames: [sdk_1.EContracts.MACI],
730
780
  network: network?.name,
731
- defaultAddresses: [cmdObj.maciAddress],
781
+ defaultAddresses: [args.maciAddress],
732
782
  });
733
- const pollParams = await (0, sdk_1.getPollParams)({ pollId: cmdObj.pollId, maciContractAddress: maciAddress, signer });
783
+ const pollParams = await (0, sdk_1.getPollParams)({ pollId: args.pollId, maciContractAddress: maciAddress, signer });
734
784
  const tallyCommitments = (0, sdk_1.generateTallyCommitments)({
735
785
  tallyData,
736
786
  voteOptionTreeDepth: pollParams.voteOptionTreeDepth,
737
787
  });
738
788
  await (0, sdk_1.verify)({
739
789
  tallyData,
740
- pollId: cmdObj.pollId,
790
+ pollId: args.pollId,
741
791
  maciAddress,
742
792
  signer,
743
793
  tallyCommitments,
744
- numVoteOptions: pollParams.numVoteOptions,
794
+ totalVoteOptions: pollParams.totalVoteOptions,
745
795
  voteOptionTreeDepth: pollParams.voteOptionTreeDepth,
746
796
  });
747
797
  }
@@ -750,34 +800,34 @@ program
750
800
  }
751
801
  });
752
802
  program
753
- .command("genProofs")
803
+ .command("generateProofs")
754
804
  .description("generate the proofs for a poll")
755
- .option("-k, --privkey <privkey>", "your serialized MACI private key")
805
+ .option("-k, --private-key <privateKey>", "your serialized MACI private key")
756
806
  .option("-x, --maci-address <maciAddress>", "the MACI contract address")
757
807
  .requiredOption("-o, --poll-id <pollId>", "the poll id", BigInt)
758
808
  .requiredOption("-t, --tally-file <tallyFile>", "the tally file with results, per vote option spent credits, spent voice credits total")
759
809
  .option("-r, --rapidsnark <rapidsnark>", "the path to the rapidsnark binary")
760
- .option("-g, --process-witnessgen <processWitnessgen>", "the path to the process witness generation binary")
761
- .option("--process-witnessdat <processWitnessdat>", "the path to the process witness dat file")
762
- .option("--tally-witnessgen <tallyWitnessgen>", "the path to the tally witness generation binary")
763
- .option("--tally-witnessdat <tallyWitnessdat>", "the path to the tally witness dat file")
810
+ .option("-g, --message-processor-witness-generator <messageProcessorWitnessGenerator>", "the path to the process witness generation binary")
811
+ .option("--message-processor-witnessDat <messageProcessorWitnessDat>", "the path to the process witness dat file")
812
+ .option("--vote-tally-witness-generator <voteTallyWitnessGenerator>", "the path to the tally witness generation binary")
813
+ .option("--vote-tally-witnessDat <voteTallyWitnessDat>", "the path to the tally witness dat file")
764
814
  .requiredOption("--poll-joining-zkey <processJoinZkey>", "the path to the poll join zkey")
765
- .requiredOption("--process-zkey <processZkey>", "the path to the process zkey")
766
- .requiredOption("--tally-zkey <tallyZkey>", "the path to the tally zkey")
815
+ .requiredOption("--message-processor-zkey <messageProcessorZkey>", "the path to the process zkey")
816
+ .requiredOption("--vote-tally-zkey <voteTallyZkey>", "the path to the tally zkey")
767
817
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
768
818
  .option("-p, --rpc-provider <provider>", "the rpc provider URL")
769
819
  .requiredOption("-f, --output <outputDir>", "the output directory for proofs")
770
820
  .option("--transaction-hash <transactionHash>", "transaction hash of MACI contract creation")
771
821
  .option("-w, --wasm", "whether to use the wasm binaries")
772
- .option("--process-wasm <processWasm>", "the path to the process witness generation wasm binary")
773
- .option("--tally-wasm <tallyWasm>", "the path to the tally witness generation wasm binary")
822
+ .option("--message-processor-wasm <messageProcessorWasm>", "the path to the process witness generation wasm binary")
823
+ .option("--vote-tally-wasm <voteTallyWasm>", "the path to the tally witness generation wasm binary")
774
824
  .option("--state-file <stateFile>", "the path to the state file containing the serialized maci state")
775
825
  .option("--start-block <startBlock>", "the block number to start looking for events from", parseInt)
776
826
  .option("--end-block <endBlock>", "the block number to end looking for events from", parseInt)
777
827
  .option("--blocks-per-batch <blockPerBatch>", "the number of blocks to process per batch", parseInt)
778
- .option("-u, --use-quadratic-voting <useQuadraticVoting>", "whether to use quadratic voting", (value) => value === "true", true)
828
+ .option("-m, --mode <mode>", "Voting mode (qv, non-qv, full)", (value) => constants_1.MODE_NAME_TO_ENUM[value], sdk_1.EMode.QV)
779
829
  .option("-b, --ipfs-message-backup-files <ipfsMessageBackupFiles>", "Backup files for ipfs messages (name format: ipfsHash1.json, ipfsHash2.json, ..., ipfsHashN.json)", (value) => value?.split(/\s*,\s*/))
780
- .action(async ({ quiet, maciAddress, pollId, ipfsMessageBackupFiles, stateFile, startBlock, endBlock, blocksPerBatch, privkey, transactionHash, output, tallyFile, tallyZkey, tallyWitnessgen, tallyWasm, processZkey, processWitnessgen, processWasm, useQuadraticVoting, tallyWitnessdat, processWitnessdat, wasm, rapidsnark, }) => {
830
+ .action(async ({ quiet, maciAddress, pollId, ipfsMessageBackupFiles, stateFile, startBlock, endBlock, blocksPerBatch, privateKey, transactionHash, output, tallyFile, voteTallyZkey, voteTallyWitnessGenerator, voteTallyWasm, messageProcessorZkey, messageProcessorWitnessGenerator, messageProcessorWasm, mode, voteTallyWitnessDat, messageProcessorWitnessDat, wasm, rapidsnark, }) => {
781
831
  try {
782
832
  (0, utils_1.banner)(quiet);
783
833
  const signer = await getSigner();
@@ -787,7 +837,7 @@ program
787
837
  network: network?.name,
788
838
  defaultAddresses: [maciAddress],
789
839
  });
790
- const coordinatorPrivateKey = privkey || (await (0, utils_1.promptSensitiveValue)("Insert your MACI private key"));
840
+ const coordinatorPrivateKey = privateKey || (await (0, utils_1.promptSensitiveValue)("Insert your MACI private key"));
791
841
  await (0, sdk_1.generateProofs)({
792
842
  maciAddress: maciContractAddress,
793
843
  coordinatorPrivateKey,
@@ -801,15 +851,15 @@ program
801
851
  signer,
802
852
  outputDir: output,
803
853
  tallyFile,
804
- tallyZkey,
805
- tallyWitgen: tallyWitnessgen,
806
- tallyWasm,
807
- processZkey,
808
- processWitgen: processWitnessgen,
809
- processWasm,
810
- useQuadraticVoting,
811
- tallyDatFile: tallyWitnessdat,
812
- processDatFile: processWitnessdat,
854
+ voteTallyZkey,
855
+ voteTallyWitnessGenerator,
856
+ voteTallyWasm,
857
+ messageProcessorZkey,
858
+ messageProcessorWitnessGenerator,
859
+ messageProcessorWasm,
860
+ mode,
861
+ voteTallyWitnessDatFile: voteTallyWitnessDat,
862
+ messageProcessorWitnessDatFile: messageProcessorWitnessDat,
813
863
  useWasm: wasm,
814
864
  rapidsnark,
815
865
  });
@@ -819,12 +869,12 @@ program
819
869
  }
820
870
  });
821
871
  program
822
- .command("genLocalState")
872
+ .command("generateLocalState")
823
873
  .description("generate a local MACI state from the smart contracts events")
824
874
  .requiredOption("-o, --output <outputPath>", "the path where to write the state")
825
875
  .requiredOption("-p, --poll-id <pollId>", "the id of the poll", BigInt)
826
876
  .option("-x, --maci-address <maciAddress>", "the MACI contract address")
827
- .option("-k, --privkey <privkey>", "your serialized MACI private key")
877
+ .option("-k, --private-key <privateKey>", "your serialized MACI private key")
828
878
  .option("--start-block <startBlock>", "the start block number", parseInt)
829
879
  .option("--end-block <endBlock>", "the end block number", parseInt)
830
880
  .option("--blocks-per-batch <blockPerBatch>", "the blocks per batch", parseInt)
@@ -834,30 +884,30 @@ program
834
884
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
835
885
  .option("-b, --ipfs-message-backup-files <ipfsMessageBackupFiles>", "Backup files for ipfs messages (name format: ipfsHash1.json, ipfsHash2.json, ..., ipfsHashN.json)", (value) => value?.split(/\s*,\s*/))
836
886
  .option("-l, --logs-output <logsOutputPath>", "the path where to save the logs for debugging and auditing purposes")
837
- .action(async (cmdObj) => {
887
+ .action(async (args) => {
838
888
  try {
839
889
  const signer = await getSigner();
840
890
  const network = await signer.provider?.getNetwork();
841
891
  const [maciAddress] = (0, utils_1.readContractAddresses)({
842
892
  contractNames: [sdk_1.EContracts.MACI],
843
893
  network: network?.name,
844
- defaultAddresses: [cmdObj.maciAddress],
894
+ defaultAddresses: [args.maciAddress],
845
895
  });
846
- const coordinatorPrivateKey = cmdObj.privkey || (await (0, utils_1.promptSensitiveValue)("Insert your MACI private key"));
896
+ const coordinatorPrivateKey = args.privateKey || (await (0, utils_1.promptSensitiveValue)("Insert your MACI private key"));
847
897
  await (0, sdk_1.generateMaciState)({
848
- outputPath: cmdObj.output.toString(),
849
- pollId: cmdObj.pollId,
898
+ outputPath: args.output.toString(),
899
+ pollId: args.pollId,
850
900
  maciAddress,
851
901
  coordinatorPrivateKey,
852
- provider: cmdObj.rpcProvider,
853
- endBlock: cmdObj.endBlock,
854
- startBlock: cmdObj.startBlock,
855
- blockPerBatch: cmdObj.blocksPerBatch,
856
- transactionHash: cmdObj.transactionHash,
857
- ipfsMessageBackupFiles: cmdObj.ipfsMessageBackupFiles,
858
- sleep: cmdObj.sleep,
902
+ provider: args.rpcProvider,
903
+ endBlock: args.endBlock,
904
+ startBlock: args.startBlock,
905
+ blockPerBatch: args.blocksPerBatch,
906
+ transactionHash: args.transactionHash,
907
+ ipfsMessageBackupFiles: args.ipfsMessageBackupFiles,
908
+ sleep: args.sleep,
859
909
  signer,
860
- logsOutputPath: cmdObj.logsOutput,
910
+ logsOutputPath: args.logsOutput,
861
911
  });
862
912
  }
863
913
  catch (error) {
@@ -872,20 +922,20 @@ program
872
922
  .option("-q, --quiet <quiet>", "whether to print values to the console", (value) => value === "true", false)
873
923
  .option("-r, --rpc-provider <provider>", "the rpc provider URL")
874
924
  .option("-x, --maci-address <maciAddress>", "the MACI contract address")
875
- .requiredOption("-f, --proof-dir <proofDir>", "the proof output directory from the genProofs subcommand")
876
- .action(async (cmdObj) => {
925
+ .requiredOption("-f, --proof-dir <proofDir>", "the proof output directory from the generateProofs subcommand")
926
+ .action(async (args) => {
877
927
  try {
878
928
  const signer = await getSigner();
879
929
  const network = await signer.provider?.getNetwork();
880
930
  const [maciAddress] = (0, utils_1.readContractAddresses)({
881
931
  contractNames: [sdk_1.EContracts.MACI],
882
932
  network: network?.name,
883
- defaultAddresses: [cmdObj.maciAddress],
933
+ defaultAddresses: [args.maciAddress],
884
934
  });
885
935
  await (0, sdk_1.proveOnChain)({
886
- pollId: cmdObj.pollId,
887
- tallyFile: cmdObj.tallyFile,
888
- proofDir: cmdObj.proofDir,
936
+ pollId: args.pollId,
937
+ tallyFile: args.tallyFile,
938
+ proofDir: args.proofDir,
889
939
  maciAddress,
890
940
  signer,
891
941
  });