From 98611cea39d51e5bcb745de7e8a00946c9abd32b Mon Sep 17 00:00:00 2001 From: yuetloo Date: Sat, 18 May 2024 21:17:56 -0400 Subject: [PATCH] update for MACI v1.2.2 interface change --- contracts/contracts/MACICommon.sol | 3 -- contracts/contracts/MACIFactory.sol | 1 - contracts/e2e/index.ts | 10 +---- .../tasks/helpers/ConstructorArguments.ts | 1 - contracts/tasks/runners/proveOnChain.ts | 1 - .../tasks/subtasks/clrfund/08-maciFactory.ts | 2 - contracts/utils/testutils.ts | 2 - subgraph/abis/MACIFactory.json | 42 ++++++++++--------- yarn.lock | 13 ------ 9 files changed, 24 insertions(+), 51 deletions(-) diff --git a/contracts/contracts/MACICommon.sol b/contracts/contracts/MACICommon.sol index 05762874e..f41843794 100644 --- a/contracts/contracts/MACICommon.sol +++ b/contracts/contracts/MACICommon.sol @@ -16,9 +16,6 @@ contract MACICommon { struct Factories { address pollFactory; address tallyFactory; - // subsidyFactory is not currently used, it's just a place holder here - address subsidyFactory; address messageProcessorFactory; } - } \ No newline at end of file diff --git a/contracts/contracts/MACIFactory.sol b/contracts/contracts/MACIFactory.sol index 2bccc4655..16a6f6e48 100644 --- a/contracts/contracts/MACIFactory.sol +++ b/contracts/contracts/MACIFactory.sol @@ -41,7 +41,6 @@ contract MACIFactory is Ownable(msg.sender), Params, SnarkCommon, DomainObjs, MA error InvalidVkRegistry(); error InvalidPollFactory(); error InvalidTallyFactory(); - error InvalidSubsidyFactory(); error InvalidMessageProcessorFactory(); error InvalidVerifier(); diff --git a/contracts/e2e/index.ts b/contracts/e2e/index.ts index f3ad49b7c..52d949abe 100644 --- a/contracts/e2e/index.ts +++ b/contracts/e2e/index.ts @@ -16,11 +16,7 @@ import { DEFAULT_GET_LOG_BATCH_SIZE, DEFAULT_SR_QUEUE_OPS, } from '../utils/constants' -import { - getContractAt, - getEventArg, - getQualifiedContractName, -} from '../utils/contracts' +import { getContractAt, getEventArg } from '../utils/contracts' import { deployPoseidonLibraries, deployMaciFactory } from '../utils/testutils' import { getIpfsHash } from '../utils/ipfs' import { @@ -37,7 +33,7 @@ import { DEFAULT_CIRCUIT } from '../utils/circuits' import { MaciParameters } from '../utils/maciParameters' import { existsSync, mkdirSync } from 'fs' import path from 'path' -import { FundingRound, Poll } from '../typechain-types' +import { FundingRound } from '../typechain-types' import { JSONFile } from '../utils/JSONFile' import { EContracts } from '../utils/types' import { getTalyFilePath } from '../utils/misc' @@ -398,7 +394,6 @@ describe('End-to-end Tests', function () { await proveOnChain({ pollId, proofDir: genProofArgs.outputDir, - subsidyEnabled: false, maciAddress, messageProcessorAddress, tallyAddress, @@ -418,7 +413,6 @@ describe('End-to-end Tests', function () { await proveOnChain({ pollId, proofDir: genProofArgs.outputDir, - subsidyEnabled: false, maciAddress, messageProcessorAddress, tallyAddress, diff --git a/contracts/tasks/helpers/ConstructorArguments.ts b/contracts/tasks/helpers/ConstructorArguments.ts index 751a8bbc4..3f77d336b 100644 --- a/contracts/tasks/helpers/ConstructorArguments.ts +++ b/contracts/tasks/helpers/ConstructorArguments.ts @@ -70,7 +70,6 @@ async function getMaciConstructorArguments( maci.pollFactory(), maci.messageProcessorFactory(), maci.tallyFactory(), - maci.subsidyFactory(), maci.signUpGatekeeper(), maci.initialVoiceCreditProxy(), maci.topupCredit(), diff --git a/contracts/tasks/runners/proveOnChain.ts b/contracts/tasks/runners/proveOnChain.ts index af777ed12..40946ba62 100644 --- a/contracts/tasks/runners/proveOnChain.ts +++ b/contracts/tasks/runners/proveOnChain.ts @@ -90,7 +90,6 @@ task('prove-on-chain', 'Prove on chain with the MACI proofs') await proveOnChain({ pollId, proofDir, - subsidyEnabled: false, maciAddress, messageProcessorAddress, tallyAddress, diff --git a/contracts/tasks/subtasks/clrfund/08-maciFactory.ts b/contracts/tasks/subtasks/clrfund/08-maciFactory.ts index cfaf146a6..c21c41817 100644 --- a/contracts/tasks/subtasks/clrfund/08-maciFactory.ts +++ b/contracts/tasks/subtasks/clrfund/08-maciFactory.ts @@ -48,8 +48,6 @@ subtask const factories = { pollFactory: pollFactoryContractAddress, tallyFactory: tallyFactoryContractAddress, - // subsidy is not currently used - subsidyFactory: ZERO_ADDRESS, messageProcessorFactory: messageProcessorFactoryContractAddress, } diff --git a/contracts/utils/testutils.ts b/contracts/utils/testutils.ts index e423421fd..8a306cf41 100644 --- a/contracts/utils/testutils.ts +++ b/contracts/utils/testutils.ts @@ -128,8 +128,6 @@ export async function deployMaciFactory({ const factories = { pollFactory: pollFactory.target, tallyFactory: tallyFactory.target, - // subsidy is not currently used - subsidyFactory: ZERO_ADDRESS, messageProcessorFactory: messageProcessorFactory.target, } diff --git a/subgraph/abis/MACIFactory.json b/subgraph/abis/MACIFactory.json index c8ab362b8..7f3ae7c07 100644 --- a/subgraph/abis/MACIFactory.json +++ b/subgraph/abis/MACIFactory.json @@ -18,11 +18,6 @@ "name": "tallyFactory", "type": "address" }, - { - "internalType": "address", - "name": "subsidyFactory", - "type": "address" - }, { "internalType": "address", "name": "messageProcessorFactory", @@ -52,11 +47,6 @@ "name": "InvalidPollFactory", "type": "error" }, - { - "inputs": [], - "name": "InvalidSubsidyFactory", - "type": "error" - }, { "inputs": [], "name": "InvalidTallyFactory", @@ -77,6 +67,28 @@ "name": "NotInitialized", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, { "inputs": [], "name": "ProcessVkNotSet", @@ -224,11 +236,6 @@ "internalType": "address", "name": "tally", "type": "address" - }, - { - "internalType": "address", - "name": "subsidy", - "type": "address" } ], "internalType": "struct MACI.PollContracts", @@ -253,11 +260,6 @@ "name": "tallyFactory", "type": "address" }, - { - "internalType": "address", - "name": "subsidyFactory", - "type": "address" - }, { "internalType": "address", "name": "messageProcessorFactory", diff --git a/yarn.lock b/yarn.lock index 2e8eb68ed..0f640e5d7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9912,19 +9912,6 @@ ethers@^5.0.3, ethers@^5.5.1, ethers@^5.7.2: "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" -ethers@^6.11.1: - version "6.11.1" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.11.1.tgz#96aae00b627c2e35f9b0a4d65c7ab658259ee6af" - integrity sha512-mxTAE6wqJQAbp5QAe/+o+rXOID7Nw91OZXvgpjDa1r4fAbq2Nu314oEZSbjoRLacuCzs7kUC3clEvkCQowffGg== - dependencies: - "@adraffy/ens-normalize" "1.10.1" - "@noble/curves" "1.2.0" - "@noble/hashes" "1.3.2" - "@types/node" "18.15.13" - aes-js "4.0.0-beta.5" - tslib "2.4.0" - ws "8.5.0" - ethers@^6.12.0, ethers@^6.12.1: version "6.12.1" resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.12.1.tgz#517ff6d66d4fd5433e38e903051da3e57c87ff37"