From dfc5fd2050f60e869c940d656ed66c895dc23fe5 Mon Sep 17 00:00:00 2001 From: yu-zhen Date: Thu, 4 Apr 2024 00:39:00 +0800 Subject: [PATCH] chore: unify maci address arguments --- .../ceremony-params/ceremonyParams.test.ts | 8 +-- cli/tests/e2e/e2e.nonQv.test.ts | 2 +- cli/tests/e2e/e2e.subsidy.test.ts | 30 +++++------ cli/tests/e2e/e2e.test.ts | 54 +++++++++---------- cli/tests/e2e/keyChange.test.ts | 12 ++--- cli/tests/unit/publish.test.ts | 2 +- cli/ts/commands/genLocalState.ts | 12 ++--- cli/ts/commands/mergeMessages.ts | 10 ++-- cli/ts/commands/mergeSignups.ts | 10 ++-- cli/ts/commands/publish.ts | 10 ++-- cli/ts/index.ts | 46 ++++++++-------- cli/ts/utils/interfaces.ts | 10 ++-- .../ts/__tests__/integration.test.ts | 6 +-- website/versioned_docs/version-v1.x/cli.md | 44 +++++++-------- 14 files changed, 128 insertions(+), 128 deletions(-) diff --git a/cli/tests/ceremony-params/ceremonyParams.test.ts b/cli/tests/ceremony-params/ceremonyParams.test.ts index 5e1a097b0b..44422c0b90 100644 --- a/cli/tests/ceremony-params/ceremonyParams.test.ts +++ b/cli/tests/ceremony-params/ceremonyParams.test.ts @@ -159,7 +159,7 @@ describe("Stress tests with ceremony params (6,9,2,3)", function test() { voteOptionIndex: randomVoteOption, nonce: 1n, newVoteWeight: randomVoteWeight, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[0].privKey.serialize(), pollId: 0n, @@ -211,7 +211,7 @@ describe("Stress tests with ceremony params (6,9,2,3)", function test() { nonce: 1n, pollId: 0n, newVoteWeight: randomVoteWeight, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[i].privKey.serialize(), signer, @@ -283,7 +283,7 @@ describe("Stress tests with ceremony params (6,9,2,3)", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[0].privKey.serialize(), signer, @@ -339,7 +339,7 @@ describe("Stress tests with ceremony params (6,9,2,3)", function test() { nonce: 1n, pollId: 0n, newVoteWeight: randomVoteWeight, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[i].privKey.serialize(), signer, diff --git a/cli/tests/e2e/e2e.nonQv.test.ts b/cli/tests/e2e/e2e.nonQv.test.ts index 04a34a83fd..b93f399ad6 100644 --- a/cli/tests/e2e/e2e.nonQv.test.ts +++ b/cli/tests/e2e/e2e.nonQv.test.ts @@ -108,7 +108,7 @@ describe("e2e tests with non quadratic voting", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: user.privKey.serialize(), signer, diff --git a/cli/tests/e2e/e2e.subsidy.test.ts b/cli/tests/e2e/e2e.subsidy.test.ts index 2f6f5c7f45..8c340de582 100644 --- a/cli/tests/e2e/e2e.subsidy.test.ts +++ b/cli/tests/e2e/e2e.subsidy.test.ts @@ -117,7 +117,7 @@ describe("e2e with Subsidy tests", function test() { it("should publish six messages", async () => { await publish({ - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, pubkey: users[0].pubKey.serialize(), stateIndex: 1n, voteOptionIndex: 0n, @@ -130,7 +130,7 @@ describe("e2e with Subsidy tests", function test() { }); await publish({ - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, pubkey: users[1].pubKey.serialize(), stateIndex: 2n, voteOptionIndex: 1n, @@ -143,7 +143,7 @@ describe("e2e with Subsidy tests", function test() { }); await publish({ - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, pubkey: users[2].pubKey.serialize(), stateIndex: 3n, voteOptionIndex: 2n, @@ -156,7 +156,7 @@ describe("e2e with Subsidy tests", function test() { }); await publish({ - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, pubkey: users[3].pubKey.serialize(), stateIndex: 4n, voteOptionIndex: 3n, @@ -169,7 +169,7 @@ describe("e2e with Subsidy tests", function test() { }); await publish({ - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, pubkey: users[3].pubKey.serialize(), stateIndex: 4n, voteOptionIndex: 3n, @@ -182,7 +182,7 @@ describe("e2e with Subsidy tests", function test() { }); await publish({ - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, pubkey: users[3].pubKey.serialize(), stateIndex: 4n, voteOptionIndex: 3n, @@ -245,7 +245,7 @@ describe("e2e with Subsidy tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[0].privKey.serialize(), signer, @@ -293,7 +293,7 @@ describe("e2e with Subsidy tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: user.privKey.serialize(), signer, @@ -350,7 +350,7 @@ describe("e2e with Subsidy tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[0].privKey.serialize(), signer, @@ -380,7 +380,7 @@ describe("e2e with Subsidy tests", function test() { nonce: 1n, pollId: 1n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[0].privKey.serialize(), signer, @@ -393,7 +393,7 @@ describe("e2e with Subsidy tests", function test() { nonce: 1n, pollId: 1n, newVoteWeight: 1n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[1].privKey.serialize(), signer, @@ -406,7 +406,7 @@ describe("e2e with Subsidy tests", function test() { nonce: 1n, pollId: 1n, newVoteWeight: 3n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[2].privKey.serialize(), signer, @@ -421,7 +421,7 @@ describe("e2e with Subsidy tests", function test() { nonce: 1n, pollId: 2n, newVoteWeight: 3n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[3].privKey.serialize(), signer, @@ -434,7 +434,7 @@ describe("e2e with Subsidy tests", function test() { nonce: 1n, pollId: 2n, newVoteWeight: 2n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[4].privKey.serialize(), signer, @@ -447,7 +447,7 @@ describe("e2e with Subsidy tests", function test() { nonce: 1n, pollId: 2n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[5].privKey.serialize(), signer, diff --git a/cli/tests/e2e/e2e.test.ts b/cli/tests/e2e/e2e.test.ts index 2803a9787a..381aa3d8a0 100644 --- a/cli/tests/e2e/e2e.test.ts +++ b/cli/tests/e2e/e2e.test.ts @@ -126,7 +126,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: user.privKey.serialize(), signer, @@ -173,7 +173,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: user.privKey.serialize(), signer, @@ -227,7 +227,7 @@ describe("e2e tests", function test() { nonce: 2n, pollId: 0n, newVoteWeight: 4n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[0].privKey.serialize(), signer, @@ -239,7 +239,7 @@ describe("e2e tests", function test() { nonce: 2n, pollId: 0n, newVoteWeight: 3n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[0].privKey.serialize(), signer, @@ -251,7 +251,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[0].privKey.serialize(), signer, @@ -263,7 +263,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[1].privKey.serialize(), signer, @@ -275,7 +275,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[2].privKey.serialize(), signer, @@ -287,7 +287,7 @@ describe("e2e tests", function test() { nonce: 3n, pollId: 0n, newVoteWeight: 3n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[3].privKey.serialize(), signer, @@ -299,7 +299,7 @@ describe("e2e tests", function test() { nonce: 2n, pollId: 0n, newVoteWeight: 2n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[3].privKey.serialize(), signer, @@ -311,7 +311,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[3].privKey.serialize(), signer, @@ -368,7 +368,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[0].privKey.serialize(), signer, @@ -416,7 +416,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: user.privKey.serialize(), signer, @@ -459,7 +459,7 @@ describe("e2e tests", function test() { it("should publish 4 messages", async () => { // publish four different messages await publish({ - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, pubkey: users[0].pubKey.serialize(), stateIndex: 1n, voteOptionIndex: 0n, @@ -472,7 +472,7 @@ describe("e2e tests", function test() { }); await publish({ - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, pubkey: users[1].pubKey.serialize(), stateIndex: 2n, voteOptionIndex: 1n, @@ -485,7 +485,7 @@ describe("e2e tests", function test() { }); await publish({ - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, pubkey: users[2].pubKey.serialize(), stateIndex: 3n, voteOptionIndex: 2n, @@ -498,7 +498,7 @@ describe("e2e tests", function test() { }); await publish({ - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, pubkey: users[3].pubKey.serialize(), stateIndex: 4n, voteOptionIndex: 3n, @@ -553,7 +553,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: user.privKey.serialize(), signer, @@ -581,7 +581,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 1n, newVoteWeight: 7n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: user.privKey.serialize(), signer, @@ -649,7 +649,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[0].privKey.serialize(), signer, @@ -680,7 +680,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 1n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[0].privKey.serialize(), signer, @@ -693,7 +693,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 1n, newVoteWeight: 1n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[1].privKey.serialize(), signer, @@ -706,7 +706,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 1n, newVoteWeight: 3n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[2].privKey.serialize(), signer, @@ -721,7 +721,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 2n, newVoteWeight: 3n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[3].privKey.serialize(), signer, @@ -734,7 +734,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 2n, newVoteWeight: 2n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[4].privKey.serialize(), signer, @@ -747,7 +747,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 2n, newVoteWeight: 9n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: users[5].privKey.serialize(), signer, @@ -833,7 +833,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 3n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: user.privKey.serialize(), signer, @@ -913,7 +913,7 @@ describe("e2e tests", function test() { nonce: 1n, pollId: 0n, newVoteWeight: 3n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: user.privKey.serialize(), signer, diff --git a/cli/tests/e2e/keyChange.test.ts b/cli/tests/e2e/keyChange.test.ts index 795993d8d5..65f030a296 100644 --- a/cli/tests/e2e/keyChange.test.ts +++ b/cli/tests/e2e/keyChange.test.ts @@ -115,7 +115,7 @@ describe("keyChange tests", function test() { nonce: initialNonce, pollId, newVoteWeight: initialVoteAmount, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: keypair1.privKey.serialize(), signer, @@ -130,7 +130,7 @@ describe("keyChange tests", function test() { nonce: initialNonce, pollId, newVoteWeight: initialVoteAmount - 1n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: keypair1.privKey.serialize(), signer, @@ -185,7 +185,7 @@ describe("keyChange tests", function test() { nonce: initialNonce, pollId, newVoteWeight: initialVoteAmount, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: keypair1.privKey.serialize(), signer, @@ -200,7 +200,7 @@ describe("keyChange tests", function test() { nonce: initialNonce + 1n, pollId, newVoteWeight: initialVoteAmount - 1n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: keypair1.privKey.serialize(), signer, @@ -255,7 +255,7 @@ describe("keyChange tests", function test() { nonce: initialNonce, pollId, newVoteWeight: initialVoteAmount, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: keypair1.privKey.serialize(), signer, @@ -270,7 +270,7 @@ describe("keyChange tests", function test() { nonce: initialNonce, pollId, newVoteWeight: initialVoteAmount - 3n, - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, salt: genRandomSalt(), privateKey: keypair1.privKey.serialize(), signer, diff --git a/cli/tests/unit/publish.test.ts b/cli/tests/unit/publish.test.ts index d7ceeab160..1ba9a6601c 100644 --- a/cli/tests/unit/publish.test.ts +++ b/cli/tests/unit/publish.test.ts @@ -60,7 +60,7 @@ describe("publish", () => { pollAddresses = await deployPoll({ ...deployPollArgs, signer }); defaultArgs = { - maciContractAddress: maciAddresses.maciAddress, + maciAddress: maciAddresses.maciAddress, publicKey: user.pubKey.serialize(), privateKey: user.privKey.serialize(), messages, diff --git a/cli/ts/commands/genLocalState.ts b/cli/ts/commands/genLocalState.ts index feeb1cbf6e..535ec5b9bf 100644 --- a/cli/ts/commands/genLocalState.ts +++ b/cli/ts/commands/genLocalState.ts @@ -29,7 +29,7 @@ import { export const genLocalState = async ({ outputPath, pollId, - maciContractAddress, + maciAddress, coordinatorPrivateKey, ethereumProvider, endBlock, @@ -45,13 +45,13 @@ export const genLocalState = async ({ const network = await signer.provider?.getNetwork(); // validation of the maci contract address - if (!readContractAddress("MACI", network?.name) && !maciContractAddress) { + if (!readContractAddress("MACI", network?.name) && !maciAddress) { logError("MACI contract address is empty"); } - const maciAddress = maciContractAddress || readContractAddress("MACI", network?.name); + const maciContractAddress = maciAddress || readContractAddress("MACI", network?.name); - if (!(await contractExists(signer.provider!, maciAddress))) { + if (!(await contractExists(signer.provider!, maciContractAddress))) { logError("MACI contract does not exist"); } @@ -64,7 +64,7 @@ export const genLocalState = async ({ const coordinatorMaciPrivKey = PrivKey.deserialize(coordPrivKey); const coordinatorKeypair = new Keypair(coordinatorMaciPrivKey); - const maciContract = MACIFactory.connect(maciAddress, signer); + const maciContract = MACIFactory.connect(maciContractAddress, signer); const pollAddr = await maciContract.polls(pollId); if (!(await contractExists(signer.provider!, pollAddr))) { @@ -121,7 +121,7 @@ export const genLocalState = async ({ const maciState = await genMaciStateFromContract( provider!, - maciAddress, + maciContractAddress, coordinatorKeypair, pollId, fromBlock, diff --git a/cli/ts/commands/mergeMessages.ts b/cli/ts/commands/mergeMessages.ts index de129ba655..c84cb02963 100644 --- a/cli/ts/commands/mergeMessages.ts +++ b/cli/ts/commands/mergeMessages.ts @@ -25,7 +25,7 @@ import { export const mergeMessages = async ({ pollId, quiet = true, - maciContractAddress, + maciAddress, numQueueOps, signer, }: MergeMessagesArgs): Promise => { @@ -33,11 +33,11 @@ export const mergeMessages = async ({ const network = await signer.provider?.getNetwork(); // maci contract validation - if (!readContractAddress("MACI", network?.name) && !maciContractAddress) { + if (!readContractAddress("MACI", network?.name) && !maciAddress) { logError("Could not read contracts"); } - const maciAddress = maciContractAddress || readContractAddress("MACI", network?.name); - if (!(await contractExists(signer.provider!, maciAddress))) { + const maciContractAddress = maciAddress || readContractAddress("MACI", network?.name); + if (!(await contractExists(signer.provider!, maciContractAddress))) { logError("MACI contract does not exist"); } @@ -45,7 +45,7 @@ export const mergeMessages = async ({ logError("Invalid poll id"); } - const maciContract = MACIFactory.connect(maciAddress, signer); + const maciContract = MACIFactory.connect(maciContractAddress, signer); const pollAddress = await maciContract.polls(pollId); if (!(await contractExists(signer.provider!, pollAddress))) { diff --git a/cli/ts/commands/mergeSignups.ts b/cli/ts/commands/mergeSignups.ts index 7da886fe55..2ee2709ed1 100644 --- a/cli/ts/commands/mergeSignups.ts +++ b/cli/ts/commands/mergeSignups.ts @@ -24,7 +24,7 @@ import { */ export const mergeSignups = async ({ pollId, - maciContractAddress, + maciAddress, numQueueOps, signer, quiet = true, @@ -33,13 +33,13 @@ export const mergeSignups = async ({ const network = await signer.provider?.getNetwork(); // maci contract validation - if (!readContractAddress("MACI", network?.name) && !maciContractAddress) { + if (!readContractAddress("MACI", network?.name) && !maciAddress) { logError("Could not read contracts"); } - const maciAddress = maciContractAddress || readContractAddress("MACI", network?.name); + const maciContractAddress = maciAddress || readContractAddress("MACI", network?.name); - if (!(await contractExists(signer.provider!, maciAddress))) { + if (!(await contractExists(signer.provider!, maciContractAddress))) { logError("MACI contract does not exist"); } @@ -47,7 +47,7 @@ export const mergeSignups = async ({ logError("Invalid poll id"); } - const maciContract = MACIFactory.connect(maciAddress, signer); + const maciContract = MACIFactory.connect(maciContractAddress, signer); const pollAddress = await maciContract.polls(pollId); if (!(await contractExists(signer.provider!, pollAddress))) { diff --git a/cli/ts/commands/publish.ts b/cli/ts/commands/publish.ts index a9fbceda28..ac2599f260 100644 --- a/cli/ts/commands/publish.ts +++ b/cli/ts/commands/publish.ts @@ -28,7 +28,7 @@ export const publish = async ({ nonce, pollId, newVoteWeight, - maciContractAddress, + maciAddress, salt, privateKey, signer, @@ -43,7 +43,7 @@ export const publish = async ({ // deserialize const userMaciPubKey = PubKey.deserialize(pubkey); - if (!(await contractExists(signer.provider!, maciContractAddress))) { + if (!(await contractExists(signer.provider!, maciAddress))) { logError("MACI contract does not exist"); } @@ -77,7 +77,7 @@ export const publish = async ({ logError("Invalid poll id"); } - const maciContract = MACIFactory.connect(maciContractAddress, signer); + const maciContract = MACIFactory.connect(maciAddress, signer); const pollAddress = await maciContract.getPoll(pollId); if (!(await contractExists(signer.provider!, pollAddress))) { @@ -145,7 +145,7 @@ export const publish = async ({ export const publishBatch = async ({ messages, pollId, - maciContractAddress, + maciAddress, publicKey, privateKey, signer, @@ -167,7 +167,7 @@ export const publishBatch = async ({ const userMaciPubKey = PubKey.deserialize(publicKey); const userMaciPrivKey = PrivKey.deserialize(privateKey); - const maciContract = MACIFactory.connect(maciContractAddress, signer); + const maciContract = MACIFactory.connect(maciAddress, signer); const pollAddress = await maciContract.getPoll(pollId); const pollContract = PollFactory.connect(pollAddress, signer); diff --git a/cli/ts/index.ts b/cli/ts/index.ts index deb8d0842b..46429419f1 100644 --- a/cli/ts/index.ts +++ b/cli/ts/index.ts @@ -148,7 +148,7 @@ program .command("airdrop") .description("airdrop topup credits to the coordinator") .requiredOption("-a, --amount ", "the amount of topup", parseInt) - .option("-x, --contract ", "the MACI contract address") + .option("-x, --maci-address ", "the MACI contract address") .option("-o, --poll-id ", "poll id", BigInt) .option("-t, --token-address ", "the token address") .option("-q, --quiet ", "whether to print values to the console", (value) => value === "true", false) @@ -159,7 +159,7 @@ program await airdrop({ amount: cmdObj.amount, - maciAddress: cmdObj.contract, + maciAddress: cmdObj.maciAddress, pollId: cmdObj.pollId, contractAddress: cmdObj.tokenAddress, quiet: cmdObj.quiet, @@ -286,7 +286,7 @@ program "-p, --pubkey ", "the MACI public key which should replace the user's public key in the state tree", ) - .option("-x, --contract ", "the MACI contract address") + .option("-x, --maci-address ", "the MACI contract address") .option("-sk, --privkey ", "your serialized MACI private key") .requiredOption("-i, --state-index ", "the user's state index", BigInt) .requiredOption("-v, --vote-option-index ", "the vote option index", BigInt) @@ -301,7 +301,7 @@ program const signer = await getSigner(); const network = await signer.provider?.getNetwork(); - const maciContractAddress = cmdObj.contract || readContractAddress("MACI", network?.name); + const maciAddress = cmdObj.maciAddress || readContractAddress("MACI", network?.name); const privateKey = cmdObj.privkey || (await promptSensitiveValue("Insert your MACI private key")); await publish({ @@ -311,7 +311,7 @@ program nonce: cmdObj.nonce, pollId: cmdObj.pollId, newVoteWeight: cmdObj.newVoteWeight, - maciContractAddress, + maciAddress, salt: cmdObj.salt, privateKey, quiet: cmdObj.quiet, @@ -326,7 +326,7 @@ program .description("merge the message accumulator queue") .option("-q, --quiet ", "whether to print values to the console", (value) => value === "true", false) .option("-r, --rpc-provider ", "the rpc provider URL") - .option("-x, --maci-contract-address ", "the MACI contract address") + .option("-x, --maci-address ", "the MACI contract address") .requiredOption("-o, --poll-id ", "the poll id", BigInt) .option("-n, --num-queue-ops ", "the number of queue operations", parseInt) .action(async (cmdObj) => { @@ -335,7 +335,7 @@ program await mergeMessages({ pollId: cmdObj.pollId, - maciContractAddress: cmdObj.maciContractAddress, + maciAddress: cmdObj.maciAddress, numQueueOps: cmdObj.numQueueOps?.toString(), quiet: cmdObj.quiet, signer, @@ -349,7 +349,7 @@ program .description("merge the signups accumulator queue") .option("-q, --quiet ", "whether to print values to the console", (value) => value === "true", false) .option("-r, --rpc-provider ", "the rpc provider URL") - .option("-x, --maci-contract-address ", "the MACI contract address") + .option("-x, --maci-address ", "the MACI contract address") .requiredOption("-o, --poll-id ", "the poll id", BigInt) .option("-n, --num-queue-ops ", "the number of queue operations", parseInt) .action(async (cmdObj) => { @@ -358,7 +358,7 @@ program await mergeSignups({ pollId: cmdObj.pollId, - maciContractAddress: cmdObj.maciContractAddress, + maciAddress: cmdObj.maciAddress, numQueueOps: cmdObj.numQueueOps?.toString(), quiet: cmdObj.quiet, signer, @@ -396,11 +396,11 @@ program const signer = await getSigner(); const network = await signer.provider?.getNetwork(); - const maciContractAddress = cmdObj.maciAddress || readContractAddress("MACI", network?.name); + const maciAddress = cmdObj.maciAddress || readContractAddress("MACI", network?.name); await signup({ maciPubKey: cmdObj.pubkey, - maciAddress: maciContractAddress, + maciAddress, sgDataArg: cmdObj.sgData, ivcpDataArg: cmdObj.ivcpData, quiet: cmdObj.quiet, @@ -421,11 +421,11 @@ program const signer = await getSigner(); const network = await signer.provider?.getNetwork(); - const maciContractAddress = cmdObj.maciAddress || readContractAddress("MACI", network?.name); + const maciAddress = cmdObj.maciAddress || readContractAddress("MACI", network?.name); await isRegisteredUser({ maciPubKey: cmdObj.pubkey, - maciAddress: maciContractAddress, + maciAddress, signer, quiet: cmdObj.quiet, }); @@ -444,11 +444,11 @@ program const signer = await getSigner(); const network = await signer.provider?.getNetwork(); - const maciContractAddress = cmdObj.maciAddress || readContractAddress("MACI", network?.name); + const maciAddress = cmdObj.maciAddress || readContractAddress("MACI", network?.name); await getPoll({ pollId: cmdObj.poll, - maciAddress: maciContractAddress, + maciAddress, signer, quiet: cmdObj.quiet, }); @@ -512,7 +512,7 @@ program false, ) .option("-s, --subsidy-file ", "the subsidy file") - .option("-x, --contract ", "the MACI contract address") + .option("-x, --maci-address ", "the MACI contract address") .option("-tc, --tally-contract ", "the tally contract address") .option("-sc, --subsidy-contract ", "the subsidy contract address") .option("-q, --quiet ", "whether to print values to the console", (value) => value === "true", false) @@ -529,7 +529,7 @@ program const tallyData = JSON.parse(fs.readFileSync(cmdObj.tallyFile, { encoding: "utf8" })) as TallyData; - const maciAddress = tallyData.maci || cmdObj.contract || readContractAddress("MACI", network?.name); + const maciAddress = tallyData.maci || cmdObj.maciAddress || readContractAddress("MACI", network?.name); const subsidyAddress = cmdObj.subsidyContract || readContractAddress(`Subsidy-${cmdObj.pollId}`, network?.name); const tallyAddress = tallyData.tallyAddress || cmdObj.tallyContract || readContractAddress(`Tally-${cmdObj.pollId}`, network?.name); @@ -562,7 +562,7 @@ program .command("genProofs") .description("generate the proofs for a poll") .option("-sk, --privkey ", "your serialized MACI private key") - .option("-x, --contract ", "the MACI contract address") + .option("-x, --maci-address ", "the MACI contract address") .requiredOption("-o, --poll-id ", "the poll id", BigInt) .requiredOption( "-t, --tally-file ", @@ -613,7 +613,7 @@ program subsidyWitgen: cmdObj.subsidyWitnessgen, subsidyDatFile: cmdObj.subsidyWitnessdat, coordinatorPrivKey: cmdObj.privkey, - maciAddress: cmdObj.contract, + maciAddress: cmdObj.maciAddress, transactionHash: cmdObj.transactionHash, processWasm: cmdObj.processWasm, tallyWasm: cmdObj.tallyWasm, @@ -637,7 +637,7 @@ program .description("generate a local MACI state from the smart contracts events") .requiredOption("-o, --output ", "the path where to write the state") .requiredOption("-p, --poll-id ", "the id of the poll", BigInt) - .option("-x, --contract ", "the MACI contract address") + .option("-x, --maci-address ", "the MACI contract address") .option("-sk, --privkey ", "your serialized MACI private key") .option("-eb, --end-block ", "the end block number", parseInt) .option("-sb, --start-block ", "the start block number", parseInt) @@ -653,7 +653,7 @@ program await genLocalState({ outputPath: cmdObj.output.toString(), pollId: cmdObj.pollId, - maciContractAddress: cmdObj.contract, + maciAddress: cmdObj.maciAddress, coordinatorPrivateKey: cmdObj.privkey, ethereumProvider: cmdObj.rpcProvider, endBlock: cmdObj.endBlock, @@ -680,7 +680,7 @@ program ) .option("-q, --quiet ", "whether to print values to the console", (value) => value === "true", false) .option("-r, --rpc-provider ", "the rpc provider URL") - .option("-x, --contract ", "the MACI contract address") + .option("-x, --maci-address ", "the MACI contract address") .option("-p, --message-processor-address ", "the message processor contract address") .option("-t, --tally-contract ", "the tally contract address") .option("-s, --subsidy-contract ", "the subsidy contract address") @@ -693,7 +693,7 @@ program pollId: cmdObj.pollId, proofDir: cmdObj.proofDir, subsidyEnabled: cmdObj.subsidyEnabled, - maciAddress: cmdObj.contract, + maciAddress: cmdObj.maciAddress, messageProcessorAddress: cmdObj.messageProcessorAddress, tallyAddress: cmdObj.tallyContract, subsidyAddress: cmdObj.subsidyContract, diff --git a/cli/ts/utils/interfaces.ts b/cli/ts/utils/interfaces.ts index 5fb7db3acf..9067276793 100644 --- a/cli/ts/utils/interfaces.ts +++ b/cli/ts/utils/interfaces.ts @@ -402,7 +402,7 @@ export interface GenLocalStateArgs { /** * The address of the MACI contract */ - maciContractAddress?: string; + maciAddress?: string; /** * The private key of the MACI coordinator @@ -617,7 +617,7 @@ export interface MergeMessagesArgs { /** * The address of the MACI contract */ - maciContractAddress?: string; + maciAddress?: string; /** * The number of queue operations to merge @@ -642,7 +642,7 @@ export interface MergeSignupsArgs { /** * The address of the MACI contract */ - maciContractAddress?: string; + maciAddress?: string; /** * The number of queue operations to perform @@ -722,7 +722,7 @@ export interface PublishArgs extends IPublishMessage { /** * The address of the MACI contract */ - maciContractAddress: string; + maciAddress: string; /** * The id of the poll @@ -757,7 +757,7 @@ export interface IPublishBatchArgs { /** * The address of the MACI contract */ - maciContractAddress: string; + maciAddress: string; /** * The public key of the user diff --git a/integrationTests/ts/__tests__/integration.test.ts b/integrationTests/ts/__tests__/integration.test.ts index bc4bc5c855..0e9b4d854d 100644 --- a/integrationTests/ts/__tests__/integration.test.ts +++ b/integrationTests/ts/__tests__/integration.test.ts @@ -222,7 +222,7 @@ describe("Integration tests", function test() { nonce, pollId, newVoteWeight: newVoteWeight!, - maciContractAddress: contracts.maciAddress, + maciAddress: contracts.maciAddress, salt, // if it's a key change command, then we pass the old private key otherwise just pass the current privateKey: isKeyChange ? oldKeypair.privKey.serialize() : user.keypair.privKey.serialize(), @@ -252,12 +252,12 @@ describe("Integration tests", function test() { // merge messages await expect( - mergeMessages({ pollId, maciContractAddress: contracts.maciAddress, signer }), + mergeMessages({ pollId, maciAddress: contracts.maciAddress, signer }), ).to.eventually.not.be.rejectedWith(); // merge signups await expect( - mergeSignups({ pollId, maciContractAddress: contracts.maciAddress, signer }), + mergeSignups({ pollId, maciAddress: contracts.maciAddress, signer }), ).to.eventually.not.be.rejectedWith(); // generate proofs diff --git a/website/versioned_docs/version-v1.x/cli.md b/website/versioned_docs/version-v1.x/cli.md index 9112969b62..41da8b1499 100644 --- a/website/versioned_docs/version-v1.x/cli.md +++ b/website/versioned_docs/version-v1.x/cli.md @@ -27,28 +27,28 @@ pnpm run hardhat ## Subcommands -| Command | Description | Options | -| -------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `create` | Deploy the contracts | `-i, --initialVoiceCredits `: The initial voice credits
`-p, --initialVoiceCreditsProxyAddress `: The initial voice credits proxy contract address
`-g, --signupGatekeeperAddress `: The signup gatekeeper contract address
`-ph3, --poseidonT3Address `: The PoseidonT3 contract address
`-ph4, --poseidonT4Address `: The PoseidonT4 contract address
`-ph5, --poseidonT5Address `: The PoseidonT5 contract address
`-ph6, --poseidonT6Address `: The PoseidonT6 contract address
`-q, --quiet`: Whether to print values to the console
`-s, --stateTreeDepth `: The state tree depth
`-uq, --use-quadratic-voting"`: Whether to use quadratic voting
`-r, --rpc-provider `: The rpc provider URL | -| `checkVerifyingKeys` | Check that the verifying keys in the contract match the local ones | `-q, --quiet`: Whether to print values to the console
`-vk, --vk-contract `: The VkRegistry contract address
`-s, --state-tree-depth `: The state tree depth
`-i, --int-state-tree-depth `: The intermediate state tree depth
`-m, --msg-tree-depth `: The message tree depth
`-v, --vote-option-tree-depth `: The vote option tree depth
`-b, --msg-batch-depth `: The message batch depth
`-p, --process-messages-zkey `: The process messages zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-t, --tally-votes-zkey `: The tally votes zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-ss, --subsidy-zkey `: The subsidy zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)) | -| `genMaciPubKey` | Generate a new MACI public key | `-sk, --privkey `: The private key | -| `genMaciKeyPair` | Generate a new MACI key pair | `-sp, --seed seed value for keypair` | -| `airdrop` | Airdrop topup credits to the coordinator | `-a, --amount `: The amount of topup
`-x, --contract `: The MACI contract address
`-o, --poll-id `: Poll id
`-t, --token-address `: The token address
`-q, --quiet`: Whether to print values to the console | -| `deployVkRegistry` | Deploy a new verification key registry contract | `-q, --quiet`: Whether to print values to the console | -| `show` | Show the deployed contract addresses | No options | -| `deployPoll` | Deploy a new poll | `-t, --duration `: The poll duration
`-i, --int-state-tree-depth `: The int state tree depth
`-b, --msg-batch-depth `: The message tree sub depth
`-m, --msg-tree-depth `: The message tree depth
`-v, --vote-option-tree-depth `: The vote option tree depth
`-pk, --pubkey `: The coordinator public key
`-x, --maci-address `: The MACI contract address
`-q, --quiet`: Whether to print values to the console
"-vk, `--vkRegistryAddress `: The vk registry contract address | -| `setVerifyingKeys` | Set the verifying keys | `-s, --state-tree-depth `: The state tree depth
`-i, --int-state-tree-depth `: The intermediate state tree depth
`-m, --msg-tree-depth `: The message tree depth
`-v, --vote-option-tree-depth `: The vote option tree depth
`-b, --msg-batch-depth `: The message batch depth
`-p, --process-messages-zkey `: The process messages zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-t, --tally-votes-zkey `: The tally votes zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-k, --vk-registry `: The vk registry contract address
`-q, --quiet`: Whether to print values to the console
`-ss, --subsidy-zkey `: The subsidy zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)) | -| `publish` | Publish a new message to a MACI Poll contract | `-p, --pubkey `: The MACI public key which should replace the user's public key in the state tree
`-x, --contract `: The MACI contract address
`-sk, --privkey `: Your serialized MACI private key
`-i, --state-index `: The user's state index
`-v, --vote-option-index `: The vote option index
`-n, --nonce `: The message nonce
`-s, --salt `: The message salt
`-o, --poll-id `: The poll id
`-w, --new-vote-weight `: The new vote weight
`-q, --quiet`: Whether to print values to the console | -| `mergeMessages` | Merge the message accumulator queue | `-q, --quiet`: Whether to print values to the console
`-x, --maci-contract-address `: The MACI contract address
`-o, --poll-id `: The poll id
`-n, --num-queue-ops `: The number of queue operations | -| `mergeSignups` | Merge the signups accumulator queue | `-q, --quiet`: Whether to print values to the console
`-x, --maci-contract-address `: The MACI contract address
`-o, --poll-id `: The poll id
`-n, --num-queue-ops `: The number of queue operations | -| `timeTravel` | Fast-forward the time (only works for local hardhat testing) | `-s, --seconds `: The number of seconds to fast-forward
`-q, --quiet`: Whether to print values to the console | -| `signup` | Sign up to a MACI contract | `-p, --pubkey `: The MACI public key
`-x, --maci-address `: The MACI contract address
`-s, --sg-data `: The signup gateway data
`-i, --ivcp-data `: The initial voice credit proxy data
`-q, --quiet`: Whether to print values to the console | -| `isRegisteredUser` | Checks if user is registered with public key | `-p, --pubkey `: The MACI public key
`-x, --maci-address `: The MACI contract address
`-q, --quiet`: Whether to print values to the console | -| `topup` | Top up an account with voice credits | `-a, --amount `: The amount of topup
`-x, --maci-address `: The MACI contract address
`-i, --state-index `: State leaf index
`-o, --poll-id `: Poll id
`-q, --quiet`: Whether to print values to the console | -| `fundWallet` | Fund a wallet with Ether | `-a, --amount `: The amount of Ether
`-w, --address
`: The address to fund
`-q, --quiet`: Whether to print values to the console | -| `verify` | Verify the results of a poll and optionally the subsidy results on-chain | `-o, --poll-id `: The poll id
`-t, --tally-file `: The tally file with results, per vote option spent credits, spent voice credits total
`-s, --subsidy-file `: The subsidy file
`-x, --contract `: The MACI contract address
`-tc, --tally-contract `: The tally contract address
`-sc, --subsidy-contract `: The subsidy contract address
`-q, --quiet`: Whether to print values to the console | -| `genProofs` | Generate the proofs for a poll | `-sk, --privkey `: Your serialized MACI private key
`-x, --contract `: The MACI contract address
`-o, --poll-id `: The poll id
`-t, --tally-file `: The tally file
`-s, --subsidy-file `: The subsidy file
`-r, --rapidsnark `: The path to the rapidsnark binary
`-wp, --process-witnessgen `: The path to the process witness generation binary
`-wt, --tally-witnessgen `: The path to the tally witness generation binary
`-ws, --subsidy-witnessgen `: The path to the subsidy witness generation binary
`-zp, --process-zkey `-zt, --tally-zkey `: The path to the tally zkey
`-zs, --subsidy-zkey `: The path to the subsidy zkey
`-q, --quiet`: Whether to print values to the console
`-f, --output `: The output directory for proofs
`-tx, --transaction-hash :` Transaction hash of MACI contract creation
`-w, --wasm`: Whether to use the wasm binaries
`-pw, --process-wasm `: The path to the process witness generation wasm binary
`-tw, --tally-wasm `: The path to the tally witness generation wasm binary
`-sw, --subsidy-wasm `: The path to the subsidy witness generation wasm binary
`-uq, --use-quadratic-voting`: Whether to process messages and tally votes using quadratic voting or not | -| `proveOnChain` | Prove the results of a poll on chain | `-o, --poll-id `: The poll id
`-q, --quiet`: Whether to print values to the console
`-x, --contract `: The MACI contract address
`-p, --message-processor-address `: The message processor contract address
`-t, --tally-contract `: The tally contract address
`-s, --subsidy-contract `: The subsidy contract address
`-f, --proof-dir `: The proof output directory from the genProofs subcommand | +| Command | Description | Options | +| -------------------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `create` | Deploy the contracts | `-i, --initialVoiceCredits `: The initial voice credits
`-p, --initialVoiceCreditsProxyAddress `: The initial voice credits proxy contract address
`-g, --signupGatekeeperAddress `: The signup gatekeeper contract address
`-ph3, --poseidonT3Address `: The PoseidonT3 contract address
`-ph4, --poseidonT4Address `: The PoseidonT4 contract address
`-ph5, --poseidonT5Address `: The PoseidonT5 contract address
`-ph6, --poseidonT6Address `: The PoseidonT6 contract address
`-q, --quiet`: Whether to print values to the console
`-s, --stateTreeDepth `: The state tree depth
`-uq, --use-quadratic-voting"`: Whether to use quadratic voting
`-r, --rpc-provider `: The rpc provider URL | +| `checkVerifyingKeys` | Check that the verifying keys in the contract match the local ones | `-q, --quiet`: Whether to print values to the console
`-vk, --vk-contract `: The VkRegistry contract address
`-s, --state-tree-depth `: The state tree depth
`-i, --int-state-tree-depth `: The intermediate state tree depth
`-m, --msg-tree-depth `: The message tree depth
`-v, --vote-option-tree-depth `: The vote option tree depth
`-b, --msg-batch-depth `: The message batch depth
`-p, --process-messages-zkey `: The process messages zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-t, --tally-votes-zkey `: The tally votes zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-ss, --subsidy-zkey `: The subsidy zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)) | +| `genMaciPubKey` | Generate a new MACI public key | `-sk, --privkey `: The private key | +| `genMaciKeyPair` | Generate a new MACI key pair | `-sp, --seed seed value for keypair` | +| `airdrop` | Airdrop topup credits to the coordinator | `-a, --amount `: The amount of topup
`-x, --maci-address `: The MACI contract address
`-o, --poll-id `: Poll id
`-t, --token-address `: The token address
`-q, --quiet`: Whether to print values to the console | +| `deployVkRegistry` | Deploy a new verification key registry contract | `-q, --quiet`: Whether to print values to the console | +| `show` | Show the deployed contract addresses | No options | +| `deployPoll` | Deploy a new poll | `-t, --duration `: The poll duration
`-i, --int-state-tree-depth `: The int state tree depth
`-b, --msg-batch-depth `: The message tree sub depth
`-m, --msg-tree-depth `: The message tree depth
`-v, --vote-option-tree-depth `: The vote option tree depth
`-pk, --pubkey `: The coordinator public key
`-x, --maci-address `: The MACI contract address
`-q, --quiet`: Whether to print values to the console
"-vk, `--vkRegistryAddress `: The vk registry contract address | +| `setVerifyingKeys` | Set the verifying keys | `-s, --state-tree-depth `: The state tree depth
`-i, --int-state-tree-depth `: The intermediate state tree depth
`-m, --msg-tree-depth `: The message tree depth
`-v, --vote-option-tree-depth `: The vote option tree depth
`-b, --msg-batch-depth `: The message batch depth
`-p, --process-messages-zkey `: The process messages zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-t, --tally-votes-zkey `: The tally votes zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing))
`-k, --vk-registry `: The vk registry contract address
`-q, --quiet`: Whether to print values to the console
`-ss, --subsidy-zkey `: The subsidy zkey path (see different options to use specific circuits [Trusted setup](https://maci.pse.dev/docs/trusted-setup) or [Testing](https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing)) | +| `publish` | Publish a new message to a MACI Poll contract | `-p, --pubkey `: The MACI public key which should replace the user's public key in the state tree
`-x, --maci-address `: The MACI contract address
`-sk, --privkey `: Your serialized MACI private key
`-i, --state-index `: The user's state index
`-v, --vote-option-index `: The vote option index
`-n, --nonce `: The message nonce
`-s, --salt `: The message salt
`-o, --poll-id `: The poll id
`-w, --new-vote-weight `: The new vote weight
`-q, --quiet`: Whether to print values to the console | +| `mergeMessages` | Merge the message accumulator queue | `-q, --quiet`: Whether to print values to the console
`-x, --maci-address `: The MACI contract address
`-o, --poll-id `: The poll id
`-n, --num-queue-ops `: The number of queue operations | +| `mergeSignups` | Merge the signups accumulator queue | `-q, --quiet`: Whether to print values to the console
`-x, --maci-address `: The MACI contract address
`-o, --poll-id `: The poll id
`-n, --num-queue-ops `: The number of queue operations | +| `timeTravel` | Fast-forward the time (only works for local hardhat testing) | `-s, --seconds `: The number of seconds to fast-forward
`-q, --quiet`: Whether to print values to the console | +| `signup` | Sign up to a MACI contract | `-p, --pubkey `: The MACI public key
`-x, --maci-address `: The MACI contract address
`-s, --sg-data `: The signup gateway data
`-i, --ivcp-data `: The initial voice credit proxy data
`-q, --quiet`: Whether to print values to the console | +| `isRegisteredUser` | Checks if user is registered with public key | `-p, --pubkey `: The MACI public key
`-x, --maci-address `: The MACI contract address
`-q, --quiet`: Whether to print values to the console | +| `topup` | Top up an account with voice credits | `-a, --amount `: The amount of topup
`-x, --maci-address `: The MACI contract address
`-i, --state-index `: State leaf index
`-o, --poll-id `: Poll id
`-q, --quiet`: Whether to print values to the console | +| `fundWallet` | Fund a wallet with Ether | `-a, --amount `: The amount of Ether
`-w, --address
`: The address to fund
`-q, --quiet`: Whether to print values to the console | +| `verify` | Verify the results of a poll and optionally the subsidy results on-chain | `-o, --poll-id `: The poll id
`-t, --tally-file `: The tally file with results, per vote option spent credits, spent voice credits total
`-s, --subsidy-file `: The subsidy file
`-x, --maci-address `: The MACI contract address
`-tc, --tally-contract `: The tally contract address
`-sc, --subsidy-contract `: The subsidy contract address
`-q, --quiet`: Whether to print values to the console | +| `genProofs` | Generate the proofs for a poll | `-sk, --privkey `: Your serialized MACI private key
`-x, --maci-address `: The MACI contract address
`-o, --poll-id `: The poll id
`-t, --tally-file `: The tally file
`-s, --subsidy-file `: The subsidy file
`-r, --rapidsnark `: The path to the rapidsnark binary
`-wp, --process-witnessgen `: The path to the process witness generation binary
`-wt, --tally-witnessgen `: The path to the tally witness generation binary
`-ws, --subsidy-witnessgen `: The path to the subsidy witness generation binary
`-zp, --process-zkey `-zt, --tally-zkey `: The path to the tally zkey
`-zs, --subsidy-zkey `: The path to the subsidy zkey
`-q, --quiet`: Whether to print values to the console
`-f, --output `: The output directory for proofs
`-tx, --transaction-hash :` Transaction hash of MACI contract creation
`-w, --wasm`: Whether to use the wasm binaries
`-pw, --process-wasm `: The path to the process witness generation wasm binary
`-tw, --tally-wasm `: The path to the tally witness generation wasm binary
`-sw, --subsidy-wasm `: The path to the subsidy witness generation wasm binary
`-uq, --use-quadratic-voting`: Whether to process messages and tally votes using quadratic voting or not | +| `proveOnChain` | Prove the results of a poll on chain | `-o, --poll-id `: The poll id
`-q, --quiet`: Whether to print values to the console
`-x, --maci-address `: The MACI contract address
`-p, --message-processor-address `: The message processor contract address
`-t, --tally-contract `: The tally contract address
`-s, --subsidy-contract `: The subsidy contract address
`-f, --proof-dir `: The proof output directory from the genProofs subcommand | ## Public and private key format