From fc7d2434b500222c45f13f8a586bda16727f869a Mon Sep 17 00:00:00 2001 From: yuetloo Date: Fri, 1 Dec 2023 00:33:10 -0500 Subject: [PATCH] rename fundingRoundFactory to clrFund --- contracts/.env.example | 12 +- ...{FundingRoundFactory.json => ClrFund.json} | 278 +- subgraph/abis/FundingRound.json | 13 + subgraph/abis/MACI.json | 929 +++---- subgraph/abis/MACIFactory.json | 433 +++- .../abis/OptimisticRecipientRegistry.json | 163 +- subgraph/abis/Poll.json | 876 +++++++ subgraph/config/arbitrum-goerli.json | 2 +- subgraph/config/arbitrum.json | 2 +- subgraph/config/xdai.json | 2 +- .../BrightIdUserRegistry.ts | 0 .../ClrFund.ts} | 223 +- .../FundingRound.ts | 15 + subgraph/generated/ClrFund/MACI.ts | 1087 ++++++++ subgraph/generated/ClrFund/MACIFactory.ts | 816 ++++++ .../OptimisticRecipientRegistry.ts | 23 + subgraph/generated/ClrFund/Poll.ts | 1461 +++++++++++ .../{FundingRoundFactory => ClrFund}/Token.ts | 0 .../FundingRoundFactory/MACIFactory.ts | 643 ----- .../OptimisticRecipientRegistry.ts | 23 + subgraph/generated/schema.ts | 128 +- subgraph/generated/templates.ts | 10 + .../templates/FundingRound/FundingRound.ts | 15 + .../OptimisticRecipientRegistry.ts | 23 + .../generated/templates/MACI/FundingRound.ts | 15 + subgraph/generated/templates/MACI/MACI.ts | 1439 +++-------- .../OptimisticRecipientRegistry.ts | 23 + .../generated/templates/Poll/FundingRound.ts | 842 ++++++ subgraph/generated/templates/Poll/Poll.ts | 1461 +++++++++++ subgraph/schema.graphql | 20 +- ...undFactoryMapping.ts => ClrFundMapping.ts} | 214 +- subgraph/src/MACIMapping.ts | 70 +- subgraph/src/PollMapping.ts | 60 + subgraph/src/PublicKey.ts | 12 + subgraph/src/RecipientRegistry.ts | 22 +- subgraph/subgraph.template.yaml | 44 +- subgraph/subgraph.yaml | 42 +- vue-app/.env.example | 2 +- vue-app/src/App.vue | 4 +- vue-app/src/api/abi.ts | 6 +- vue-app/src/api/{factory.ts => clrFund.ts} | 23 +- vue-app/src/api/contributions.ts | 4 +- vue-app/src/api/core.ts | 10 +- vue-app/src/api/maci-factory.ts | 4 +- vue-app/src/api/projects.ts | 7 +- vue-app/src/api/round.ts | 64 +- vue-app/src/api/rounds.ts | 4 +- vue-app/src/api/user.ts | 4 +- vue-app/src/components/MatchingFundsModal.vue | 11 +- vue-app/src/components/RoundInformation.vue | 2 +- vue-app/src/graphql/API.ts | 2289 +++++++++-------- ...oryInfo.graphql => GetClrFundInfo.graphql} | 4 +- .../queries/GetContributorMessages.graphql | 2 +- .../graphql/queries/GetCurrentRound.graphql | 4 +- .../queries/GetRecipientRegistryInfo.graphql | 4 +- .../src/graphql/queries/GetRoundInfo.graphql | 9 + vue-app/src/router/index.ts | 2 +- vue-app/src/stores/app.ts | 42 +- vue-app/src/stores/recipient.ts | 2 +- vue-app/src/stores/user.ts | 6 +- vue-app/src/views/Project.vue | 2 +- vue-app/src/views/ProjectList.vue | 2 +- 62 files changed, 9911 insertions(+), 4043 deletions(-) rename subgraph/abis/{FundingRoundFactory.json => ClrFund.json} (61%) create mode 100644 subgraph/abis/Poll.json rename subgraph/generated/{FundingRoundFactory => ClrFund}/BrightIdUserRegistry.ts (100%) rename subgraph/generated/{FundingRoundFactory/FundingRoundFactory.ts => ClrFund/ClrFund.ts} (85%) rename subgraph/generated/{FundingRoundFactory => ClrFund}/FundingRound.ts (97%) create mode 100644 subgraph/generated/ClrFund/MACI.ts create mode 100644 subgraph/generated/ClrFund/MACIFactory.ts rename subgraph/generated/{FundingRoundFactory => ClrFund}/OptimisticRecipientRegistry.ts (96%) create mode 100644 subgraph/generated/ClrFund/Poll.ts rename subgraph/generated/{FundingRoundFactory => ClrFund}/Token.ts (100%) delete mode 100644 subgraph/generated/FundingRoundFactory/MACIFactory.ts create mode 100644 subgraph/generated/templates/Poll/FundingRound.ts create mode 100644 subgraph/generated/templates/Poll/Poll.ts rename subgraph/src/{FundingRoundFactoryMapping.ts => ClrFundMapping.ts} (55%) create mode 100644 subgraph/src/PollMapping.ts create mode 100644 subgraph/src/PublicKey.ts rename vue-app/src/api/{factory.ts => clrFund.ts} (65%) rename vue-app/src/graphql/queries/{GetFactoryInfo.graphql => GetClrFundInfo.graphql} (61%) diff --git a/contracts/.env.example b/contracts/.env.example index 15ea56d1e..c668e5a89 100644 --- a/contracts/.env.example +++ b/contracts/.env.example @@ -23,15 +23,11 @@ WALLET_PRIVATE_KEY= NATIVE_TOKEN_ADDRESS= # Required to use in the tally and finalize scripts -CLRFUND= -ROUND_ADDRESS= COORDINATOR_PK= COORDINATOR_ETH_PK= -# Used in the tally script to add tally results to funding round by batch, default is 20 +# Used in the tally script to add tally results to funding round by batch, default is 8 TALLY_BATCH_SIZE= -# The block that the MACI contract was created in. Used in fetchLogs -MACI_START_BLOCK= # Number of blocks of the MACI event logs to fetch, default is 20,000 NUM_BLOCKS_PER_REQUEST= @@ -42,9 +38,9 @@ NUM_BLOCKS_PER_REQUEST= ETHERSCAN_API_KEY= -# ZK proof circuit type, based on MACI v0.10.1 circuit type as defined in utils/deployment.ts -# e.g. test, small, medium, x32, prod -CIRCUIT_TYPE=prod +# ZK proof circuit type, based on MACI v1 circuit type as defined in utils/deployment.ts +# e.g. micro +CIRCUIT_TYPE=micro # The IPFS gateway url used by the prepare-results.ts script diff --git a/subgraph/abis/FundingRoundFactory.json b/subgraph/abis/ClrFund.json similarity index 61% rename from subgraph/abis/FundingRoundFactory.json rename to subgraph/abis/ClrFund.json index b56cf93eb..a9b7eb499 100644 --- a/subgraph/abis/FundingRoundFactory.json +++ b/subgraph/abis/ClrFund.json @@ -1,14 +1,68 @@ [ { - "inputs": [ - { - "internalType": "contract MACIFactory", - "name": "_maciFactory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" + "inputs": [], + "name": "AlreadyFinalized", + "type": "error" + }, + { + "inputs": [], + "name": "FundingSourceAlreadyAdded", + "type": "error" + }, + { + "inputs": [], + "name": "FundingSourceNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidFundingRoundFactory", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidMaciFactory", + "type": "error" + }, + { + "inputs": [], + "name": "NoCoordinator", + "type": "error" + }, + { + "inputs": [], + "name": "NoCurrentRound", + "type": "error" + }, + { + "inputs": [], + "name": "NoRecipientRegistry", + "type": "error" + }, + { + "inputs": [], + "name": "NoToken", + "type": "error" + }, + { + "inputs": [], + "name": "NoUserRegistry", + "type": "error" + }, + { + "inputs": [], + "name": "NotAuthorized", + "type": "error" + }, + { + "inputs": [], + "name": "NotFinalized", + "type": "error" + }, + { + "inputs": [], + "name": "NotOwnerOfMaciFactory", + "type": "error" }, { "anonymous": false, @@ -23,6 +77,12 @@ "name": "CoordinatorChanged", "type": "event" }, + { + "anonymous": false, + "inputs": [], + "name": "FundingRoundTemplateChanged", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -49,6 +109,12 @@ "name": "FundingSourceRemoved", "type": "event" }, + { + "anonymous": false, + "inputs": [], + "name": "Initialized", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -68,6 +134,12 @@ "name": "OwnershipTransferred", "type": "event" }, + { + "anonymous": false, + "inputs": [], + "name": "RecipientRegistrySet", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -107,9 +179,19 @@ "name": "TokenChanged", "type": "event" }, + { + "anonymous": false, + "inputs": [], + "name": "UserRegistrySet", + "type": "event" + }, { "inputs": [ - { "internalType": "address", "name": "_source", "type": "address" } + { + "internalType": "address", + "name": "_source", + "type": "address" + } ], "name": "addFundingSource", "outputs": [], @@ -126,7 +208,13 @@ { "inputs": [], "name": "coordinator", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, @@ -134,8 +222,16 @@ "inputs": [], "name": "coordinatorPubKey", "outputs": [ - { "internalType": "uint256", "name": "x", "type": "uint256" }, - { "internalType": "uint256", "name": "y", "type": "uint256" } + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } ], "stateMutability": "view", "type": "function" @@ -148,7 +244,13 @@ "type": "function" }, { - "inputs": [], + "inputs": [ + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], "name": "deployNewRound", "outputs": [], "stateMutability": "nonpayable", @@ -169,18 +271,50 @@ }, { "inputs": [ - { "internalType": "contract ERC20", "name": "token", "type": "address" } + { + "internalType": "contract ERC20", + "name": "token", + "type": "address" + } ], "name": "getMatchingFunds", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "_maciFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_roundFactory", + "type": "address" + } + ], + "name": "init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "maciFactory", "outputs": [ - { "internalType": "contract MACIFactory", "name": "", "type": "address" } + { + "internalType": "contract MACIFactory", + "name": "", + "type": "address" + } ], "stateMutability": "view", "type": "function" @@ -189,7 +323,11 @@ "inputs": [], "name": "nativeToken", "outputs": [ - { "internalType": "contract ERC20", "name": "", "type": "address" } + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } ], "stateMutability": "view", "type": "function" @@ -197,7 +335,13 @@ { "inputs": [], "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, @@ -216,7 +360,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "_source", "type": "address" } + { + "internalType": "address", + "name": "_source", + "type": "address" + } ], "name": "removeFundingSource", "outputs": [], @@ -231,56 +379,44 @@ "type": "function" }, { - "inputs": [ - { "internalType": "address", "name": "_coordinator", "type": "address" }, + "inputs": [], + "name": "roundFactory", + "outputs": [ { - "components": [ - { "internalType": "uint256", "name": "x", "type": "uint256" }, - { "internalType": "uint256", "name": "y", "type": "uint256" } - ], - "internalType": "struct MACISharedObjs.PubKey", - "name": "_coordinatorPubKey", - "type": "tuple" + "internalType": "contract FundingRoundFactory", + "name": "", + "type": "address" } ], - "name": "setCoordinator", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "uint8", "name": "_stateTreeDepth", "type": "uint8" }, - { "internalType": "uint8", "name": "_messageTreeDepth", "type": "uint8" }, - { - "internalType": "uint8", - "name": "_voteOptionTreeDepth", - "type": "uint8" - }, - { "internalType": "uint8", "name": "_tallyBatchSize", "type": "uint8" }, - { "internalType": "uint8", "name": "_messageBatchSize", "type": "uint8" }, - { - "internalType": "contract SnarkVerifier", - "name": "_batchUstVerifier", - "type": "address" - }, { - "internalType": "contract SnarkVerifier", - "name": "_qvtVerifier", + "internalType": "address", + "name": "_coordinator", "type": "address" }, { - "internalType": "uint256", - "name": "_signUpDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_votingDuration", - "type": "uint256" + "components": [ + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } + ], + "internalType": "struct IPubKey.PubKey", + "name": "_coordinatorPubKey", + "type": "tuple" } ], - "name": "setMaciParameters", + "name": "setCoordinator", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -300,7 +436,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "_token", "type": "address" } + { + "internalType": "address", + "name": "_token", + "type": "address" + } ], "name": "setToken", "outputs": [], @@ -322,11 +462,25 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "_totalSpent", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_totalSpent", + "type": "uint256" + }, { "internalType": "uint256", "name": "_totalSpentSalt", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_newResultCommitment", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_perVOSpentVoiceCreditsHash", + "type": "uint256" } ], "name": "transferMatchingFunds", @@ -336,7 +490,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "newOwner", "type": "address" } + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } ], "name": "transferOwnership", "outputs": [], diff --git a/subgraph/abis/FundingRound.json b/subgraph/abis/FundingRound.json index 9f603757e..5abae313a 100644 --- a/subgraph/abis/FundingRound.json +++ b/subgraph/abis/FundingRound.json @@ -453,6 +453,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "poll", + "outputs": [ + { + "internalType": "contract Poll", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "totalSpent", diff --git a/subgraph/abis/MACI.json b/subgraph/abis/MACI.json index 9bd23ef87..09bfde2e6 100644 --- a/subgraph/abis/MACI.json +++ b/subgraph/abis/MACI.json @@ -2,209 +2,102 @@ { "inputs": [ { - "components": [ - { - "internalType": "uint8", - "name": "stateTreeDepth", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "messageTreeDepth", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "voteOptionTreeDepth", - "type": "uint8" - } - ], - "internalType": "struct MACIParameters.TreeDepths", - "name": "_treeDepths", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint8", - "name": "tallyBatchSize", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "messageBatchSize", - "type": "uint8" - } - ], - "internalType": "struct MACIParameters.BatchSizes", - "name": "_batchSizes", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "maxUsers", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxMessages", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxVoteOptions", - "type": "uint256" - } - ], - "internalType": "struct MACIParameters.MaxValues", - "name": "_maxValues", - "type": "tuple" + "internalType": "contract PollFactory", + "name": "_pollFactory", + "type": "address" }, { "internalType": "contract SignUpGatekeeper", "name": "_signUpGatekeeper", "type": "address" }, - { - "internalType": "contract SnarkVerifier", - "name": "_batchUstVerifier", - "type": "address" - }, - { - "internalType": "contract SnarkVerifier", - "name": "_qvtVerifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_signUpDurationSeconds", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_votingDurationSeconds", - "type": "uint256" - }, { "internalType": "contract InitialVoiceCreditProxy", "name": "_initialVoiceCreditProxy", "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct MACISharedObjs.PubKey", - "name": "_coordinatorPubKey", - "type": "tuple" - }, - { - "internalType": "address", - "name": "_coordinatorAddress", - "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { - "anonymous": false, + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { "inputs": [ { - "components": [ - { - "internalType": "uint256", - "name": "iv", - "type": "uint256" - }, - { - "internalType": "uint256[10]", - "name": "data", - "type": "uint256[10]" - } - ], - "indexed": false, - "internalType": "struct MACISharedObjs.Message", - "name": "_message", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct MACISharedObjs.PubKey", - "name": "_encPubKey", - "type": "tuple" + "internalType": "address", + "name": "_caller", + "type": "address" } ], - "name": "PublishMessage", - "type": "event" + "name": "CallerMustBePoll", + "type": "error" + }, + { + "inputs": [], + "name": "MaciNotInit", + "type": "error" + }, + { + "inputs": [], + "name": "MaciPubKeyLargerThanSnarkFieldSize", + "type": "error" }, { - "anonymous": false, "inputs": [ { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct MACISharedObjs.PubKey", - "name": "_userPubKey", - "type": "tuple" - }, - { - "indexed": false, "internalType": "uint256", - "name": "_stateIndex", + "name": "pollId", "type": "uint256" - }, + } + ], + "name": "PollDoesNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "PoseidonHashLibrariesNotLinked", + "type": "error" + }, + { + "inputs": [ { - "indexed": false, "internalType": "uint256", - "name": "_voiceCreditBalance", + "name": "pollId", "type": "uint256" } ], - "name": "SignUp", - "type": "event" + "name": "PreviousPollNotCompleted", + "type": "error" + }, + { + "inputs": [], + "name": "TooManySignups", + "type": "error" }, { + "inputs": [], + "name": "WrongVkRegistryOwner", + "type": "error" + }, + { + "anonymous": false, "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "_newStateRoot", + "name": "_pollId", "type": "uint256" }, + { + "indexed": false, + "internalType": "address", + "name": "_pollAddr", + "type": "address" + }, { "components": [ { @@ -218,237 +111,178 @@ "type": "uint256" } ], - "internalType": "struct MACISharedObjs.PubKey[]", - "name": "_ecdhPubKeys", - "type": "tuple[]" - }, - { - "internalType": "uint256[8]", - "name": "_proof", - "type": "uint256[8]" + "indexed": false, + "internalType": "struct IPubKey.PubKey", + "name": "_pubKey", + "type": "tuple" } ], - "name": "batchProcessMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "DeployPoll", + "type": "event" }, { + "anonymous": false, "inputs": [ { - "internalType": "uint8", - "name": "_levels", - "type": "uint8" - } - ], - "name": "calcEmptyVoteOptionTreeRoot", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "calcSignUpDeadline", - "outputs": [ + "indexed": false, + "internalType": "contract VkRegistry", + "name": "_vkRegistry", + "type": "address" + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "indexed": false, + "internalType": "contract TopupCredit", + "name": "_topupCredit", + "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "Init", + "type": "event" }, { - "inputs": [], - "name": "calcVotingDeadline", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "_pollId", "type": "uint256" } ], - "stateMutability": "view", - "type": "function" + "name": "MergeStateAq", + "type": "event" }, { + "anonymous": false, "inputs": [ { - "internalType": "uint8", - "name": "_treeLevels", - "type": "uint8" - }, - { + "indexed": false, "internalType": "uint256", - "name": "_zeroValue", + "name": "_pollId", "type": "uint256" - } - ], - "name": "computeEmptyQuinRoot", - "outputs": [ + }, { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "_numSrQueueOps", "type": "uint256" } ], - "stateMutability": "pure", - "type": "function" + "name": "MergeStateAqSubRoots", + "type": "event" }, { + "anonymous": false, "inputs": [ { - "internalType": "uint8", - "name": "_treeLevels", - "type": "uint8" + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" }, { - "internalType": "uint256", - "name": "_zeroValue", - "type": "uint256" - } - ], - "name": "computeEmptyRoot", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - - { - "inputs": [], - "name": "coordinatorAddress", - "outputs": [ - { + "indexed": true, "internalType": "address", - "name": "", + "name": "newOwner", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "OwnershipTransferred", + "type": "event" }, { - "inputs": [], - "name": "coordinatorPubKey", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "x", + "name": "_stateIndex", "type": "uint256" }, { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "coordinatorReset", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "currentMessageBatchIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentPerVOSpentVoiceCreditsCommitment", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentQvtBatchNum", - "outputs": [ + "components": [ + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct IPubKey.PubKey", + "name": "_userPubKey", + "type": "tuple" + }, { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "_voiceCreditBalance", "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentResultsCommitment", - "outputs": [ + }, { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "_timestamp", "type": "uint256" } ], - "stateMutability": "view", - "type": "function" + "name": "SignUp", + "type": "event" }, { - "inputs": [], - "name": "currentSpentVoiceCreditsCommitment", - "outputs": [ + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "_duration", "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "emptyVoteOptionTreeRoot", - "outputs": [ + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ + "components": [ + { + "internalType": "uint256", + "name": "maxMessages", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVoteOptions", + "type": "uint256" + } + ], + "internalType": "struct Params.MaxValues", + "name": "_maxValues", + "type": "tuple" + }, { - "internalType": "uint256", - "name": "_newStateRoot", - "type": "uint256" + "components": [ + { + "internalType": "uint8", + "name": "intStateTreeDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "messageTreeSubDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "messageTreeDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "voteOptionTreeDepth", + "type": "uint8" + } + ], + "internalType": "struct Params.TreeDepths", + "name": "_treeDepths", + "type": "tuple" }, { "components": [ @@ -463,56 +297,36 @@ "type": "uint256" } ], - "internalType": "struct MACISharedObjs.PubKey[]", - "name": "_ecdhPubKeys", - "type": "tuple[]" + "internalType": "struct IPubKey.PubKey", + "name": "_coordinatorPubKey", + "type": "tuple" } ], - "name": "genBatchUstPublicSignals", + "name": "deployPoll", "outputs": [ { - "internalType": "uint256[]", + "internalType": "address", "name": "", - "type": "uint256[]" + "type": "address" } ], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", - "name": "_intermediateStateRoot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_newResultsCommitment", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_newSpentVoiceCreditsCommitment", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_newPerVOSpentVoiceCreditsCommitment", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_totalVotes", + "name": "_pollId", "type": "uint256" } ], - "name": "genQvtPublicSignals", + "name": "getPoll", "outputs": [ { - "internalType": "uint256[]", + "internalType": "contract Poll", "name": "", - "type": "uint256[]" + "type": "address" } ], "stateMutability": "view", @@ -520,7 +334,7 @@ }, { "inputs": [], - "name": "getMessageTreeRoot", + "name": "getStateAqRoot", "outputs": [ { "internalType": "uint256", @@ -532,53 +346,52 @@ "type": "function" }, { - "inputs": [], - "name": "getStateTreeRoot", - "outputs": [ + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "uint256[2]", + "name": "array", + "type": "uint256[2]" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "hasUnprocessedMessages", + "name": "hash2", "outputs": [ { - "internalType": "bool", + "internalType": "uint256", "name": "", - "type": "bool" + "type": "uint256" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { - "inputs": [], - "name": "hasUntalliedStateLeaves", + "inputs": [ + { + "internalType": "uint256[3]", + "name": "array", + "type": "uint256[3]" + } + ], + "name": "hash3", "outputs": [ { - "internalType": "bool", + "internalType": "uint256", "name": "", - "type": "bool" + "type": "uint256" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { "inputs": [ { - "internalType": "uint256[]", + "internalType": "uint256[4]", "name": "array", - "type": "uint256[]" + "type": "uint256[4]" } ], - "name": "hash11", + "name": "hash4", "outputs": [ { "internalType": "uint256", @@ -632,37 +445,6 @@ "stateMutability": "pure", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "iv", - "type": "uint256" - }, - { - "internalType": "uint256[10]", - "name": "data", - "type": "uint256[10]" - } - ], - "internalType": "struct MACISharedObjs.Message", - "name": "_message", - "type": "tuple" - } - ], - "name": "hashMessage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, { "inputs": [ { @@ -680,15 +462,10 @@ "type": "uint256" } ], - "internalType": "struct MACISharedObjs.PubKey", + "internalType": "struct IPubKey.PubKey", "name": "pubKey", "type": "tuple" }, - { - "internalType": "uint256", - "name": "voteOptionTreeRoot", - "type": "uint256" - }, { "internalType": "uint256", "name": "voiceCreditBalance", @@ -696,7 +473,7 @@ }, { "internalType": "uint256", - "name": "nonce", + "name": "timestamp", "type": "uint256" } ], @@ -717,16 +494,21 @@ "type": "function" }, { - "inputs": [], - "name": "hashedBlankStateLeaf", - "outputs": [ + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "contract VkRegistry", + "name": "_vkRegistry", + "type": "address" + }, + { + "internalType": "contract TopupCredit", + "name": "_topupCredit", + "type": "address" } ], - "stateMutability": "view", + "name": "init", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { @@ -744,20 +526,26 @@ }, { "inputs": [], - "name": "maxMessages", + "name": "isInitialised", "outputs": [ { - "internalType": "uint256", + "internalType": "bool", "name": "", - "type": "uint256" + "type": "bool" } ], "stateMutability": "view", "type": "function" }, { - "inputs": [], - "name": "maxUsers", + "inputs": [ + { + "internalType": "uint256", + "name": "_pollId", + "type": "uint256" + } + ], + "name": "mergeStateAq", "outputs": [ { "internalType": "uint256", @@ -765,30 +553,35 @@ "type": "uint256" } ], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [], - "name": "messageBatchSize", - "outputs": [ + "inputs": [ { - "internalType": "uint8", - "name": "", - "type": "uint8" + "internalType": "uint256", + "name": "_numSrQueueOps", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_pollId", + "type": "uint256" } ], - "stateMutability": "view", + "name": "mergeStateAqSubRoots", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "messageTree", + "name": "nextPollId", "outputs": [ { - "internalType": "contract IncrementalMerkleTree", + "internalType": "uint256", "name": "", - "type": "address" + "type": "uint256" } ], "stateMutability": "view", @@ -796,7 +589,7 @@ }, { "inputs": [], - "name": "messageTreeMaxLeafIndex", + "name": "numSignUps", "outputs": [ { "internalType": "uint256", @@ -808,21 +601,14 @@ "type": "function" }, { - "inputs": [], - "name": "numMessages", - "outputs": [ + "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "numSignUps", + "name": "numStateLeaves", "outputs": [ { "internalType": "uint256", @@ -835,12 +621,12 @@ }, { "inputs": [], - "name": "originalCurrentResultsCommitment", + "name": "owner", "outputs": [ { - "internalType": "uint256", + "internalType": "address", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", @@ -848,12 +634,12 @@ }, { "inputs": [], - "name": "originalSpentVoiceCreditsCommitment", + "name": "pollFactory", "outputs": [ { - "internalType": "uint256", + "internalType": "contract PollFactory", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", @@ -863,36 +649,24 @@ "inputs": [ { "internalType": "uint256", - "name": "_intermediateStateRoot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_newResultsCommitment", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_newSpentVoiceCreditsCommitment", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_newPerVOSpentVoiceCreditsCommitment", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_totalVotes", + "name": "", "type": "uint256" - }, + } + ], + "name": "polls", + "outputs": [ { - "internalType": "uint256[8]", - "name": "_proof", - "type": "uint256[8]" + "internalType": "contract Poll", + "name": "", + "type": "address" } ], - "name": "proveVoteTallyBatch", + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -900,43 +674,20 @@ { "inputs": [ { - "components": [ - { - "internalType": "uint256", - "name": "iv", - "type": "uint256" - }, - { - "internalType": "uint256[10]", - "name": "data", - "type": "uint256[10]" - } - ], - "internalType": "struct MACISharedObjs.Message", - "name": "_message", - "type": "tuple" - }, + "internalType": "uint256[]", + "name": "array", + "type": "uint256[]" + } + ], + "name": "sha256Hash", + "outputs": [ { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct MACISharedObjs.PubKey", - "name": "_encPubKey", - "type": "tuple" + "internalType": "uint256", + "name": "", + "type": "uint256" } ], - "name": "publishMessage", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "pure", "type": "function" }, { @@ -954,8 +705,8 @@ "type": "uint256" } ], - "internalType": "struct MACISharedObjs.PubKey", - "name": "_userPubKey", + "internalType": "struct IPubKey.PubKey", + "name": "_pubKey", "type": "tuple" }, { @@ -974,19 +725,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "signUpDurationSeconds", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "signUpGatekeeper", @@ -1015,36 +753,10 @@ }, { "inputs": [], - "name": "stateRoot", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stateRootBeforeProcessing", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stateTree", + "name": "stateAq", "outputs": [ { - "internalType": "contract IncrementalMerkleTree", + "internalType": "contract AccQueue", "name": "", "type": "address" } @@ -1054,7 +766,7 @@ }, { "inputs": [], - "name": "tallyBatchSize", + "name": "stateTreeDepth", "outputs": [ { "internalType": "uint8", @@ -1067,35 +779,12 @@ }, { "inputs": [], - "name": "totalVotes", + "name": "topupCredit", "outputs": [ { - "internalType": "uint256", + "internalType": "contract TopupCredit", "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "treeDepths", - "outputs": [ - { - "internalType": "uint8", - "name": "stateTreeDepth", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "messageTreeDepth", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "voteOptionTreeDepth", - "type": "uint8" + "type": "address" } ], "stateMutability": "view", @@ -1104,48 +793,24 @@ { "inputs": [ { - "internalType": "uint256", - "name": "_spent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_salt", - "type": "uint256" - } - ], - "name": "verifySpentVoiceCredits", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "voteOptionsMaxLeafIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "stateMutability": "view", + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "votingDurationSeconds", + "name": "vkRegistry", "outputs": [ { - "internalType": "uint256", + "internalType": "contract VkRegistry", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", diff --git a/subgraph/abis/MACIFactory.json b/subgraph/abis/MACIFactory.json index 0a8b91ad4..d28bfa3a2 100644 --- a/subgraph/abis/MACIFactory.json +++ b/subgraph/abis/MACIFactory.json @@ -2,54 +2,44 @@ { "inputs": [ { - "internalType": "uint8", - "name": "_stateTreeDepth", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "_messageTreeDepth", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "_voteOptionTreeDepth", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "_tallyBatchSize", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "_messageBatchSize", - "type": "uint8" - }, - { - "internalType": "contract SnarkVerifier", - "name": "_batchUstVerifier", + "internalType": "address", + "name": "_vkRegistry", "type": "address" }, { - "internalType": "contract SnarkVerifier", - "name": "_qvtVerifier", + "internalType": "address", + "name": "_pollFactory", "type": "address" - }, - { - "internalType": "uint256", - "name": "_signUpDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_votingDuration", - "type": "uint256" } ], "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [], + "name": "InvalidPollFactory", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidVkRegistry", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitialized", + "type": "error" + }, + { + "inputs": [], + "name": "ProcessVkNotSet", + "type": "error" + }, + { + "inputs": [], + "name": "TallyVkNotSet", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -88,52 +78,31 @@ "name": "OwnershipTransferred", "type": "event" }, - { - "inputs": [], - "name": "batchSizes", - "outputs": [ - { - "internalType": "uint8", - "name": "tallyBatchSize", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "messageBatchSize", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "batchUstVerifier", - "outputs": [ - { - "internalType": "contract SnarkVerifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { "internalType": "contract SignUpGatekeeper", - "name": "_signUpGatekeeper", + "name": "signUpGatekeeper", "type": "address" }, { "internalType": "contract InitialVoiceCreditProxy", - "name": "_initialVoiceCreditProxy", + "name": "initialVoiceCreditProxy", "type": "address" }, { "internalType": "address", - "name": "_coordinator", + "name": "topupCredit", + "type": "address" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "coordinator", "type": "address" }, { @@ -149,8 +118,8 @@ "type": "uint256" } ], - "internalType": "struct MACISharedObjs.PubKey", - "name": "_coordinatorPubKey", + "internalType": "struct IPubKey.PubKey", + "name": "coordinatorPubKey", "type": "tuple" } ], @@ -171,17 +140,25 @@ "outputs": [ { "internalType": "uint256", - "name": "maxUsers", + "name": "maxMessages", "type": "uint256" }, { "internalType": "uint256", - "name": "maxMessages", + "name": "maxVoteOptions", "type": "uint256" - }, + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "messageBatchSize", + "outputs": [ { "internalType": "uint256", - "name": "maxVoteOptions", + "name": "", "type": "uint256" } ], @@ -203,10 +180,10 @@ }, { "inputs": [], - "name": "qvtVerifier", + "name": "pollFactory", "outputs": [ { - "internalType": "contract SnarkVerifier", + "internalType": "contract PollFactory", "name": "", "type": "address" } @@ -229,59 +206,278 @@ "type": "uint8" }, { - "internalType": "uint8", - "name": "_messageTreeDepth", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "_voteOptionTreeDepth", - "type": "uint8" + "components": [ + { + "internalType": "uint8", + "name": "intStateTreeDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "messageTreeSubDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "messageTreeDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "voteOptionTreeDepth", + "type": "uint8" + } + ], + "internalType": "struct Params.TreeDepths", + "name": "_treeDepths", + "type": "tuple" }, { - "internalType": "uint8", - "name": "_tallyBatchSize", - "type": "uint8" + "components": [ + { + "internalType": "uint256", + "name": "maxMessages", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVoteOptions", + "type": "uint256" + } + ], + "internalType": "struct Params.MaxValues", + "name": "_maxValues", + "type": "tuple" }, { - "internalType": "uint8", + "internalType": "uint256", "name": "_messageBatchSize", - "type": "uint8" + "type": "uint256" }, { - "internalType": "contract SnarkVerifier", - "name": "_batchUstVerifier", - "type": "address" + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } + ], + "internalType": "struct Pairing.G1Point", + "name": "alpha1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "x", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "y", + "type": "uint256[2]" + } + ], + "internalType": "struct Pairing.G2Point", + "name": "beta2", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "x", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "y", + "type": "uint256[2]" + } + ], + "internalType": "struct Pairing.G2Point", + "name": "gamma2", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "x", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "y", + "type": "uint256[2]" + } + ], + "internalType": "struct Pairing.G2Point", + "name": "delta2", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } + ], + "internalType": "struct Pairing.G1Point[]", + "name": "ic", + "type": "tuple[]" + } + ], + "internalType": "struct SnarkCommon.VerifyingKey", + "name": "_processVk", + "type": "tuple" }, { - "internalType": "contract SnarkVerifier", - "name": "_qvtVerifier", - "type": "address" - }, + "components": [ + { + "components": [ + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } + ], + "internalType": "struct Pairing.G1Point", + "name": "alpha1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "x", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "y", + "type": "uint256[2]" + } + ], + "internalType": "struct Pairing.G2Point", + "name": "beta2", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "x", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "y", + "type": "uint256[2]" + } + ], + "internalType": "struct Pairing.G2Point", + "name": "gamma2", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "x", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "y", + "type": "uint256[2]" + } + ], + "internalType": "struct Pairing.G2Point", + "name": "delta2", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } + ], + "internalType": "struct Pairing.G1Point[]", + "name": "ic", + "type": "tuple[]" + } + ], + "internalType": "struct SnarkCommon.VerifyingKey", + "name": "_tallyVk", + "type": "tuple" + } + ], + "name": "setMaciParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { - "internalType": "uint256", - "name": "_signUpDuration", - "type": "uint256" - }, + "internalType": "address", + "name": "_pollFactory", + "type": "address" + } + ], + "name": "setPollFactory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { - "internalType": "uint256", - "name": "_votingDuration", - "type": "uint256" + "internalType": "address", + "name": "_vkRegistry", + "type": "address" } ], - "name": "setMaciParameters", + "name": "setVkRegistry", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "signUpDuration", + "name": "stateTreeDepth", "outputs": [ { - "internalType": "uint256", + "internalType": "uint8", "name": "", - "type": "uint256" + "type": "uint8" } ], "stateMutability": "view", @@ -306,7 +502,12 @@ "outputs": [ { "internalType": "uint8", - "name": "stateTreeDepth", + "name": "intStateTreeDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "messageTreeSubDepth", "type": "uint8" }, { @@ -325,12 +526,12 @@ }, { "inputs": [], - "name": "votingDuration", + "name": "vkRegistry", "outputs": [ { - "internalType": "uint256", + "internalType": "contract VkRegistry", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", diff --git a/subgraph/abis/OptimisticRecipientRegistry.json b/subgraph/abis/OptimisticRecipientRegistry.json index cf953b474..ab62d0daf 100644 --- a/subgraph/abis/OptimisticRecipientRegistry.json +++ b/subgraph/abis/OptimisticRecipientRegistry.json @@ -1,13 +1,21 @@ [ { "inputs": [ - { "internalType": "uint256", "name": "_baseDeposit", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_baseDeposit", + "type": "uint256" + }, { "internalType": "uint256", "name": "_challengePeriodDuration", "type": "uint256" }, - { "internalType": "address", "name": "_controller", "type": "address" } + { + "internalType": "address", + "name": "_controller", + "type": "address" + } ], "stateMutability": "nonpayable", "type": "constructor" @@ -107,8 +115,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "_recipient", "type": "address" }, - { "internalType": "string", "name": "_metadata", "type": "string" } + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "string", + "name": "_metadata", + "type": "string" + } ], "name": "addRecipient", "outputs": [], @@ -118,20 +134,36 @@ { "inputs": [], "name": "baseDeposit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "challengePeriodDuration", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "bytes32", "name": "_recipientId", "type": "bytes32" }, + { + "internalType": "bytes32", + "name": "_recipientId", + "type": "bytes32" + }, { "internalType": "address payable", "name": "_beneficiary", @@ -139,54 +171,123 @@ } ], "name": "challengeRequest", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "controller", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "bytes32", "name": "_recipientId", "type": "bytes32" } + { + "internalType": "bytes32", + "name": "_recipientId", + "type": "bytes32" + } ], "name": "executeRequest", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "uint256", "name": "_index", "type": "uint256" }, - { "internalType": "uint256", "name": "_startTime", "type": "uint256" }, - { "internalType": "uint256", "name": "_endTime", "type": "uint256" } + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + } ], "name": "getRecipientAddress", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRecipientCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxRecipients", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "bytes32", "name": "_recipientId", "type": "bytes32" } + { + "internalType": "bytes32", + "name": "_recipientId", + "type": "bytes32" + } ], "name": "removeRecipient", "outputs": [], @@ -202,7 +303,11 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "_baseDeposit", "type": "uint256" } + { + "internalType": "uint256", + "name": "_baseDeposit", + "type": "uint256" + } ], "name": "setBaseDeposit", "outputs": [], @@ -224,16 +329,30 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "_maxRecipients", "type": "uint256" } + { + "internalType": "uint256", + "name": "_maxRecipients", + "type": "uint256" + } ], "name": "setMaxRecipients", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "newOwner", "type": "address" } + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } ], "name": "transferOwnership", "outputs": [], diff --git a/subgraph/abis/Poll.json b/subgraph/abis/Poll.json new file mode 100644 index 000000000..50f42ffc5 --- /dev/null +++ b/subgraph/abis/Poll.json @@ -0,0 +1,876 @@ +[ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_duration", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "maxMessages", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVoteOptions", + "type": "uint256" + } + ], + "internalType": "struct Params.MaxValues", + "name": "_maxValues", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint8", + "name": "intStateTreeDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "messageTreeSubDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "messageTreeDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "voteOptionTreeDepth", + "type": "uint8" + } + ], + "internalType": "struct Params.TreeDepths", + "name": "_treeDepths", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint24", + "name": "messageBatchSize", + "type": "uint24" + }, + { + "internalType": "uint24", + "name": "tallyBatchSize", + "type": "uint24" + }, + { + "internalType": "uint24", + "name": "subsidyBatchSize", + "type": "uint24" + } + ], + "internalType": "struct Params.BatchSizes", + "name": "_batchSizes", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } + ], + "internalType": "struct IPubKey.PubKey", + "name": "_coordinatorPubKey", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "contract VkRegistry", + "name": "vkRegistry", + "type": "address" + }, + { + "internalType": "contract IMACI", + "name": "maci", + "type": "address" + }, + { + "internalType": "contract AccQueue", + "name": "messageAq", + "type": "address" + }, + { + "internalType": "contract TopupCredit", + "name": "topupCredit", + "type": "address" + } + ], + "internalType": "struct PollDeploymentParams.ExtContracts", + "name": "_extContracts", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "MaciPubKeyLargerThanSnarkFieldSize", + "type": "error" + }, + { + "inputs": [], + "name": "PollAlreadyInit", + "type": "error" + }, + { + "inputs": [], + "name": "StateAqAlreadyMerged", + "type": "error" + }, + { + "inputs": [], + "name": "StateAqSubtreesNeedMerge", + "type": "error" + }, + { + "inputs": [], + "name": "TooManyMessages", + "type": "error" + }, + { + "inputs": [], + "name": "VotingPeriodNotOver", + "type": "error" + }, + { + "inputs": [], + "name": "VotingPeriodOver", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_stateRoot", + "type": "uint256" + } + ], + "name": "MergeMaciStateAq", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_numSrQueueOps", + "type": "uint256" + } + ], + "name": "MergeMaciStateAqSubRoots", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_messageRoot", + "type": "uint256" + } + ], + "name": "MergeMessageAq", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_numSrQueueOps", + "type": "uint256" + } + ], + "name": "MergeMessageAqSubRoots", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "msgType", + "type": "uint256" + }, + { + "internalType": "uint256[10]", + "name": "data", + "type": "uint256[10]" + } + ], + "indexed": false, + "internalType": "struct IMessage.Message", + "name": "_message", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct IPubKey.PubKey", + "name": "_encPubKey", + "type": "tuple" + } + ], + "name": "PublishMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "msgType", + "type": "uint256" + }, + { + "internalType": "uint256[10]", + "name": "data", + "type": "uint256[10]" + } + ], + "indexed": false, + "internalType": "struct IMessage.Message", + "name": "_message", + "type": "tuple" + } + ], + "name": "TopupMessage", + "type": "event" + }, + { + "inputs": [], + "name": "batchSizes", + "outputs": [ + { + "internalType": "uint24", + "name": "messageBatchSize", + "type": "uint24" + }, + { + "internalType": "uint24", + "name": "tallyBatchSize", + "type": "uint24" + }, + { + "internalType": "uint24", + "name": "subsidyBatchSize", + "type": "uint24" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "coordinatorPubKey", + "outputs": [ + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "coordinatorPubKeyHash", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentSbCommitment", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "extContracts", + "outputs": [ + { + "internalType": "contract VkRegistry", + "name": "vkRegistry", + "type": "address" + }, + { + "internalType": "contract IMACI", + "name": "maci", + "type": "address" + }, + { + "internalType": "contract AccQueue", + "name": "messageAq", + "type": "address" + }, + { + "internalType": "contract TopupCredit", + "name": "topupCredit", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDeployTimeAndDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "array", + "type": "uint256[2]" + } + ], + "name": "hash2", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[3]", + "name": "array", + "type": "uint256[3]" + } + ], + "name": "hash3", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[4]", + "name": "array", + "type": "uint256[4]" + } + ], + "name": "hash4", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[5]", + "name": "array", + "type": "uint256[5]" + } + ], + "name": "hash5", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_left", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_right", + "type": "uint256" + } + ], + "name": "hashLeftRight", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "msgType", + "type": "uint256" + }, + { + "internalType": "uint256[10]", + "name": "data", + "type": "uint256[10]" + } + ], + "internalType": "struct IMessage.Message", + "name": "_message", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } + ], + "internalType": "struct IPubKey.PubKey", + "name": "_encPubKey", + "type": "tuple" + } + ], + "name": "hashMessageAndEncPubKey", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxValues", + "outputs": [ + { + "internalType": "uint256", + "name": "maxMessages", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVoteOptions", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_pollId", + "type": "uint256" + } + ], + "name": "mergeMaciStateAq", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numSrQueueOps", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_pollId", + "type": "uint256" + } + ], + "name": "mergeMaciStateAqSubRoots", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mergeMessageAq", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_numSrQueueOps", + "type": "uint256" + } + ], + "name": "mergeMessageAqSubRoots", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mergedStateRoot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "numSignUpsAndMessages", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "dataToPad", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "msgType", + "type": "uint256" + } + ], + "name": "padAndHashMessage", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "msgType", + "type": "uint256" + }, + { + "internalType": "uint256[10]", + "name": "data", + "type": "uint256[10]" + } + ], + "internalType": "struct IMessage.Message", + "name": "", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } + ], + "internalType": "struct IPubKey.PubKey", + "name": "", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "msgType", + "type": "uint256" + }, + { + "internalType": "uint256[10]", + "name": "data", + "type": "uint256[10]" + } + ], + "internalType": "struct IMessage.Message", + "name": "_message", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "x", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "y", + "type": "uint256" + } + ], + "internalType": "struct IPubKey.PubKey", + "name": "_encPubKey", + "type": "tuple" + } + ], + "name": "publishMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "array", + "type": "uint256[]" + } + ], + "name": "sha256Hash", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "stateAqMerged", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stateIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "topup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "treeDepths", + "outputs": [ + { + "internalType": "uint8", + "name": "intStateTreeDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "messageTreeSubDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "messageTreeDepth", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "voteOptionTreeDepth", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/subgraph/config/arbitrum-goerli.json b/subgraph/config/arbitrum-goerli.json index 2126aa6b6..b3053c192 100644 --- a/subgraph/config/arbitrum-goerli.json +++ b/subgraph/config/arbitrum-goerli.json @@ -1,6 +1,6 @@ { "network": "arbitrum-goerli", "address": "0x0a12CE1B7a95f2067AB930f0b2316FF21Cd5A430", - "factoryStartBlock": 325577, + "clrFundStartBlock": 325577, "recipientRegistryStartBlock": 325577 } diff --git a/subgraph/config/arbitrum.json b/subgraph/config/arbitrum.json index 8f72d1d1f..66548bb55 100644 --- a/subgraph/config/arbitrum.json +++ b/subgraph/config/arbitrum.json @@ -1,6 +1,6 @@ { "network": "arbitrum-one", "address": "0x2e89494a8fE02891511a43f7877b726787E0C160", - "factoryStartBlock": 3461582, + "clrFundStartBlock": 3461582, "recipientRegistryStartBlock": 3461582 } diff --git a/subgraph/config/xdai.json b/subgraph/config/xdai.json index b026df2a1..ab3c34558 100644 --- a/subgraph/config/xdai.json +++ b/subgraph/config/xdai.json @@ -1,6 +1,6 @@ { "network": "xdai", "address": "0x4ede8f30d9c2dc96a9d6787e9c4a478424fb960a", - "factoryStartBlock": 15217676, + "clrFundStartBlock": 15217676, "recipientRegistryStartBlock": 15217676 } diff --git a/subgraph/generated/FundingRoundFactory/BrightIdUserRegistry.ts b/subgraph/generated/ClrFund/BrightIdUserRegistry.ts similarity index 100% rename from subgraph/generated/FundingRoundFactory/BrightIdUserRegistry.ts rename to subgraph/generated/ClrFund/BrightIdUserRegistry.ts diff --git a/subgraph/generated/FundingRoundFactory/FundingRoundFactory.ts b/subgraph/generated/ClrFund/ClrFund.ts similarity index 85% rename from subgraph/generated/FundingRoundFactory/FundingRoundFactory.ts rename to subgraph/generated/ClrFund/ClrFund.ts index f2c5e52e3..e89208f27 100644 --- a/subgraph/generated/FundingRoundFactory/FundingRoundFactory.ts +++ b/subgraph/generated/ClrFund/ClrFund.ts @@ -28,6 +28,20 @@ export class CoordinatorChanged__Params { } } +export class FundingRoundTemplateChanged extends ethereum.Event { + get params(): FundingRoundTemplateChanged__Params { + return new FundingRoundTemplateChanged__Params(this); + } +} + +export class FundingRoundTemplateChanged__Params { + _event: FundingRoundTemplateChanged; + + constructor(event: FundingRoundTemplateChanged) { + this._event = event; + } +} + export class FundingSourceAdded extends ethereum.Event { get params(): FundingSourceAdded__Params { return new FundingSourceAdded__Params(this); @@ -64,6 +78,20 @@ export class FundingSourceRemoved__Params { } } +export class Initialized extends ethereum.Event { + get params(): Initialized__Params { + return new Initialized__Params(this); + } +} + +export class Initialized__Params { + _event: Initialized; + + constructor(event: Initialized) { + this._event = event; + } +} + export class OwnershipTransferred extends ethereum.Event { get params(): OwnershipTransferred__Params { return new OwnershipTransferred__Params(this); @@ -86,6 +114,20 @@ export class OwnershipTransferred__Params { } } +export class RecipientRegistrySet extends ethereum.Event { + get params(): RecipientRegistrySet__Params { + return new RecipientRegistrySet__Params(this); + } +} + +export class RecipientRegistrySet__Params { + _event: RecipientRegistrySet; + + constructor(event: RecipientRegistrySet) { + this._event = event; + } +} + export class RoundFinalized extends ethereum.Event { get params(): RoundFinalized__Params { return new RoundFinalized__Params(this); @@ -140,7 +182,21 @@ export class TokenChanged__Params { } } -export class FundingRoundFactory__coordinatorPubKeyResult { +export class UserRegistrySet extends ethereum.Event { + get params(): UserRegistrySet__Params { + return new UserRegistrySet__Params(this); + } +} + +export class UserRegistrySet__Params { + _event: UserRegistrySet; + + constructor(event: UserRegistrySet) { + this._event = event; + } +} + +export class ClrFund__coordinatorPubKeyResult { value0: BigInt; value1: BigInt; @@ -165,9 +221,9 @@ export class FundingRoundFactory__coordinatorPubKeyResult { } } -export class FundingRoundFactory extends ethereum.SmartContract { - static bind(address: Address): FundingRoundFactory { - return new FundingRoundFactory("FundingRoundFactory", address); +export class ClrFund extends ethereum.SmartContract { + static bind(address: Address): ClrFund { + return new ClrFund("ClrFund", address); } coordinator(): Address { @@ -185,21 +241,21 @@ export class FundingRoundFactory extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toAddress()); } - coordinatorPubKey(): FundingRoundFactory__coordinatorPubKeyResult { + coordinatorPubKey(): ClrFund__coordinatorPubKeyResult { let result = super.call( "coordinatorPubKey", "coordinatorPubKey():(uint256,uint256)", [] ); - return new FundingRoundFactory__coordinatorPubKeyResult( + return new ClrFund__coordinatorPubKeyResult( result[0].toBigInt(), result[1].toBigInt() ); } try_coordinatorPubKey(): ethereum.CallResult< - FundingRoundFactory__coordinatorPubKeyResult + ClrFund__coordinatorPubKeyResult > { let result = super.tryCall( "coordinatorPubKey", @@ -211,7 +267,7 @@ export class FundingRoundFactory extends ethereum.SmartContract { } let value = result.value; return ethereum.CallResult.fromValue( - new FundingRoundFactory__coordinatorPubKeyResult( + new ClrFund__coordinatorPubKeyResult( value[0].toBigInt(), value[1].toBigInt() ) @@ -332,49 +388,34 @@ export class FundingRoundFactory extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toAddress()); } - userRegistry(): Address { - let result = super.call("userRegistry", "userRegistry():(address)", []); + roundFactory(): Address { + let result = super.call("roundFactory", "roundFactory():(address)", []); return result[0].toAddress(); } - try_userRegistry(): ethereum.CallResult
{ - let result = super.tryCall("userRegistry", "userRegistry():(address)", []); + try_roundFactory(): ethereum.CallResult
{ + let result = super.tryCall("roundFactory", "roundFactory():(address)", []); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; return ethereum.CallResult.fromValue(value[0].toAddress()); } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } + userRegistry(): Address { + let result = super.call("userRegistry", "userRegistry():(address)", []); - get _maciFactory(): Address { - return this._call.inputValues[0].value.toAddress(); + return result[0].toAddress(); } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - constructor(call: ConstructorCall) { - this._call = call; + try_userRegistry(): ethereum.CallResult
{ + let result = super.tryCall("userRegistry", "userRegistry():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); } } @@ -476,6 +517,10 @@ export class DeployNewRoundCall__Inputs { constructor(call: DeployNewRoundCall) { this._call = call; } + + get duration(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } } export class DeployNewRoundCall__Outputs { @@ -486,6 +531,40 @@ export class DeployNewRoundCall__Outputs { } } +export class InitCall extends ethereum.Call { + get inputs(): InitCall__Inputs { + return new InitCall__Inputs(this); + } + + get outputs(): InitCall__Outputs { + return new InitCall__Outputs(this); + } +} + +export class InitCall__Inputs { + _call: InitCall; + + constructor(call: InitCall) { + this._call = call; + } + + get _maciFactory(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get _roundFactory(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class InitCall__Outputs { + _call: InitCall; + + constructor(call: InitCall) { + this._call = call; + } +} + export class RemoveFundingSourceCall extends ethereum.Call { get inputs(): RemoveFundingSourceCall__Inputs { return new RemoveFundingSourceCall__Inputs(this); @@ -588,68 +667,6 @@ export class SetCoordinatorCall_coordinatorPubKeyStruct extends ethereum.Tuple { } } -export class SetMaciParametersCall extends ethereum.Call { - get inputs(): SetMaciParametersCall__Inputs { - return new SetMaciParametersCall__Inputs(this); - } - - get outputs(): SetMaciParametersCall__Outputs { - return new SetMaciParametersCall__Outputs(this); - } -} - -export class SetMaciParametersCall__Inputs { - _call: SetMaciParametersCall; - - constructor(call: SetMaciParametersCall) { - this._call = call; - } - - get _stateTreeDepth(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _messageTreeDepth(): i32 { - return this._call.inputValues[1].value.toI32(); - } - - get _voteOptionTreeDepth(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get _tallyBatchSize(): i32 { - return this._call.inputValues[3].value.toI32(); - } - - get _messageBatchSize(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get _batchUstVerifier(): Address { - return this._call.inputValues[5].value.toAddress(); - } - - get _qvtVerifier(): Address { - return this._call.inputValues[6].value.toAddress(); - } - - get _signUpDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get _votingDuration(): BigInt { - return this._call.inputValues[8].value.toBigInt(); - } -} - -export class SetMaciParametersCall__Outputs { - _call: SetMaciParametersCall; - - constructor(call: SetMaciParametersCall) { - this._call = call; - } -} - export class SetRecipientRegistryCall extends ethereum.Call { get inputs(): SetRecipientRegistryCall__Inputs { return new SetRecipientRegistryCall__Inputs(this); @@ -764,6 +781,14 @@ export class TransferMatchingFundsCall__Inputs { get _totalSpentSalt(): BigInt { return this._call.inputValues[1].value.toBigInt(); } + + get _newResultCommitment(): BigInt { + return this._call.inputValues[2].value.toBigInt(); + } + + get _perVOSpentVoiceCreditsHash(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } } export class TransferMatchingFundsCall__Outputs { diff --git a/subgraph/generated/FundingRoundFactory/FundingRound.ts b/subgraph/generated/ClrFund/FundingRound.ts similarity index 97% rename from subgraph/generated/FundingRoundFactory/FundingRound.ts rename to subgraph/generated/ClrFund/FundingRound.ts index 6c3bcd6cb..bde4327d0 100644 --- a/subgraph/generated/FundingRoundFactory/FundingRound.ts +++ b/subgraph/generated/ClrFund/FundingRound.ts @@ -371,6 +371,21 @@ export class FundingRound extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toString()); } + poll(): Address { + let result = super.call("poll", "poll():(address)", []); + + return result[0].toAddress(); + } + + try_poll(): ethereum.CallResult
{ + let result = super.tryCall("poll", "poll():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + totalSpent(): BigInt { let result = super.call("totalSpent", "totalSpent():(uint256)", []); diff --git a/subgraph/generated/ClrFund/MACI.ts b/subgraph/generated/ClrFund/MACI.ts new file mode 100644 index 000000000..18150f402 --- /dev/null +++ b/subgraph/generated/ClrFund/MACI.ts @@ -0,0 +1,1087 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class DeployPoll extends ethereum.Event { + get params(): DeployPoll__Params { + return new DeployPoll__Params(this); + } +} + +export class DeployPoll__Params { + _event: DeployPoll; + + constructor(event: DeployPoll) { + this._event = event; + } + + get _pollId(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get _pollAddr(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get _pubKey(): DeployPoll_pubKeyStruct { + return changetype( + this._event.parameters[2].value.toTuple() + ); + } +} + +export class DeployPoll_pubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class Init extends ethereum.Event { + get params(): Init__Params { + return new Init__Params(this); + } +} + +export class Init__Params { + _event: Init; + + constructor(event: Init) { + this._event = event; + } + + get _vkRegistry(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get _topupCredit(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class MergeStateAq extends ethereum.Event { + get params(): MergeStateAq__Params { + return new MergeStateAq__Params(this); + } +} + +export class MergeStateAq__Params { + _event: MergeStateAq; + + constructor(event: MergeStateAq) { + this._event = event; + } + + get _pollId(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class MergeStateAqSubRoots extends ethereum.Event { + get params(): MergeStateAqSubRoots__Params { + return new MergeStateAqSubRoots__Params(this); + } +} + +export class MergeStateAqSubRoots__Params { + _event: MergeStateAqSubRoots; + + constructor(event: MergeStateAqSubRoots) { + this._event = event; + } + + get _pollId(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get _numSrQueueOps(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class OwnershipTransferred extends ethereum.Event { + get params(): OwnershipTransferred__Params { + return new OwnershipTransferred__Params(this); + } +} + +export class OwnershipTransferred__Params { + _event: OwnershipTransferred; + + constructor(event: OwnershipTransferred) { + this._event = event; + } + + get previousOwner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newOwner(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class SignUp extends ethereum.Event { + get params(): SignUp__Params { + return new SignUp__Params(this); + } +} + +export class SignUp__Params { + _event: SignUp; + + constructor(event: SignUp) { + this._event = event; + } + + get _stateIndex(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get _userPubKey(): SignUp_userPubKeyStruct { + return changetype( + this._event.parameters[1].value.toTuple() + ); + } + + get _voiceCreditBalance(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } + + get _timestamp(): BigInt { + return this._event.parameters[3].value.toBigInt(); + } +} + +export class SignUp_userPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class MACI__deployPollInput_maxValuesStruct extends ethereum.Tuple { + get maxMessages(): BigInt { + return this[0].toBigInt(); + } + + get maxVoteOptions(): BigInt { + return this[1].toBigInt(); + } +} + +export class MACI__deployPollInput_treeDepthsStruct extends ethereum.Tuple { + get intStateTreeDepth(): i32 { + return this[0].toI32(); + } + + get messageTreeSubDepth(): i32 { + return this[1].toI32(); + } + + get messageTreeDepth(): i32 { + return this[2].toI32(); + } + + get voteOptionTreeDepth(): i32 { + return this[3].toI32(); + } +} + +export class MACI__deployPollInput_coordinatorPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class MACI__hashStateLeafInput_stateLeafStruct extends ethereum.Tuple { + get pubKey(): MACI__hashStateLeafInput_stateLeafPubKeyStruct { + return changetype( + this[0].toTuple() + ); + } + + get voiceCreditBalance(): BigInt { + return this[1].toBigInt(); + } + + get timestamp(): BigInt { + return this[2].toBigInt(); + } +} + +export class MACI__hashStateLeafInput_stateLeafPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class MACI extends ethereum.SmartContract { + static bind(address: Address): MACI { + return new MACI("MACI", address); + } + + deployPoll( + _duration: BigInt, + _maxValues: MACI__deployPollInput_maxValuesStruct, + _treeDepths: MACI__deployPollInput_treeDepthsStruct, + _coordinatorPubKey: MACI__deployPollInput_coordinatorPubKeyStruct + ): Address { + let result = super.call( + "deployPoll", + "deployPoll(uint256,(uint256,uint256),(uint8,uint8,uint8,uint8),(uint256,uint256)):(address)", + [ + ethereum.Value.fromUnsignedBigInt(_duration), + ethereum.Value.fromTuple(_maxValues), + ethereum.Value.fromTuple(_treeDepths), + ethereum.Value.fromTuple(_coordinatorPubKey) + ] + ); + + return result[0].toAddress(); + } + + try_deployPoll( + _duration: BigInt, + _maxValues: MACI__deployPollInput_maxValuesStruct, + _treeDepths: MACI__deployPollInput_treeDepthsStruct, + _coordinatorPubKey: MACI__deployPollInput_coordinatorPubKeyStruct + ): ethereum.CallResult
{ + let result = super.tryCall( + "deployPoll", + "deployPoll(uint256,(uint256,uint256),(uint8,uint8,uint8,uint8),(uint256,uint256)):(address)", + [ + ethereum.Value.fromUnsignedBigInt(_duration), + ethereum.Value.fromTuple(_maxValues), + ethereum.Value.fromTuple(_treeDepths), + ethereum.Value.fromTuple(_coordinatorPubKey) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getPoll(_pollId: BigInt): Address { + let result = super.call("getPoll", "getPoll(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(_pollId) + ]); + + return result[0].toAddress(); + } + + try_getPoll(_pollId: BigInt): ethereum.CallResult
{ + let result = super.tryCall("getPoll", "getPoll(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(_pollId) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getStateAqRoot(): BigInt { + let result = super.call("getStateAqRoot", "getStateAqRoot():(uint256)", []); + + return result[0].toBigInt(); + } + + try_getStateAqRoot(): ethereum.CallResult { + let result = super.tryCall( + "getStateAqRoot", + "getStateAqRoot():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hash2(array: Array): BigInt { + let result = super.call("hash2", "hash2(uint256[2]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_hash2(array: Array): ethereum.CallResult { + let result = super.tryCall("hash2", "hash2(uint256[2]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hash3(array: Array): BigInt { + let result = super.call("hash3", "hash3(uint256[3]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_hash3(array: Array): ethereum.CallResult { + let result = super.tryCall("hash3", "hash3(uint256[3]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hash4(array: Array): BigInt { + let result = super.call("hash4", "hash4(uint256[4]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_hash4(array: Array): ethereum.CallResult { + let result = super.tryCall("hash4", "hash4(uint256[4]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hash5(array: Array): BigInt { + let result = super.call("hash5", "hash5(uint256[5]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_hash5(array: Array): ethereum.CallResult { + let result = super.tryCall("hash5", "hash5(uint256[5]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hashLeftRight(_left: BigInt, _right: BigInt): BigInt { + let result = super.call( + "hashLeftRight", + "hashLeftRight(uint256,uint256):(uint256)", + [ + ethereum.Value.fromUnsignedBigInt(_left), + ethereum.Value.fromUnsignedBigInt(_right) + ] + ); + + return result[0].toBigInt(); + } + + try_hashLeftRight( + _left: BigInt, + _right: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "hashLeftRight", + "hashLeftRight(uint256,uint256):(uint256)", + [ + ethereum.Value.fromUnsignedBigInt(_left), + ethereum.Value.fromUnsignedBigInt(_right) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hashStateLeaf(_stateLeaf: MACI__hashStateLeafInput_stateLeafStruct): BigInt { + let result = super.call( + "hashStateLeaf", + "hashStateLeaf(((uint256,uint256),uint256,uint256)):(uint256)", + [ethereum.Value.fromTuple(_stateLeaf)] + ); + + return result[0].toBigInt(); + } + + try_hashStateLeaf( + _stateLeaf: MACI__hashStateLeafInput_stateLeafStruct + ): ethereum.CallResult { + let result = super.tryCall( + "hashStateLeaf", + "hashStateLeaf(((uint256,uint256),uint256,uint256)):(uint256)", + [ethereum.Value.fromTuple(_stateLeaf)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + initialVoiceCreditProxy(): Address { + let result = super.call( + "initialVoiceCreditProxy", + "initialVoiceCreditProxy():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_initialVoiceCreditProxy(): ethereum.CallResult
{ + let result = super.tryCall( + "initialVoiceCreditProxy", + "initialVoiceCreditProxy():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + isInitialised(): boolean { + let result = super.call("isInitialised", "isInitialised():(bool)", []); + + return result[0].toBoolean(); + } + + try_isInitialised(): ethereum.CallResult { + let result = super.tryCall("isInitialised", "isInitialised():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + mergeStateAq(_pollId: BigInt): BigInt { + let result = super.call("mergeStateAq", "mergeStateAq(uint256):(uint256)", [ + ethereum.Value.fromUnsignedBigInt(_pollId) + ]); + + return result[0].toBigInt(); + } + + try_mergeStateAq(_pollId: BigInt): ethereum.CallResult { + let result = super.tryCall( + "mergeStateAq", + "mergeStateAq(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(_pollId)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + nextPollId(): BigInt { + let result = super.call("nextPollId", "nextPollId():(uint256)", []); + + return result[0].toBigInt(); + } + + try_nextPollId(): ethereum.CallResult { + let result = super.tryCall("nextPollId", "nextPollId():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + numSignUps(): BigInt { + let result = super.call("numSignUps", "numSignUps():(uint256)", []); + + return result[0].toBigInt(); + } + + try_numSignUps(): ethereum.CallResult { + let result = super.tryCall("numSignUps", "numSignUps():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + numStateLeaves(param0: BigInt): BigInt { + let result = super.call( + "numStateLeaves", + "numStateLeaves(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(param0)] + ); + + return result[0].toBigInt(); + } + + try_numStateLeaves(param0: BigInt): ethereum.CallResult { + let result = super.tryCall( + "numStateLeaves", + "numStateLeaves(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(param0)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + owner(): Address { + let result = super.call("owner", "owner():(address)", []); + + return result[0].toAddress(); + } + + try_owner(): ethereum.CallResult
{ + let result = super.tryCall("owner", "owner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + pollFactory(): Address { + let result = super.call("pollFactory", "pollFactory():(address)", []); + + return result[0].toAddress(); + } + + try_pollFactory(): ethereum.CallResult
{ + let result = super.tryCall("pollFactory", "pollFactory():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + polls(param0: BigInt): Address { + let result = super.call("polls", "polls(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); + + return result[0].toAddress(); + } + + try_polls(param0: BigInt): ethereum.CallResult
{ + let result = super.tryCall("polls", "polls(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + sha256Hash(array: Array): BigInt { + let result = super.call("sha256Hash", "sha256Hash(uint256[]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_sha256Hash(array: Array): ethereum.CallResult { + let result = super.tryCall( + "sha256Hash", + "sha256Hash(uint256[]):(uint256)", + [ethereum.Value.fromUnsignedBigIntArray(array)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + signUpGatekeeper(): Address { + let result = super.call( + "signUpGatekeeper", + "signUpGatekeeper():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_signUpGatekeeper(): ethereum.CallResult
{ + let result = super.tryCall( + "signUpGatekeeper", + "signUpGatekeeper():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + signUpTimestamp(): BigInt { + let result = super.call( + "signUpTimestamp", + "signUpTimestamp():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_signUpTimestamp(): ethereum.CallResult { + let result = super.tryCall( + "signUpTimestamp", + "signUpTimestamp():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + stateAq(): Address { + let result = super.call("stateAq", "stateAq():(address)", []); + + return result[0].toAddress(); + } + + try_stateAq(): ethereum.CallResult
{ + let result = super.tryCall("stateAq", "stateAq():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + stateTreeDepth(): i32 { + let result = super.call("stateTreeDepth", "stateTreeDepth():(uint8)", []); + + return result[0].toI32(); + } + + try_stateTreeDepth(): ethereum.CallResult { + let result = super.tryCall( + "stateTreeDepth", + "stateTreeDepth():(uint8)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + topupCredit(): Address { + let result = super.call("topupCredit", "topupCredit():(address)", []); + + return result[0].toAddress(); + } + + try_topupCredit(): ethereum.CallResult
{ + let result = super.tryCall("topupCredit", "topupCredit():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + vkRegistry(): Address { + let result = super.call("vkRegistry", "vkRegistry():(address)", []); + + return result[0].toAddress(); + } + + try_vkRegistry(): ethereum.CallResult
{ + let result = super.tryCall("vkRegistry", "vkRegistry():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get _pollFactory(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get _signUpGatekeeper(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get _initialVoiceCreditProxy(): Address { + return this._call.inputValues[2].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class DeployPollCall extends ethereum.Call { + get inputs(): DeployPollCall__Inputs { + return new DeployPollCall__Inputs(this); + } + + get outputs(): DeployPollCall__Outputs { + return new DeployPollCall__Outputs(this); + } +} + +export class DeployPollCall__Inputs { + _call: DeployPollCall; + + constructor(call: DeployPollCall) { + this._call = call; + } + + get _duration(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get _maxValues(): DeployPollCall_maxValuesStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get _treeDepths(): DeployPollCall_treeDepthsStruct { + return changetype( + this._call.inputValues[2].value.toTuple() + ); + } + + get _coordinatorPubKey(): DeployPollCall_coordinatorPubKeyStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } +} + +export class DeployPollCall__Outputs { + _call: DeployPollCall; + + constructor(call: DeployPollCall) { + this._call = call; + } + + get value0(): Address { + return this._call.outputValues[0].value.toAddress(); + } +} + +export class DeployPollCall_maxValuesStruct extends ethereum.Tuple { + get maxMessages(): BigInt { + return this[0].toBigInt(); + } + + get maxVoteOptions(): BigInt { + return this[1].toBigInt(); + } +} + +export class DeployPollCall_treeDepthsStruct extends ethereum.Tuple { + get intStateTreeDepth(): i32 { + return this[0].toI32(); + } + + get messageTreeSubDepth(): i32 { + return this[1].toI32(); + } + + get messageTreeDepth(): i32 { + return this[2].toI32(); + } + + get voteOptionTreeDepth(): i32 { + return this[3].toI32(); + } +} + +export class DeployPollCall_coordinatorPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class InitCall extends ethereum.Call { + get inputs(): InitCall__Inputs { + return new InitCall__Inputs(this); + } + + get outputs(): InitCall__Outputs { + return new InitCall__Outputs(this); + } +} + +export class InitCall__Inputs { + _call: InitCall; + + constructor(call: InitCall) { + this._call = call; + } + + get _vkRegistry(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get _topupCredit(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class InitCall__Outputs { + _call: InitCall; + + constructor(call: InitCall) { + this._call = call; + } +} + +export class MergeStateAqCall extends ethereum.Call { + get inputs(): MergeStateAqCall__Inputs { + return new MergeStateAqCall__Inputs(this); + } + + get outputs(): MergeStateAqCall__Outputs { + return new MergeStateAqCall__Outputs(this); + } +} + +export class MergeStateAqCall__Inputs { + _call: MergeStateAqCall; + + constructor(call: MergeStateAqCall) { + this._call = call; + } + + get _pollId(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class MergeStateAqCall__Outputs { + _call: MergeStateAqCall; + + constructor(call: MergeStateAqCall) { + this._call = call; + } + + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); + } +} + +export class MergeStateAqSubRootsCall extends ethereum.Call { + get inputs(): MergeStateAqSubRootsCall__Inputs { + return new MergeStateAqSubRootsCall__Inputs(this); + } + + get outputs(): MergeStateAqSubRootsCall__Outputs { + return new MergeStateAqSubRootsCall__Outputs(this); + } +} + +export class MergeStateAqSubRootsCall__Inputs { + _call: MergeStateAqSubRootsCall; + + constructor(call: MergeStateAqSubRootsCall) { + this._call = call; + } + + get _numSrQueueOps(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get _pollId(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class MergeStateAqSubRootsCall__Outputs { + _call: MergeStateAqSubRootsCall; + + constructor(call: MergeStateAqSubRootsCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall extends ethereum.Call { + get inputs(): RenounceOwnershipCall__Inputs { + return new RenounceOwnershipCall__Inputs(this); + } + + get outputs(): RenounceOwnershipCall__Outputs { + return new RenounceOwnershipCall__Outputs(this); + } +} + +export class RenounceOwnershipCall__Inputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall__Outputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class SignUpCall extends ethereum.Call { + get inputs(): SignUpCall__Inputs { + return new SignUpCall__Inputs(this); + } + + get outputs(): SignUpCall__Outputs { + return new SignUpCall__Outputs(this); + } +} + +export class SignUpCall__Inputs { + _call: SignUpCall; + + constructor(call: SignUpCall) { + this._call = call; + } + + get _pubKey(): SignUpCall_pubKeyStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get _signUpGatekeeperData(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } + + get _initialVoiceCreditProxyData(): Bytes { + return this._call.inputValues[2].value.toBytes(); + } +} + +export class SignUpCall__Outputs { + _call: SignUpCall; + + constructor(call: SignUpCall) { + this._call = call; + } +} + +export class SignUpCall_pubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class TransferOwnershipCall extends ethereum.Call { + get inputs(): TransferOwnershipCall__Inputs { + return new TransferOwnershipCall__Inputs(this); + } + + get outputs(): TransferOwnershipCall__Outputs { + return new TransferOwnershipCall__Outputs(this); + } +} + +export class TransferOwnershipCall__Inputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } + + get newOwner(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class TransferOwnershipCall__Outputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } +} diff --git a/subgraph/generated/ClrFund/MACIFactory.ts b/subgraph/generated/ClrFund/MACIFactory.ts new file mode 100644 index 000000000..a19443043 --- /dev/null +++ b/subgraph/generated/ClrFund/MACIFactory.ts @@ -0,0 +1,816 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class MaciDeployed extends ethereum.Event { + get params(): MaciDeployed__Params { + return new MaciDeployed__Params(this); + } +} + +export class MaciDeployed__Params { + _event: MaciDeployed; + + constructor(event: MaciDeployed) { + this._event = event; + } + + get _maci(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class MaciParametersChanged extends ethereum.Event { + get params(): MaciParametersChanged__Params { + return new MaciParametersChanged__Params(this); + } +} + +export class MaciParametersChanged__Params { + _event: MaciParametersChanged; + + constructor(event: MaciParametersChanged) { + this._event = event; + } +} + +export class OwnershipTransferred extends ethereum.Event { + get params(): OwnershipTransferred__Params { + return new OwnershipTransferred__Params(this); + } +} + +export class OwnershipTransferred__Params { + _event: OwnershipTransferred; + + constructor(event: OwnershipTransferred) { + this._event = event; + } + + get previousOwner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newOwner(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class MACIFactory__deployMaciInputCoordinatorPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class MACIFactory__maxValuesResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getMaxMessages(): BigInt { + return this.value0; + } + + getMaxVoteOptions(): BigInt { + return this.value1; + } +} + +export class MACIFactory__treeDepthsResult { + value0: i32; + value1: i32; + value2: i32; + value3: i32; + + constructor(value0: i32, value1: i32, value2: i32, value3: i32) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set( + "value0", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value0)) + ); + map.set( + "value1", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) + ); + map.set( + "value2", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value2)) + ); + map.set( + "value3", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value3)) + ); + return map; + } + + getIntStateTreeDepth(): i32 { + return this.value0; + } + + getMessageTreeSubDepth(): i32 { + return this.value1; + } + + getMessageTreeDepth(): i32 { + return this.value2; + } + + getVoteOptionTreeDepth(): i32 { + return this.value3; + } +} + +export class MACIFactory extends ethereum.SmartContract { + static bind(address: Address): MACIFactory { + return new MACIFactory("MACIFactory", address); + } + + deployMaci( + signUpGatekeeper: Address, + initialVoiceCreditProxy: Address, + topupCredit: Address, + duration: BigInt, + coordinator: Address, + coordinatorPubKey: MACIFactory__deployMaciInputCoordinatorPubKeyStruct + ): Address { + let result = super.call( + "deployMaci", + "deployMaci(address,address,address,uint256,address,(uint256,uint256)):(address)", + [ + ethereum.Value.fromAddress(signUpGatekeeper), + ethereum.Value.fromAddress(initialVoiceCreditProxy), + ethereum.Value.fromAddress(topupCredit), + ethereum.Value.fromUnsignedBigInt(duration), + ethereum.Value.fromAddress(coordinator), + ethereum.Value.fromTuple(coordinatorPubKey) + ] + ); + + return result[0].toAddress(); + } + + try_deployMaci( + signUpGatekeeper: Address, + initialVoiceCreditProxy: Address, + topupCredit: Address, + duration: BigInt, + coordinator: Address, + coordinatorPubKey: MACIFactory__deployMaciInputCoordinatorPubKeyStruct + ): ethereum.CallResult
{ + let result = super.tryCall( + "deployMaci", + "deployMaci(address,address,address,uint256,address,(uint256,uint256)):(address)", + [ + ethereum.Value.fromAddress(signUpGatekeeper), + ethereum.Value.fromAddress(initialVoiceCreditProxy), + ethereum.Value.fromAddress(topupCredit), + ethereum.Value.fromUnsignedBigInt(duration), + ethereum.Value.fromAddress(coordinator), + ethereum.Value.fromTuple(coordinatorPubKey) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + maxValues(): MACIFactory__maxValuesResult { + let result = super.call("maxValues", "maxValues():(uint256,uint256)", []); + + return new MACIFactory__maxValuesResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_maxValues(): ethereum.CallResult { + let result = super.tryCall( + "maxValues", + "maxValues():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MACIFactory__maxValuesResult(value[0].toBigInt(), value[1].toBigInt()) + ); + } + + messageBatchSize(): BigInt { + let result = super.call( + "messageBatchSize", + "messageBatchSize():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_messageBatchSize(): ethereum.CallResult { + let result = super.tryCall( + "messageBatchSize", + "messageBatchSize():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + owner(): Address { + let result = super.call("owner", "owner():(address)", []); + + return result[0].toAddress(); + } + + try_owner(): ethereum.CallResult
{ + let result = super.tryCall("owner", "owner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + pollFactory(): Address { + let result = super.call("pollFactory", "pollFactory():(address)", []); + + return result[0].toAddress(); + } + + try_pollFactory(): ethereum.CallResult
{ + let result = super.tryCall("pollFactory", "pollFactory():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + stateTreeDepth(): i32 { + let result = super.call("stateTreeDepth", "stateTreeDepth():(uint8)", []); + + return result[0].toI32(); + } + + try_stateTreeDepth(): ethereum.CallResult { + let result = super.tryCall( + "stateTreeDepth", + "stateTreeDepth():(uint8)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toI32()); + } + + treeDepths(): MACIFactory__treeDepthsResult { + let result = super.call( + "treeDepths", + "treeDepths():(uint8,uint8,uint8,uint8)", + [] + ); + + return new MACIFactory__treeDepthsResult( + result[0].toI32(), + result[1].toI32(), + result[2].toI32(), + result[3].toI32() + ); + } + + try_treeDepths(): ethereum.CallResult { + let result = super.tryCall( + "treeDepths", + "treeDepths():(uint8,uint8,uint8,uint8)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new MACIFactory__treeDepthsResult( + value[0].toI32(), + value[1].toI32(), + value[2].toI32(), + value[3].toI32() + ) + ); + } + + vkRegistry(): Address { + let result = super.call("vkRegistry", "vkRegistry():(address)", []); + + return result[0].toAddress(); + } + + try_vkRegistry(): ethereum.CallResult
{ + let result = super.tryCall("vkRegistry", "vkRegistry():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get _vkRegistry(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get _pollFactory(): Address { + return this._call.inputValues[1].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class DeployMaciCall extends ethereum.Call { + get inputs(): DeployMaciCall__Inputs { + return new DeployMaciCall__Inputs(this); + } + + get outputs(): DeployMaciCall__Outputs { + return new DeployMaciCall__Outputs(this); + } +} + +export class DeployMaciCall__Inputs { + _call: DeployMaciCall; + + constructor(call: DeployMaciCall) { + this._call = call; + } + + get signUpGatekeeper(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get initialVoiceCreditProxy(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get topupCredit(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get duration(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get coordinator(): Address { + return this._call.inputValues[4].value.toAddress(); + } + + get coordinatorPubKey(): DeployMaciCallCoordinatorPubKeyStruct { + return changetype( + this._call.inputValues[5].value.toTuple() + ); + } +} + +export class DeployMaciCall__Outputs { + _call: DeployMaciCall; + + constructor(call: DeployMaciCall) { + this._call = call; + } + + get _maci(): Address { + return this._call.outputValues[0].value.toAddress(); + } +} + +export class DeployMaciCallCoordinatorPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class RenounceOwnershipCall extends ethereum.Call { + get inputs(): RenounceOwnershipCall__Inputs { + return new RenounceOwnershipCall__Inputs(this); + } + + get outputs(): RenounceOwnershipCall__Outputs { + return new RenounceOwnershipCall__Outputs(this); + } +} + +export class RenounceOwnershipCall__Inputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall__Outputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class SetMaciParametersCall extends ethereum.Call { + get inputs(): SetMaciParametersCall__Inputs { + return new SetMaciParametersCall__Inputs(this); + } + + get outputs(): SetMaciParametersCall__Outputs { + return new SetMaciParametersCall__Outputs(this); + } +} + +export class SetMaciParametersCall__Inputs { + _call: SetMaciParametersCall; + + constructor(call: SetMaciParametersCall) { + this._call = call; + } + + get _stateTreeDepth(): i32 { + return this._call.inputValues[0].value.toI32(); + } + + get _treeDepths(): SetMaciParametersCall_treeDepthsStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get _maxValues(): SetMaciParametersCall_maxValuesStruct { + return changetype( + this._call.inputValues[2].value.toTuple() + ); + } + + get _messageBatchSize(): BigInt { + return this._call.inputValues[3].value.toBigInt(); + } + + get _processVk(): SetMaciParametersCall_processVkStruct { + return changetype( + this._call.inputValues[4].value.toTuple() + ); + } + + get _tallyVk(): SetMaciParametersCall_tallyVkStruct { + return changetype( + this._call.inputValues[5].value.toTuple() + ); + } +} + +export class SetMaciParametersCall__Outputs { + _call: SetMaciParametersCall; + + constructor(call: SetMaciParametersCall) { + this._call = call; + } +} + +export class SetMaciParametersCall_treeDepthsStruct extends ethereum.Tuple { + get intStateTreeDepth(): i32 { + return this[0].toI32(); + } + + get messageTreeSubDepth(): i32 { + return this[1].toI32(); + } + + get messageTreeDepth(): i32 { + return this[2].toI32(); + } + + get voteOptionTreeDepth(): i32 { + return this[3].toI32(); + } +} + +export class SetMaciParametersCall_maxValuesStruct extends ethereum.Tuple { + get maxMessages(): BigInt { + return this[0].toBigInt(); + } + + get maxVoteOptions(): BigInt { + return this[1].toBigInt(); + } +} + +export class SetMaciParametersCall_processVkStruct extends ethereum.Tuple { + get alpha1(): SetMaciParametersCall_processVkAlpha1Struct { + return changetype( + this[0].toTuple() + ); + } + + get beta2(): SetMaciParametersCall_processVkBeta2Struct { + return changetype( + this[1].toTuple() + ); + } + + get gamma2(): SetMaciParametersCall_processVkGamma2Struct { + return changetype( + this[2].toTuple() + ); + } + + get delta2(): SetMaciParametersCall_processVkDelta2Struct { + return changetype( + this[3].toTuple() + ); + } + + get ic(): Array { + return this[4].toTupleArray(); + } +} + +export class SetMaciParametersCall_processVkAlpha1Struct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class SetMaciParametersCall_processVkBeta2Struct extends ethereum.Tuple { + get x(): Array { + return this[0].toBigIntArray(); + } + + get y(): Array { + return this[1].toBigIntArray(); + } +} + +export class SetMaciParametersCall_processVkGamma2Struct extends ethereum.Tuple { + get x(): Array { + return this[0].toBigIntArray(); + } + + get y(): Array { + return this[1].toBigIntArray(); + } +} + +export class SetMaciParametersCall_processVkDelta2Struct extends ethereum.Tuple { + get x(): Array { + return this[0].toBigIntArray(); + } + + get y(): Array { + return this[1].toBigIntArray(); + } +} + +export class SetMaciParametersCall_processVkIcStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class SetMaciParametersCall_tallyVkStruct extends ethereum.Tuple { + get alpha1(): SetMaciParametersCall_tallyVkAlpha1Struct { + return changetype( + this[0].toTuple() + ); + } + + get beta2(): SetMaciParametersCall_tallyVkBeta2Struct { + return changetype( + this[1].toTuple() + ); + } + + get gamma2(): SetMaciParametersCall_tallyVkGamma2Struct { + return changetype( + this[2].toTuple() + ); + } + + get delta2(): SetMaciParametersCall_tallyVkDelta2Struct { + return changetype( + this[3].toTuple() + ); + } + + get ic(): Array { + return this[4].toTupleArray(); + } +} + +export class SetMaciParametersCall_tallyVkAlpha1Struct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class SetMaciParametersCall_tallyVkBeta2Struct extends ethereum.Tuple { + get x(): Array { + return this[0].toBigIntArray(); + } + + get y(): Array { + return this[1].toBigIntArray(); + } +} + +export class SetMaciParametersCall_tallyVkGamma2Struct extends ethereum.Tuple { + get x(): Array { + return this[0].toBigIntArray(); + } + + get y(): Array { + return this[1].toBigIntArray(); + } +} + +export class SetMaciParametersCall_tallyVkDelta2Struct extends ethereum.Tuple { + get x(): Array { + return this[0].toBigIntArray(); + } + + get y(): Array { + return this[1].toBigIntArray(); + } +} + +export class SetMaciParametersCall_tallyVkIcStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class SetPollFactoryCall extends ethereum.Call { + get inputs(): SetPollFactoryCall__Inputs { + return new SetPollFactoryCall__Inputs(this); + } + + get outputs(): SetPollFactoryCall__Outputs { + return new SetPollFactoryCall__Outputs(this); + } +} + +export class SetPollFactoryCall__Inputs { + _call: SetPollFactoryCall; + + constructor(call: SetPollFactoryCall) { + this._call = call; + } + + get _pollFactory(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetPollFactoryCall__Outputs { + _call: SetPollFactoryCall; + + constructor(call: SetPollFactoryCall) { + this._call = call; + } +} + +export class SetVkRegistryCall extends ethereum.Call { + get inputs(): SetVkRegistryCall__Inputs { + return new SetVkRegistryCall__Inputs(this); + } + + get outputs(): SetVkRegistryCall__Outputs { + return new SetVkRegistryCall__Outputs(this); + } +} + +export class SetVkRegistryCall__Inputs { + _call: SetVkRegistryCall; + + constructor(call: SetVkRegistryCall) { + this._call = call; + } + + get _vkRegistry(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetVkRegistryCall__Outputs { + _call: SetVkRegistryCall; + + constructor(call: SetVkRegistryCall) { + this._call = call; + } +} + +export class TransferOwnershipCall extends ethereum.Call { + get inputs(): TransferOwnershipCall__Inputs { + return new TransferOwnershipCall__Inputs(this); + } + + get outputs(): TransferOwnershipCall__Outputs { + return new TransferOwnershipCall__Outputs(this); + } +} + +export class TransferOwnershipCall__Inputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } + + get newOwner(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class TransferOwnershipCall__Outputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } +} diff --git a/subgraph/generated/FundingRoundFactory/OptimisticRecipientRegistry.ts b/subgraph/generated/ClrFund/OptimisticRecipientRegistry.ts similarity index 96% rename from subgraph/generated/FundingRoundFactory/OptimisticRecipientRegistry.ts rename to subgraph/generated/ClrFund/OptimisticRecipientRegistry.ts index 20d805ce5..afb85c261 100644 --- a/subgraph/generated/FundingRoundFactory/OptimisticRecipientRegistry.ts +++ b/subgraph/generated/ClrFund/OptimisticRecipientRegistry.ts @@ -255,6 +255,29 @@ export class OptimisticRecipientRegistry extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toAddress()); } + getRecipientCount(): BigInt { + let result = super.call( + "getRecipientCount", + "getRecipientCount():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getRecipientCount(): ethereum.CallResult { + let result = super.tryCall( + "getRecipientCount", + "getRecipientCount():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + maxRecipients(): BigInt { let result = super.call("maxRecipients", "maxRecipients():(uint256)", []); diff --git a/subgraph/generated/ClrFund/Poll.ts b/subgraph/generated/ClrFund/Poll.ts new file mode 100644 index 000000000..193c7b156 --- /dev/null +++ b/subgraph/generated/ClrFund/Poll.ts @@ -0,0 +1,1461 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class MergeMaciStateAq extends ethereum.Event { + get params(): MergeMaciStateAq__Params { + return new MergeMaciStateAq__Params(this); + } +} + +export class MergeMaciStateAq__Params { + _event: MergeMaciStateAq; + + constructor(event: MergeMaciStateAq) { + this._event = event; + } + + get _stateRoot(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class MergeMaciStateAqSubRoots extends ethereum.Event { + get params(): MergeMaciStateAqSubRoots__Params { + return new MergeMaciStateAqSubRoots__Params(this); + } +} + +export class MergeMaciStateAqSubRoots__Params { + _event: MergeMaciStateAqSubRoots; + + constructor(event: MergeMaciStateAqSubRoots) { + this._event = event; + } + + get _numSrQueueOps(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class MergeMessageAq extends ethereum.Event { + get params(): MergeMessageAq__Params { + return new MergeMessageAq__Params(this); + } +} + +export class MergeMessageAq__Params { + _event: MergeMessageAq; + + constructor(event: MergeMessageAq) { + this._event = event; + } + + get _messageRoot(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class MergeMessageAqSubRoots extends ethereum.Event { + get params(): MergeMessageAqSubRoots__Params { + return new MergeMessageAqSubRoots__Params(this); + } +} + +export class MergeMessageAqSubRoots__Params { + _event: MergeMessageAqSubRoots; + + constructor(event: MergeMessageAqSubRoots) { + this._event = event; + } + + get _numSrQueueOps(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class OwnershipTransferred extends ethereum.Event { + get params(): OwnershipTransferred__Params { + return new OwnershipTransferred__Params(this); + } +} + +export class OwnershipTransferred__Params { + _event: OwnershipTransferred; + + constructor(event: OwnershipTransferred) { + this._event = event; + } + + get previousOwner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newOwner(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class PublishMessage extends ethereum.Event { + get params(): PublishMessage__Params { + return new PublishMessage__Params(this); + } +} + +export class PublishMessage__Params { + _event: PublishMessage; + + constructor(event: PublishMessage) { + this._event = event; + } + + get _message(): PublishMessage_messageStruct { + return changetype( + this._event.parameters[0].value.toTuple() + ); + } + + get _encPubKey(): PublishMessage_encPubKeyStruct { + return changetype( + this._event.parameters[1].value.toTuple() + ); + } +} + +export class PublishMessage_messageStruct extends ethereum.Tuple { + get msgType(): BigInt { + return this[0].toBigInt(); + } + + get data(): Array { + return this[1].toBigIntArray(); + } +} + +export class PublishMessage_encPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class TopupMessage extends ethereum.Event { + get params(): TopupMessage__Params { + return new TopupMessage__Params(this); + } +} + +export class TopupMessage__Params { + _event: TopupMessage; + + constructor(event: TopupMessage) { + this._event = event; + } + + get _message(): TopupMessage_messageStruct { + return changetype( + this._event.parameters[0].value.toTuple() + ); + } +} + +export class TopupMessage_messageStruct extends ethereum.Tuple { + get msgType(): BigInt { + return this[0].toBigInt(); + } + + get data(): Array { + return this[1].toBigIntArray(); + } +} + +export class Poll__batchSizesResult { + value0: i32; + value1: i32; + value2: i32; + + constructor(value0: i32, value1: i32, value2: i32) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set( + "value0", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value0)) + ); + map.set( + "value1", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) + ); + map.set( + "value2", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value2)) + ); + return map; + } + + getMessageBatchSize(): i32 { + return this.value0; + } + + getTallyBatchSize(): i32 { + return this.value1; + } + + getSubsidyBatchSize(): i32 { + return this.value2; + } +} + +export class Poll__coordinatorPubKeyResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getX(): BigInt { + return this.value0; + } + + getY(): BigInt { + return this.value1; + } +} + +export class Poll__extContractsResult { + value0: Address; + value1: Address; + value2: Address; + value3: Address; + + constructor( + value0: Address, + value1: Address, + value2: Address, + value3: Address + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set("value1", ethereum.Value.fromAddress(this.value1)); + map.set("value2", ethereum.Value.fromAddress(this.value2)); + map.set("value3", ethereum.Value.fromAddress(this.value3)); + return map; + } + + getVkRegistry(): Address { + return this.value0; + } + + getMaci(): Address { + return this.value1; + } + + getMessageAq(): Address { + return this.value2; + } + + getTopupCredit(): Address { + return this.value3; + } +} + +export class Poll__getDeployTimeAndDurationResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getValue0(): BigInt { + return this.value0; + } + + getValue1(): BigInt { + return this.value1; + } +} + +export class Poll__hashMessageAndEncPubKeyInput_messageStruct extends ethereum.Tuple { + get msgType(): BigInt { + return this[0].toBigInt(); + } + + get data(): Array { + return this[1].toBigIntArray(); + } +} + +export class Poll__hashMessageAndEncPubKeyInput_encPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class Poll__maxValuesResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getMaxMessages(): BigInt { + return this.value0; + } + + getMaxVoteOptions(): BigInt { + return this.value1; + } +} + +export class Poll__numSignUpsAndMessagesResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getValue0(): BigInt { + return this.value0; + } + + getValue1(): BigInt { + return this.value1; + } +} + +export class Poll__padAndHashMessageResultValue0Struct extends ethereum.Tuple { + get msgType(): BigInt { + return this[0].toBigInt(); + } + + get data(): Array { + return this[1].toBigIntArray(); + } +} + +export class Poll__padAndHashMessageResultValue1Struct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class Poll__padAndHashMessageResult { + value0: Poll__padAndHashMessageResultValue0Struct; + value1: Poll__padAndHashMessageResultValue1Struct; + value2: BigInt; + + constructor( + value0: Poll__padAndHashMessageResultValue0Struct, + value1: Poll__padAndHashMessageResultValue1Struct, + value2: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromTuple(this.value0)); + map.set("value1", ethereum.Value.fromTuple(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } + + getValue0(): Poll__padAndHashMessageResultValue0Struct { + return this.value0; + } + + getValue1(): Poll__padAndHashMessageResultValue1Struct { + return this.value1; + } + + getValue2(): BigInt { + return this.value2; + } +} + +export class Poll__treeDepthsResult { + value0: i32; + value1: i32; + value2: i32; + value3: i32; + + constructor(value0: i32, value1: i32, value2: i32, value3: i32) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set( + "value0", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value0)) + ); + map.set( + "value1", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) + ); + map.set( + "value2", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value2)) + ); + map.set( + "value3", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value3)) + ); + return map; + } + + getIntStateTreeDepth(): i32 { + return this.value0; + } + + getMessageTreeSubDepth(): i32 { + return this.value1; + } + + getMessageTreeDepth(): i32 { + return this.value2; + } + + getVoteOptionTreeDepth(): i32 { + return this.value3; + } +} + +export class Poll extends ethereum.SmartContract { + static bind(address: Address): Poll { + return new Poll("Poll", address); + } + + batchSizes(): Poll__batchSizesResult { + let result = super.call( + "batchSizes", + "batchSizes():(uint24,uint24,uint24)", + [] + ); + + return new Poll__batchSizesResult( + result[0].toI32(), + result[1].toI32(), + result[2].toI32() + ); + } + + try_batchSizes(): ethereum.CallResult { + let result = super.tryCall( + "batchSizes", + "batchSizes():(uint24,uint24,uint24)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__batchSizesResult( + value[0].toI32(), + value[1].toI32(), + value[2].toI32() + ) + ); + } + + coordinatorPubKey(): Poll__coordinatorPubKeyResult { + let result = super.call( + "coordinatorPubKey", + "coordinatorPubKey():(uint256,uint256)", + [] + ); + + return new Poll__coordinatorPubKeyResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_coordinatorPubKey(): ethereum.CallResult { + let result = super.tryCall( + "coordinatorPubKey", + "coordinatorPubKey():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__coordinatorPubKeyResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + coordinatorPubKeyHash(): BigInt { + let result = super.call( + "coordinatorPubKeyHash", + "coordinatorPubKeyHash():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_coordinatorPubKeyHash(): ethereum.CallResult { + let result = super.tryCall( + "coordinatorPubKeyHash", + "coordinatorPubKeyHash():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + currentSbCommitment(): BigInt { + let result = super.call( + "currentSbCommitment", + "currentSbCommitment():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_currentSbCommitment(): ethereum.CallResult { + let result = super.tryCall( + "currentSbCommitment", + "currentSbCommitment():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + extContracts(): Poll__extContractsResult { + let result = super.call( + "extContracts", + "extContracts():(address,address,address,address)", + [] + ); + + return new Poll__extContractsResult( + result[0].toAddress(), + result[1].toAddress(), + result[2].toAddress(), + result[3].toAddress() + ); + } + + try_extContracts(): ethereum.CallResult { + let result = super.tryCall( + "extContracts", + "extContracts():(address,address,address,address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__extContractsResult( + value[0].toAddress(), + value[1].toAddress(), + value[2].toAddress(), + value[3].toAddress() + ) + ); + } + + getDeployTimeAndDuration(): Poll__getDeployTimeAndDurationResult { + let result = super.call( + "getDeployTimeAndDuration", + "getDeployTimeAndDuration():(uint256,uint256)", + [] + ); + + return new Poll__getDeployTimeAndDurationResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_getDeployTimeAndDuration(): ethereum.CallResult< + Poll__getDeployTimeAndDurationResult + > { + let result = super.tryCall( + "getDeployTimeAndDuration", + "getDeployTimeAndDuration():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__getDeployTimeAndDurationResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + hash2(array: Array): BigInt { + let result = super.call("hash2", "hash2(uint256[2]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_hash2(array: Array): ethereum.CallResult { + let result = super.tryCall("hash2", "hash2(uint256[2]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hash3(array: Array): BigInt { + let result = super.call("hash3", "hash3(uint256[3]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_hash3(array: Array): ethereum.CallResult { + let result = super.tryCall("hash3", "hash3(uint256[3]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hash4(array: Array): BigInt { + let result = super.call("hash4", "hash4(uint256[4]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_hash4(array: Array): ethereum.CallResult { + let result = super.tryCall("hash4", "hash4(uint256[4]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hash5(array: Array): BigInt { + let result = super.call("hash5", "hash5(uint256[5]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_hash5(array: Array): ethereum.CallResult { + let result = super.tryCall("hash5", "hash5(uint256[5]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hashLeftRight(_left: BigInt, _right: BigInt): BigInt { + let result = super.call( + "hashLeftRight", + "hashLeftRight(uint256,uint256):(uint256)", + [ + ethereum.Value.fromUnsignedBigInt(_left), + ethereum.Value.fromUnsignedBigInt(_right) + ] + ); + + return result[0].toBigInt(); + } + + try_hashLeftRight( + _left: BigInt, + _right: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "hashLeftRight", + "hashLeftRight(uint256,uint256):(uint256)", + [ + ethereum.Value.fromUnsignedBigInt(_left), + ethereum.Value.fromUnsignedBigInt(_right) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hashMessageAndEncPubKey( + _message: Poll__hashMessageAndEncPubKeyInput_messageStruct, + _encPubKey: Poll__hashMessageAndEncPubKeyInput_encPubKeyStruct + ): BigInt { + let result = super.call( + "hashMessageAndEncPubKey", + "hashMessageAndEncPubKey((uint256,uint256[10]),(uint256,uint256)):(uint256)", + [ethereum.Value.fromTuple(_message), ethereum.Value.fromTuple(_encPubKey)] + ); + + return result[0].toBigInt(); + } + + try_hashMessageAndEncPubKey( + _message: Poll__hashMessageAndEncPubKeyInput_messageStruct, + _encPubKey: Poll__hashMessageAndEncPubKeyInput_encPubKeyStruct + ): ethereum.CallResult { + let result = super.tryCall( + "hashMessageAndEncPubKey", + "hashMessageAndEncPubKey((uint256,uint256[10]),(uint256,uint256)):(uint256)", + [ethereum.Value.fromTuple(_message), ethereum.Value.fromTuple(_encPubKey)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + maxValues(): Poll__maxValuesResult { + let result = super.call("maxValues", "maxValues():(uint256,uint256)", []); + + return new Poll__maxValuesResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_maxValues(): ethereum.CallResult { + let result = super.tryCall( + "maxValues", + "maxValues():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__maxValuesResult(value[0].toBigInt(), value[1].toBigInt()) + ); + } + + mergedStateRoot(): BigInt { + let result = super.call( + "mergedStateRoot", + "mergedStateRoot():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_mergedStateRoot(): ethereum.CallResult { + let result = super.tryCall( + "mergedStateRoot", + "mergedStateRoot():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + numSignUpsAndMessages(): Poll__numSignUpsAndMessagesResult { + let result = super.call( + "numSignUpsAndMessages", + "numSignUpsAndMessages():(uint256,uint256)", + [] + ); + + return new Poll__numSignUpsAndMessagesResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_numSignUpsAndMessages(): ethereum.CallResult< + Poll__numSignUpsAndMessagesResult + > { + let result = super.tryCall( + "numSignUpsAndMessages", + "numSignUpsAndMessages():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__numSignUpsAndMessagesResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + owner(): Address { + let result = super.call("owner", "owner():(address)", []); + + return result[0].toAddress(); + } + + try_owner(): ethereum.CallResult
{ + let result = super.tryCall("owner", "owner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + padAndHashMessage( + dataToPad: Array, + msgType: BigInt + ): Poll__padAndHashMessageResult { + let result = super.call( + "padAndHashMessage", + "padAndHashMessage(uint256[2],uint256):((uint256,uint256[10]),(uint256,uint256),uint256)", + [ + ethereum.Value.fromUnsignedBigIntArray(dataToPad), + ethereum.Value.fromUnsignedBigInt(msgType) + ] + ); + + return changetype( + new Poll__padAndHashMessageResult( + changetype( + result[0].toTuple() + ), + changetype( + result[1].toTuple() + ), + result[2].toBigInt() + ) + ); + } + + try_padAndHashMessage( + dataToPad: Array, + msgType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "padAndHashMessage", + "padAndHashMessage(uint256[2],uint256):((uint256,uint256[10]),(uint256,uint256),uint256)", + [ + ethereum.Value.fromUnsignedBigIntArray(dataToPad), + ethereum.Value.fromUnsignedBigInt(msgType) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + changetype( + new Poll__padAndHashMessageResult( + changetype( + value[0].toTuple() + ), + changetype( + value[1].toTuple() + ), + value[2].toBigInt() + ) + ) + ); + } + + sha256Hash(array: Array): BigInt { + let result = super.call("sha256Hash", "sha256Hash(uint256[]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_sha256Hash(array: Array): ethereum.CallResult { + let result = super.tryCall( + "sha256Hash", + "sha256Hash(uint256[]):(uint256)", + [ethereum.Value.fromUnsignedBigIntArray(array)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + stateAqMerged(): boolean { + let result = super.call("stateAqMerged", "stateAqMerged():(bool)", []); + + return result[0].toBoolean(); + } + + try_stateAqMerged(): ethereum.CallResult { + let result = super.tryCall("stateAqMerged", "stateAqMerged():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + treeDepths(): Poll__treeDepthsResult { + let result = super.call( + "treeDepths", + "treeDepths():(uint8,uint8,uint8,uint8)", + [] + ); + + return new Poll__treeDepthsResult( + result[0].toI32(), + result[1].toI32(), + result[2].toI32(), + result[3].toI32() + ); + } + + try_treeDepths(): ethereum.CallResult { + let result = super.tryCall( + "treeDepths", + "treeDepths():(uint8,uint8,uint8,uint8)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__treeDepthsResult( + value[0].toI32(), + value[1].toI32(), + value[2].toI32(), + value[3].toI32() + ) + ); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get _duration(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get _maxValues(): ConstructorCall_maxValuesStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get _treeDepths(): ConstructorCall_treeDepthsStruct { + return changetype( + this._call.inputValues[2].value.toTuple() + ); + } + + get _batchSizes(): ConstructorCall_batchSizesStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } + + get _coordinatorPubKey(): ConstructorCall_coordinatorPubKeyStruct { + return changetype( + this._call.inputValues[4].value.toTuple() + ); + } + + get _extContracts(): ConstructorCall_extContractsStruct { + return changetype( + this._call.inputValues[5].value.toTuple() + ); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCall_maxValuesStruct extends ethereum.Tuple { + get maxMessages(): BigInt { + return this[0].toBigInt(); + } + + get maxVoteOptions(): BigInt { + return this[1].toBigInt(); + } +} + +export class ConstructorCall_treeDepthsStruct extends ethereum.Tuple { + get intStateTreeDepth(): i32 { + return this[0].toI32(); + } + + get messageTreeSubDepth(): i32 { + return this[1].toI32(); + } + + get messageTreeDepth(): i32 { + return this[2].toI32(); + } + + get voteOptionTreeDepth(): i32 { + return this[3].toI32(); + } +} + +export class ConstructorCall_batchSizesStruct extends ethereum.Tuple { + get messageBatchSize(): i32 { + return this[0].toI32(); + } + + get tallyBatchSize(): i32 { + return this[1].toI32(); + } + + get subsidyBatchSize(): i32 { + return this[2].toI32(); + } +} + +export class ConstructorCall_coordinatorPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class ConstructorCall_extContractsStruct extends ethereum.Tuple { + get vkRegistry(): Address { + return this[0].toAddress(); + } + + get maci(): Address { + return this[1].toAddress(); + } + + get messageAq(): Address { + return this[2].toAddress(); + } + + get topupCredit(): Address { + return this[3].toAddress(); + } +} + +export class InitCall extends ethereum.Call { + get inputs(): InitCall__Inputs { + return new InitCall__Inputs(this); + } + + get outputs(): InitCall__Outputs { + return new InitCall__Outputs(this); + } +} + +export class InitCall__Inputs { + _call: InitCall; + + constructor(call: InitCall) { + this._call = call; + } +} + +export class InitCall__Outputs { + _call: InitCall; + + constructor(call: InitCall) { + this._call = call; + } +} + +export class MergeMaciStateAqCall extends ethereum.Call { + get inputs(): MergeMaciStateAqCall__Inputs { + return new MergeMaciStateAqCall__Inputs(this); + } + + get outputs(): MergeMaciStateAqCall__Outputs { + return new MergeMaciStateAqCall__Outputs(this); + } +} + +export class MergeMaciStateAqCall__Inputs { + _call: MergeMaciStateAqCall; + + constructor(call: MergeMaciStateAqCall) { + this._call = call; + } + + get _pollId(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class MergeMaciStateAqCall__Outputs { + _call: MergeMaciStateAqCall; + + constructor(call: MergeMaciStateAqCall) { + this._call = call; + } +} + +export class MergeMaciStateAqSubRootsCall extends ethereum.Call { + get inputs(): MergeMaciStateAqSubRootsCall__Inputs { + return new MergeMaciStateAqSubRootsCall__Inputs(this); + } + + get outputs(): MergeMaciStateAqSubRootsCall__Outputs { + return new MergeMaciStateAqSubRootsCall__Outputs(this); + } +} + +export class MergeMaciStateAqSubRootsCall__Inputs { + _call: MergeMaciStateAqSubRootsCall; + + constructor(call: MergeMaciStateAqSubRootsCall) { + this._call = call; + } + + get _numSrQueueOps(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get _pollId(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class MergeMaciStateAqSubRootsCall__Outputs { + _call: MergeMaciStateAqSubRootsCall; + + constructor(call: MergeMaciStateAqSubRootsCall) { + this._call = call; + } +} + +export class MergeMessageAqCall extends ethereum.Call { + get inputs(): MergeMessageAqCall__Inputs { + return new MergeMessageAqCall__Inputs(this); + } + + get outputs(): MergeMessageAqCall__Outputs { + return new MergeMessageAqCall__Outputs(this); + } +} + +export class MergeMessageAqCall__Inputs { + _call: MergeMessageAqCall; + + constructor(call: MergeMessageAqCall) { + this._call = call; + } +} + +export class MergeMessageAqCall__Outputs { + _call: MergeMessageAqCall; + + constructor(call: MergeMessageAqCall) { + this._call = call; + } +} + +export class MergeMessageAqSubRootsCall extends ethereum.Call { + get inputs(): MergeMessageAqSubRootsCall__Inputs { + return new MergeMessageAqSubRootsCall__Inputs(this); + } + + get outputs(): MergeMessageAqSubRootsCall__Outputs { + return new MergeMessageAqSubRootsCall__Outputs(this); + } +} + +export class MergeMessageAqSubRootsCall__Inputs { + _call: MergeMessageAqSubRootsCall; + + constructor(call: MergeMessageAqSubRootsCall) { + this._call = call; + } + + get _numSrQueueOps(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class MergeMessageAqSubRootsCall__Outputs { + _call: MergeMessageAqSubRootsCall; + + constructor(call: MergeMessageAqSubRootsCall) { + this._call = call; + } +} + +export class PublishMessageCall extends ethereum.Call { + get inputs(): PublishMessageCall__Inputs { + return new PublishMessageCall__Inputs(this); + } + + get outputs(): PublishMessageCall__Outputs { + return new PublishMessageCall__Outputs(this); + } +} + +export class PublishMessageCall__Inputs { + _call: PublishMessageCall; + + constructor(call: PublishMessageCall) { + this._call = call; + } + + get _message(): PublishMessageCall_messageStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get _encPubKey(): PublishMessageCall_encPubKeyStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } +} + +export class PublishMessageCall__Outputs { + _call: PublishMessageCall; + + constructor(call: PublishMessageCall) { + this._call = call; + } +} + +export class PublishMessageCall_messageStruct extends ethereum.Tuple { + get msgType(): BigInt { + return this[0].toBigInt(); + } + + get data(): Array { + return this[1].toBigIntArray(); + } +} + +export class PublishMessageCall_encPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class RenounceOwnershipCall extends ethereum.Call { + get inputs(): RenounceOwnershipCall__Inputs { + return new RenounceOwnershipCall__Inputs(this); + } + + get outputs(): RenounceOwnershipCall__Outputs { + return new RenounceOwnershipCall__Outputs(this); + } +} + +export class RenounceOwnershipCall__Inputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall__Outputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class TopupCall extends ethereum.Call { + get inputs(): TopupCall__Inputs { + return new TopupCall__Inputs(this); + } + + get outputs(): TopupCall__Outputs { + return new TopupCall__Outputs(this); + } +} + +export class TopupCall__Inputs { + _call: TopupCall; + + constructor(call: TopupCall) { + this._call = call; + } + + get stateIndex(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TopupCall__Outputs { + _call: TopupCall; + + constructor(call: TopupCall) { + this._call = call; + } +} + +export class TransferOwnershipCall extends ethereum.Call { + get inputs(): TransferOwnershipCall__Inputs { + return new TransferOwnershipCall__Inputs(this); + } + + get outputs(): TransferOwnershipCall__Outputs { + return new TransferOwnershipCall__Outputs(this); + } +} + +export class TransferOwnershipCall__Inputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } + + get newOwner(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class TransferOwnershipCall__Outputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } +} diff --git a/subgraph/generated/FundingRoundFactory/Token.ts b/subgraph/generated/ClrFund/Token.ts similarity index 100% rename from subgraph/generated/FundingRoundFactory/Token.ts rename to subgraph/generated/ClrFund/Token.ts diff --git a/subgraph/generated/FundingRoundFactory/MACIFactory.ts b/subgraph/generated/FundingRoundFactory/MACIFactory.ts deleted file mode 100644 index a806996ad..000000000 --- a/subgraph/generated/FundingRoundFactory/MACIFactory.ts +++ /dev/null @@ -1,643 +0,0 @@ -// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. - -import { - ethereum, - JSONValue, - TypedMap, - Entity, - Bytes, - Address, - BigInt -} from "@graphprotocol/graph-ts"; - -export class MaciDeployed extends ethereum.Event { - get params(): MaciDeployed__Params { - return new MaciDeployed__Params(this); - } -} - -export class MaciDeployed__Params { - _event: MaciDeployed; - - constructor(event: MaciDeployed) { - this._event = event; - } - - get _maci(): Address { - return this._event.parameters[0].value.toAddress(); - } -} - -export class MaciParametersChanged extends ethereum.Event { - get params(): MaciParametersChanged__Params { - return new MaciParametersChanged__Params(this); - } -} - -export class MaciParametersChanged__Params { - _event: MaciParametersChanged; - - constructor(event: MaciParametersChanged) { - this._event = event; - } -} - -export class OwnershipTransferred extends ethereum.Event { - get params(): OwnershipTransferred__Params { - return new OwnershipTransferred__Params(this); - } -} - -export class OwnershipTransferred__Params { - _event: OwnershipTransferred; - - constructor(event: OwnershipTransferred) { - this._event = event; - } - - get previousOwner(): Address { - return this._event.parameters[0].value.toAddress(); - } - - get newOwner(): Address { - return this._event.parameters[1].value.toAddress(); - } -} - -export class MACIFactory__batchSizesResult { - value0: i32; - value1: i32; - - constructor(value0: i32, value1: i32) { - this.value0 = value0; - this.value1 = value1; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set( - "value0", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value0)) - ); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - return map; - } - - getTallyBatchSize(): i32 { - return this.value0; - } - - getMessageBatchSize(): i32 { - return this.value1; - } -} - -export class MACIFactory__deployMaciInput_coordinatorPubKeyStruct extends ethereum.Tuple { - get x(): BigInt { - return this[0].toBigInt(); - } - - get y(): BigInt { - return this[1].toBigInt(); - } -} - -export class MACIFactory__maxValuesResult { - value0: BigInt; - value1: BigInt; - value2: BigInt; - - constructor(value0: BigInt, value1: BigInt, value2: BigInt) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); - return map; - } - - getMaxUsers(): BigInt { - return this.value0; - } - - getMaxMessages(): BigInt { - return this.value1; - } - - getMaxVoteOptions(): BigInt { - return this.value2; - } -} - -export class MACIFactory__treeDepthsResult { - value0: i32; - value1: i32; - value2: i32; - - constructor(value0: i32, value1: i32, value2: i32) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set( - "value0", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value0)) - ); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - map.set( - "value2", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value2)) - ); - return map; - } - - getStateTreeDepth(): i32 { - return this.value0; - } - - getMessageTreeDepth(): i32 { - return this.value1; - } - - getVoteOptionTreeDepth(): i32 { - return this.value2; - } -} - -export class MACIFactory extends ethereum.SmartContract { - static bind(address: Address): MACIFactory { - return new MACIFactory("MACIFactory", address); - } - - batchSizes(): MACIFactory__batchSizesResult { - let result = super.call("batchSizes", "batchSizes():(uint8,uint8)", []); - - return new MACIFactory__batchSizesResult( - result[0].toI32(), - result[1].toI32() - ); - } - - try_batchSizes(): ethereum.CallResult { - let result = super.tryCall("batchSizes", "batchSizes():(uint8,uint8)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new MACIFactory__batchSizesResult(value[0].toI32(), value[1].toI32()) - ); - } - - batchUstVerifier(): Address { - let result = super.call( - "batchUstVerifier", - "batchUstVerifier():(address)", - [] - ); - - return result[0].toAddress(); - } - - try_batchUstVerifier(): ethereum.CallResult
{ - let result = super.tryCall( - "batchUstVerifier", - "batchUstVerifier():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - deployMaci( - _signUpGatekeeper: Address, - _initialVoiceCreditProxy: Address, - _coordinator: Address, - _coordinatorPubKey: MACIFactory__deployMaciInput_coordinatorPubKeyStruct - ): Address { - let result = super.call( - "deployMaci", - "deployMaci(address,address,address,(uint256,uint256)):(address)", - [ - ethereum.Value.fromAddress(_signUpGatekeeper), - ethereum.Value.fromAddress(_initialVoiceCreditProxy), - ethereum.Value.fromAddress(_coordinator), - ethereum.Value.fromTuple(_coordinatorPubKey) - ] - ); - - return result[0].toAddress(); - } - - try_deployMaci( - _signUpGatekeeper: Address, - _initialVoiceCreditProxy: Address, - _coordinator: Address, - _coordinatorPubKey: MACIFactory__deployMaciInput_coordinatorPubKeyStruct - ): ethereum.CallResult
{ - let result = super.tryCall( - "deployMaci", - "deployMaci(address,address,address,(uint256,uint256)):(address)", - [ - ethereum.Value.fromAddress(_signUpGatekeeper), - ethereum.Value.fromAddress(_initialVoiceCreditProxy), - ethereum.Value.fromAddress(_coordinator), - ethereum.Value.fromTuple(_coordinatorPubKey) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - maxValues(): MACIFactory__maxValuesResult { - let result = super.call( - "maxValues", - "maxValues():(uint256,uint256,uint256)", - [] - ); - - return new MACIFactory__maxValuesResult( - result[0].toBigInt(), - result[1].toBigInt(), - result[2].toBigInt() - ); - } - - try_maxValues(): ethereum.CallResult { - let result = super.tryCall( - "maxValues", - "maxValues():(uint256,uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new MACIFactory__maxValuesResult( - value[0].toBigInt(), - value[1].toBigInt(), - value[2].toBigInt() - ) - ); - } - - owner(): Address { - let result = super.call("owner", "owner():(address)", []); - - return result[0].toAddress(); - } - - try_owner(): ethereum.CallResult
{ - let result = super.tryCall("owner", "owner():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - qvtVerifier(): Address { - let result = super.call("qvtVerifier", "qvtVerifier():(address)", []); - - return result[0].toAddress(); - } - - try_qvtVerifier(): ethereum.CallResult
{ - let result = super.tryCall("qvtVerifier", "qvtVerifier():(address)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); - } - - signUpDuration(): BigInt { - let result = super.call("signUpDuration", "signUpDuration():(uint256)", []); - - return result[0].toBigInt(); - } - - try_signUpDuration(): ethereum.CallResult { - let result = super.tryCall( - "signUpDuration", - "signUpDuration():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treeDepths(): MACIFactory__treeDepthsResult { - let result = super.call( - "treeDepths", - "treeDepths():(uint8,uint8,uint8)", - [] - ); - - return new MACIFactory__treeDepthsResult( - result[0].toI32(), - result[1].toI32(), - result[2].toI32() - ); - } - - try_treeDepths(): ethereum.CallResult { - let result = super.tryCall( - "treeDepths", - "treeDepths():(uint8,uint8,uint8)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new MACIFactory__treeDepthsResult( - value[0].toI32(), - value[1].toI32(), - value[2].toI32() - ) - ); - } - - votingDuration(): BigInt { - let result = super.call("votingDuration", "votingDuration():(uint256)", []); - - return result[0].toBigInt(); - } - - try_votingDuration(): ethereum.CallResult { - let result = super.tryCall( - "votingDuration", - "votingDuration():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } -} - -export class ConstructorCall extends ethereum.Call { - get inputs(): ConstructorCall__Inputs { - return new ConstructorCall__Inputs(this); - } - - get outputs(): ConstructorCall__Outputs { - return new ConstructorCall__Outputs(this); - } -} - -export class ConstructorCall__Inputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } - - get _stateTreeDepth(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _messageTreeDepth(): i32 { - return this._call.inputValues[1].value.toI32(); - } - - get _voteOptionTreeDepth(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get _tallyBatchSize(): i32 { - return this._call.inputValues[3].value.toI32(); - } - - get _messageBatchSize(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get _batchUstVerifier(): Address { - return this._call.inputValues[5].value.toAddress(); - } - - get _qvtVerifier(): Address { - return this._call.inputValues[6].value.toAddress(); - } - - get _signUpDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get _votingDuration(): BigInt { - return this._call.inputValues[8].value.toBigInt(); - } -} - -export class ConstructorCall__Outputs { - _call: ConstructorCall; - - constructor(call: ConstructorCall) { - this._call = call; - } -} - -export class DeployMaciCall extends ethereum.Call { - get inputs(): DeployMaciCall__Inputs { - return new DeployMaciCall__Inputs(this); - } - - get outputs(): DeployMaciCall__Outputs { - return new DeployMaciCall__Outputs(this); - } -} - -export class DeployMaciCall__Inputs { - _call: DeployMaciCall; - - constructor(call: DeployMaciCall) { - this._call = call; - } - - get _signUpGatekeeper(): Address { - return this._call.inputValues[0].value.toAddress(); - } - - get _initialVoiceCreditProxy(): Address { - return this._call.inputValues[1].value.toAddress(); - } - - get _coordinator(): Address { - return this._call.inputValues[2].value.toAddress(); - } - - get _coordinatorPubKey(): DeployMaciCall_coordinatorPubKeyStruct { - return changetype( - this._call.inputValues[3].value.toTuple() - ); - } -} - -export class DeployMaciCall__Outputs { - _call: DeployMaciCall; - - constructor(call: DeployMaciCall) { - this._call = call; - } - - get _maci(): Address { - return this._call.outputValues[0].value.toAddress(); - } -} - -export class DeployMaciCall_coordinatorPubKeyStruct extends ethereum.Tuple { - get x(): BigInt { - return this[0].toBigInt(); - } - - get y(): BigInt { - return this[1].toBigInt(); - } -} - -export class RenounceOwnershipCall extends ethereum.Call { - get inputs(): RenounceOwnershipCall__Inputs { - return new RenounceOwnershipCall__Inputs(this); - } - - get outputs(): RenounceOwnershipCall__Outputs { - return new RenounceOwnershipCall__Outputs(this); - } -} - -export class RenounceOwnershipCall__Inputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class RenounceOwnershipCall__Outputs { - _call: RenounceOwnershipCall; - - constructor(call: RenounceOwnershipCall) { - this._call = call; - } -} - -export class SetMaciParametersCall extends ethereum.Call { - get inputs(): SetMaciParametersCall__Inputs { - return new SetMaciParametersCall__Inputs(this); - } - - get outputs(): SetMaciParametersCall__Outputs { - return new SetMaciParametersCall__Outputs(this); - } -} - -export class SetMaciParametersCall__Inputs { - _call: SetMaciParametersCall; - - constructor(call: SetMaciParametersCall) { - this._call = call; - } - - get _stateTreeDepth(): i32 { - return this._call.inputValues[0].value.toI32(); - } - - get _messageTreeDepth(): i32 { - return this._call.inputValues[1].value.toI32(); - } - - get _voteOptionTreeDepth(): i32 { - return this._call.inputValues[2].value.toI32(); - } - - get _tallyBatchSize(): i32 { - return this._call.inputValues[3].value.toI32(); - } - - get _messageBatchSize(): i32 { - return this._call.inputValues[4].value.toI32(); - } - - get _batchUstVerifier(): Address { - return this._call.inputValues[5].value.toAddress(); - } - - get _qvtVerifier(): Address { - return this._call.inputValues[6].value.toAddress(); - } - - get _signUpDuration(): BigInt { - return this._call.inputValues[7].value.toBigInt(); - } - - get _votingDuration(): BigInt { - return this._call.inputValues[8].value.toBigInt(); - } -} - -export class SetMaciParametersCall__Outputs { - _call: SetMaciParametersCall; - - constructor(call: SetMaciParametersCall) { - this._call = call; - } -} - -export class TransferOwnershipCall extends ethereum.Call { - get inputs(): TransferOwnershipCall__Inputs { - return new TransferOwnershipCall__Inputs(this); - } - - get outputs(): TransferOwnershipCall__Outputs { - return new TransferOwnershipCall__Outputs(this); - } -} - -export class TransferOwnershipCall__Inputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } - - get newOwner(): Address { - return this._call.inputValues[0].value.toAddress(); - } -} - -export class TransferOwnershipCall__Outputs { - _call: TransferOwnershipCall; - - constructor(call: TransferOwnershipCall) { - this._call = call; - } -} diff --git a/subgraph/generated/OptimisticRecipientRegistry/OptimisticRecipientRegistry.ts b/subgraph/generated/OptimisticRecipientRegistry/OptimisticRecipientRegistry.ts index 20d805ce5..afb85c261 100644 --- a/subgraph/generated/OptimisticRecipientRegistry/OptimisticRecipientRegistry.ts +++ b/subgraph/generated/OptimisticRecipientRegistry/OptimisticRecipientRegistry.ts @@ -255,6 +255,29 @@ export class OptimisticRecipientRegistry extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toAddress()); } + getRecipientCount(): BigInt { + let result = super.call( + "getRecipientCount", + "getRecipientCount():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getRecipientCount(): ethereum.CallResult { + let result = super.tryCall( + "getRecipientCount", + "getRecipientCount():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + maxRecipients(): BigInt { let result = super.call("maxRecipients", "maxRecipients():(uint256)", []); diff --git a/subgraph/generated/schema.ts b/subgraph/generated/schema.ts index b18f21bdc..7a5649125 100644 --- a/subgraph/generated/schema.ts +++ b/subgraph/generated/schema.ts @@ -11,7 +11,7 @@ import { BigDecimal } from "@graphprotocol/graph-ts"; -export class FundingRoundFactory extends Entity { +export class ClrFund extends Entity { constructor(id: string) { super(); this.set("id", Value.fromString(id)); @@ -19,20 +19,18 @@ export class FundingRoundFactory extends Entity { save(): void { let id = this.get("id"); - assert(id != null, "Cannot save FundingRoundFactory entity without an ID"); + assert(id != null, "Cannot save ClrFund entity without an ID"); if (id) { assert( id.kind == ValueKind.STRING, - `Entities of type FundingRoundFactory must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + `Entities of type ClrFund must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` ); - store.set("FundingRoundFactory", id.toString(), this); + store.set("ClrFund", id.toString(), this); } } - static load(id: string): FundingRoundFactory | null { - return changetype( - store.get("FundingRoundFactory", id) - ); + static load(id: string): ClrFund | null { + return changetype(store.get("ClrFund", id)); } get id(): string { @@ -527,13 +525,13 @@ export class Message extends Entity { } } - get iv(): BigInt { - let value = this.get("iv"); + get msgType(): BigInt { + let value = this.get("msgType"); return value!.toBigInt(); } - set iv(value: BigInt) { - this.set("iv", Value.fromBigInt(value)); + set msgType(value: BigInt) { + this.set("msgType", Value.fromBigInt(value)); } get publicKey(): string | null { @@ -764,8 +762,8 @@ export class FundingRound extends Entity { this.set("id", Value.fromString(value)); } - get fundingRoundFactory(): string | null { - let value = this.get("fundingRoundFactory"); + get clrFund(): string | null { + let value = this.get("clrFund"); if (!value || value.kind == ValueKind.NULL) { return null; } else { @@ -773,11 +771,11 @@ export class FundingRound extends Entity { } } - set fundingRoundFactory(value: string | null) { + set clrFund(value: string | null) { if (!value) { - this.unset("fundingRoundFactory"); + this.unset("clrFund"); } else { - this.set("fundingRoundFactory", Value.fromString(value)); + this.set("clrFund", Value.fromString(value)); } } @@ -798,6 +796,23 @@ export class FundingRound extends Entity { } } + get pollAddress(): Bytes | null { + let value = this.get("pollAddress"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBytes(); + } + } + + set pollAddress(value: Bytes | null) { + if (!value) { + this.unset("pollAddress"); + } else { + this.set("pollAddress", Value.fromBytes(value)); + } + } + get messages(): Array | null { let value = this.get("messages"); if (!value || value.kind == ValueKind.NULL) { @@ -960,6 +975,67 @@ export class FundingRound extends Entity { } } + get stateTreeDepth(): i32 { + let value = this.get("stateTreeDepth"); + return value!.toI32(); + } + + set stateTreeDepth(value: i32) { + this.set("stateTreeDepth", Value.fromI32(value)); + } + + get messageTreeDepth(): i32 { + let value = this.get("messageTreeDepth"); + return value!.toI32(); + } + + set messageTreeDepth(value: i32) { + this.set("messageTreeDepth", Value.fromI32(value)); + } + + get voteOptionTreeDepth(): i32 { + let value = this.get("voteOptionTreeDepth"); + return value!.toI32(); + } + + set voteOptionTreeDepth(value: i32) { + this.set("voteOptionTreeDepth", Value.fromI32(value)); + } + + get coordinatorPubKeyX(): BigInt | null { + let value = this.get("coordinatorPubKeyX"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set coordinatorPubKeyX(value: BigInt | null) { + if (!value) { + this.unset("coordinatorPubKeyX"); + } else { + this.set("coordinatorPubKeyX", Value.fromBigInt(value)); + } + } + + get coordinatorPubKeyY(): BigInt | null { + let value = this.get("coordinatorPubKeyY"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set coordinatorPubKeyY(value: BigInt | null) { + if (!value) { + this.unset("coordinatorPubKeyY"); + } else { + this.set("coordinatorPubKeyY", Value.fromBigInt(value)); + } + } + get coordinator(): Bytes | null { let value = this.get("coordinator"); if (!value || value.kind == ValueKind.NULL) { @@ -1202,8 +1278,8 @@ export class RecipientRegistry extends Entity { this.set("id", Value.fromString(value)); } - get fundingRoundFactory(): string | null { - let value = this.get("fundingRoundFactory"); + get clrFund(): string | null { + let value = this.get("clrFund"); if (!value || value.kind == ValueKind.NULL) { return null; } else { @@ -1211,11 +1287,11 @@ export class RecipientRegistry extends Entity { } } - set fundingRoundFactory(value: string | null) { + set clrFund(value: string | null) { if (!value) { - this.unset("fundingRoundFactory"); + this.unset("clrFund"); } else { - this.set("fundingRoundFactory", Value.fromString(value)); + this.set("clrFund", Value.fromString(value)); } } @@ -1669,13 +1745,13 @@ export class ContributorRegistry extends Entity { this.set("id", Value.fromString(value)); } - get fundingRoundFactory(): string { - let value = this.get("fundingRoundFactory"); + get clrFund(): string { + let value = this.get("clrFund"); return value!.toString(); } - set fundingRoundFactory(value: string) { - this.set("fundingRoundFactory", Value.fromString(value)); + set clrFund(value: string) { + this.set("clrFund", Value.fromString(value)); } get context(): string | null { diff --git a/subgraph/generated/templates.ts b/subgraph/generated/templates.ts index 754dd9bd0..a5ec12ccf 100644 --- a/subgraph/generated/templates.ts +++ b/subgraph/generated/templates.ts @@ -57,3 +57,13 @@ export class MACI extends DataSourceTemplate { DataSourceTemplate.createWithContext("MACI", [address.toHex()], context); } } + +export class Poll extends DataSourceTemplate { + static create(address: Address): void { + DataSourceTemplate.create("Poll", [address.toHex()]); + } + + static createWithContext(address: Address, context: DataSourceContext): void { + DataSourceTemplate.createWithContext("Poll", [address.toHex()], context); + } +} diff --git a/subgraph/generated/templates/FundingRound/FundingRound.ts b/subgraph/generated/templates/FundingRound/FundingRound.ts index 6c3bcd6cb..bde4327d0 100644 --- a/subgraph/generated/templates/FundingRound/FundingRound.ts +++ b/subgraph/generated/templates/FundingRound/FundingRound.ts @@ -371,6 +371,21 @@ export class FundingRound extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toString()); } + poll(): Address { + let result = super.call("poll", "poll():(address)", []); + + return result[0].toAddress(); + } + + try_poll(): ethereum.CallResult
{ + let result = super.tryCall("poll", "poll():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + totalSpent(): BigInt { let result = super.call("totalSpent", "totalSpent():(uint256)", []); diff --git a/subgraph/generated/templates/FundingRound/OptimisticRecipientRegistry.ts b/subgraph/generated/templates/FundingRound/OptimisticRecipientRegistry.ts index 20d805ce5..afb85c261 100644 --- a/subgraph/generated/templates/FundingRound/OptimisticRecipientRegistry.ts +++ b/subgraph/generated/templates/FundingRound/OptimisticRecipientRegistry.ts @@ -255,6 +255,29 @@ export class OptimisticRecipientRegistry extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toAddress()); } + getRecipientCount(): BigInt { + let result = super.call( + "getRecipientCount", + "getRecipientCount():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getRecipientCount(): ethereum.CallResult { + let result = super.tryCall( + "getRecipientCount", + "getRecipientCount():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + maxRecipients(): BigInt { let result = super.call("maxRecipients", "maxRecipients():(uint256)", []); diff --git a/subgraph/generated/templates/MACI/FundingRound.ts b/subgraph/generated/templates/MACI/FundingRound.ts index 6c3bcd6cb..bde4327d0 100644 --- a/subgraph/generated/templates/MACI/FundingRound.ts +++ b/subgraph/generated/templates/MACI/FundingRound.ts @@ -371,6 +371,21 @@ export class FundingRound extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toString()); } + poll(): Address { + let result = super.call("poll", "poll():(address)", []); + + return result[0].toAddress(); + } + + try_poll(): ethereum.CallResult
{ + let result = super.tryCall("poll", "poll():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + totalSpent(): BigInt { let result = super.call("totalSpent", "totalSpent():(uint256)", []); diff --git a/subgraph/generated/templates/MACI/MACI.ts b/subgraph/generated/templates/MACI/MACI.ts index 34c923d6f..18150f402 100644 --- a/subgraph/generated/templates/MACI/MACI.ts +++ b/subgraph/generated/templates/MACI/MACI.ts @@ -10,43 +10,35 @@ import { BigInt } from "@graphprotocol/graph-ts"; -export class PublishMessage extends ethereum.Event { - get params(): PublishMessage__Params { - return new PublishMessage__Params(this); +export class DeployPoll extends ethereum.Event { + get params(): DeployPoll__Params { + return new DeployPoll__Params(this); } } -export class PublishMessage__Params { - _event: PublishMessage; +export class DeployPoll__Params { + _event: DeployPoll; - constructor(event: PublishMessage) { + constructor(event: DeployPoll) { this._event = event; } - get _message(): PublishMessage_messageStruct { - return changetype( - this._event.parameters[0].value.toTuple() - ); + get _pollId(): BigInt { + return this._event.parameters[0].value.toBigInt(); } - get _encPubKey(): PublishMessage_encPubKeyStruct { - return changetype( - this._event.parameters[1].value.toTuple() - ); - } -} - -export class PublishMessage_messageStruct extends ethereum.Tuple { - get iv(): BigInt { - return this[0].toBigInt(); + get _pollAddr(): Address { + return this._event.parameters[1].value.toAddress(); } - get data(): Array { - return this[1].toBigIntArray(); + get _pubKey(): DeployPoll_pubKeyStruct { + return changetype( + this._event.parameters[2].value.toTuple() + ); } } -export class PublishMessage_encPubKeyStruct extends ethereum.Tuple { +export class DeployPoll_pubKeyStruct extends ethereum.Tuple { get x(): BigInt { return this[0].toBigInt(); } @@ -56,586 +48,273 @@ export class PublishMessage_encPubKeyStruct extends ethereum.Tuple { } } -export class SignUp extends ethereum.Event { - get params(): SignUp__Params { - return new SignUp__Params(this); +export class Init extends ethereum.Event { + get params(): Init__Params { + return new Init__Params(this); } } -export class SignUp__Params { - _event: SignUp; +export class Init__Params { + _event: Init; - constructor(event: SignUp) { + constructor(event: Init) { this._event = event; } - get _userPubKey(): SignUp_userPubKeyStruct { - return changetype( - this._event.parameters[0].value.toTuple() - ); - } - - get _stateIndex(): BigInt { - return this._event.parameters[1].value.toBigInt(); + get _vkRegistry(): Address { + return this._event.parameters[0].value.toAddress(); } - get _voiceCreditBalance(): BigInt { - return this._event.parameters[2].value.toBigInt(); + get _topupCredit(): Address { + return this._event.parameters[1].value.toAddress(); } } -export class SignUp_userPubKeyStruct extends ethereum.Tuple { - get x(): BigInt { - return this[0].toBigInt(); - } - - get y(): BigInt { - return this[1].toBigInt(); +export class MergeStateAq extends ethereum.Event { + get params(): MergeStateAq__Params { + return new MergeStateAq__Params(this); } } -export class MACI__coordinatorPubKeyResult { - value0: BigInt; - value1: BigInt; - - constructor(value0: BigInt, value1: BigInt) { - this.value0 = value0; - this.value1 = value1; - } +export class MergeStateAq__Params { + _event: MergeStateAq; - toMap(): TypedMap { - let map = new TypedMap(); - map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); - map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); - return map; - } - - getX(): BigInt { - return this.value0; + constructor(event: MergeStateAq) { + this._event = event; } - getY(): BigInt { - return this.value1; + get _pollId(): BigInt { + return this._event.parameters[0].value.toBigInt(); } } -export class MACI__genBatchUstPublicSignalsInput_ecdhPubKeysStruct extends ethereum.Tuple { - get x(): BigInt { - return this[0].toBigInt(); - } - - get y(): BigInt { - return this[1].toBigInt(); +export class MergeStateAqSubRoots extends ethereum.Event { + get params(): MergeStateAqSubRoots__Params { + return new MergeStateAqSubRoots__Params(this); } } -export class MACI__hashMessageInput_messageStruct extends ethereum.Tuple { - get iv(): BigInt { - return this[0].toBigInt(); - } - - get data(): Array { - return this[1].toBigIntArray(); - } -} +export class MergeStateAqSubRoots__Params { + _event: MergeStateAqSubRoots; -export class MACI__hashStateLeafInput_stateLeafStruct extends ethereum.Tuple { - get pubKey(): MACI__hashStateLeafInput_stateLeafPubKeyStruct { - return changetype( - this[0].toTuple() - ); + constructor(event: MergeStateAqSubRoots) { + this._event = event; } - get voteOptionTreeRoot(): BigInt { - return this[1].toBigInt(); + get _pollId(): BigInt { + return this._event.parameters[0].value.toBigInt(); } - get voiceCreditBalance(): BigInt { - return this[2].toBigInt(); - } - - get nonce(): BigInt { - return this[3].toBigInt(); + get _numSrQueueOps(): BigInt { + return this._event.parameters[1].value.toBigInt(); } } -export class MACI__hashStateLeafInput_stateLeafPubKeyStruct extends ethereum.Tuple { - get x(): BigInt { - return this[0].toBigInt(); - } - - get y(): BigInt { - return this[1].toBigInt(); +export class OwnershipTransferred extends ethereum.Event { + get params(): OwnershipTransferred__Params { + return new OwnershipTransferred__Params(this); } } -export class MACI__treeDepthsResult { - value0: i32; - value1: i32; - value2: i32; - - constructor(value0: i32, value1: i32, value2: i32) { - this.value0 = value0; - this.value1 = value1; - this.value2 = value2; - } - - toMap(): TypedMap { - let map = new TypedMap(); - map.set( - "value0", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value0)) - ); - map.set( - "value1", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) - ); - map.set( - "value2", - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value2)) - ); - return map; - } +export class OwnershipTransferred__Params { + _event: OwnershipTransferred; - getStateTreeDepth(): i32 { - return this.value0; + constructor(event: OwnershipTransferred) { + this._event = event; } - getMessageTreeDepth(): i32 { - return this.value1; + get previousOwner(): Address { + return this._event.parameters[0].value.toAddress(); } - getVoteOptionTreeDepth(): i32 { - return this.value2; + get newOwner(): Address { + return this._event.parameters[1].value.toAddress(); } } -export class MACI extends ethereum.SmartContract { - static bind(address: Address): MACI { - return new MACI("MACI", address); - } - - calcEmptyVoteOptionTreeRoot(_levels: i32): BigInt { - let result = super.call( - "calcEmptyVoteOptionTreeRoot", - "calcEmptyVoteOptionTreeRoot(uint8):(uint256)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(_levels))] - ); - - return result[0].toBigInt(); - } - - try_calcEmptyVoteOptionTreeRoot(_levels: i32): ethereum.CallResult { - let result = super.tryCall( - "calcEmptyVoteOptionTreeRoot", - "calcEmptyVoteOptionTreeRoot(uint8):(uint256)", - [ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(_levels))] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - calcSignUpDeadline(): BigInt { - let result = super.call( - "calcSignUpDeadline", - "calcSignUpDeadline():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_calcSignUpDeadline(): ethereum.CallResult { - let result = super.tryCall( - "calcSignUpDeadline", - "calcSignUpDeadline():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); +export class SignUp extends ethereum.Event { + get params(): SignUp__Params { + return new SignUp__Params(this); } +} - calcVotingDeadline(): BigInt { - let result = super.call( - "calcVotingDeadline", - "calcVotingDeadline():(uint256)", - [] - ); - - return result[0].toBigInt(); - } +export class SignUp__Params { + _event: SignUp; - try_calcVotingDeadline(): ethereum.CallResult { - let result = super.tryCall( - "calcVotingDeadline", - "calcVotingDeadline():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); + constructor(event: SignUp) { + this._event = event; } - computeEmptyQuinRoot(_treeLevels: i32, _zeroValue: BigInt): BigInt { - let result = super.call( - "computeEmptyQuinRoot", - "computeEmptyQuinRoot(uint8,uint256):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(_treeLevels)), - ethereum.Value.fromUnsignedBigInt(_zeroValue) - ] - ); - - return result[0].toBigInt(); + get _stateIndex(): BigInt { + return this._event.parameters[0].value.toBigInt(); } - try_computeEmptyQuinRoot( - _treeLevels: i32, - _zeroValue: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "computeEmptyQuinRoot", - "computeEmptyQuinRoot(uint8,uint256):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(_treeLevels)), - ethereum.Value.fromUnsignedBigInt(_zeroValue) - ] + get _userPubKey(): SignUp_userPubKeyStruct { + return changetype( + this._event.parameters[1].value.toTuple() ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); } - computeEmptyRoot(_treeLevels: i32, _zeroValue: BigInt): BigInt { - let result = super.call( - "computeEmptyRoot", - "computeEmptyRoot(uint8,uint256):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(_treeLevels)), - ethereum.Value.fromUnsignedBigInt(_zeroValue) - ] - ); - - return result[0].toBigInt(); + get _voiceCreditBalance(): BigInt { + return this._event.parameters[2].value.toBigInt(); } - try_computeEmptyRoot( - _treeLevels: i32, - _zeroValue: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "computeEmptyRoot", - "computeEmptyRoot(uint8,uint256):(uint256)", - [ - ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(_treeLevels)), - ethereum.Value.fromUnsignedBigInt(_zeroValue) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); + get _timestamp(): BigInt { + return this._event.parameters[3].value.toBigInt(); } +} - coordinatorAddress(): Address { - let result = super.call( - "coordinatorAddress", - "coordinatorAddress():(address)", - [] - ); - - return result[0].toAddress(); +export class SignUp_userPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); } - try_coordinatorAddress(): ethereum.CallResult
{ - let result = super.tryCall( - "coordinatorAddress", - "coordinatorAddress():(address)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); + get y(): BigInt { + return this[1].toBigInt(); } +} - coordinatorPubKey(): MACI__coordinatorPubKeyResult { - let result = super.call( - "coordinatorPubKey", - "coordinatorPubKey():(uint256,uint256)", - [] - ); - - return new MACI__coordinatorPubKeyResult( - result[0].toBigInt(), - result[1].toBigInt() - ); +export class MACI__deployPollInput_maxValuesStruct extends ethereum.Tuple { + get maxMessages(): BigInt { + return this[0].toBigInt(); } - try_coordinatorPubKey(): ethereum.CallResult { - let result = super.tryCall( - "coordinatorPubKey", - "coordinatorPubKey():(uint256,uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new MACI__coordinatorPubKeyResult( - value[0].toBigInt(), - value[1].toBigInt() - ) - ); + get maxVoteOptions(): BigInt { + return this[1].toBigInt(); } +} - currentMessageBatchIndex(): BigInt { - let result = super.call( - "currentMessageBatchIndex", - "currentMessageBatchIndex():(uint256)", - [] - ); - - return result[0].toBigInt(); +export class MACI__deployPollInput_treeDepthsStruct extends ethereum.Tuple { + get intStateTreeDepth(): i32 { + return this[0].toI32(); } - try_currentMessageBatchIndex(): ethereum.CallResult { - let result = super.tryCall( - "currentMessageBatchIndex", - "currentMessageBatchIndex():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); + get messageTreeSubDepth(): i32 { + return this[1].toI32(); } - currentPerVOSpentVoiceCreditsCommitment(): BigInt { - let result = super.call( - "currentPerVOSpentVoiceCreditsCommitment", - "currentPerVOSpentVoiceCreditsCommitment():(uint256)", - [] - ); - - return result[0].toBigInt(); + get messageTreeDepth(): i32 { + return this[2].toI32(); } - try_currentPerVOSpentVoiceCreditsCommitment(): ethereum.CallResult { - let result = super.tryCall( - "currentPerVOSpentVoiceCreditsCommitment", - "currentPerVOSpentVoiceCreditsCommitment():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); + get voteOptionTreeDepth(): i32 { + return this[3].toI32(); } +} - currentQvtBatchNum(): BigInt { - let result = super.call( - "currentQvtBatchNum", - "currentQvtBatchNum():(uint256)", - [] - ); - - return result[0].toBigInt(); +export class MACI__deployPollInput_coordinatorPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); } - try_currentQvtBatchNum(): ethereum.CallResult { - let result = super.tryCall( - "currentQvtBatchNum", - "currentQvtBatchNum():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); + get y(): BigInt { + return this[1].toBigInt(); } +} - currentResultsCommitment(): BigInt { - let result = super.call( - "currentResultsCommitment", - "currentResultsCommitment():(uint256)", - [] +export class MACI__hashStateLeafInput_stateLeafStruct extends ethereum.Tuple { + get pubKey(): MACI__hashStateLeafInput_stateLeafPubKeyStruct { + return changetype( + this[0].toTuple() ); - - return result[0].toBigInt(); } - try_currentResultsCommitment(): ethereum.CallResult { - let result = super.tryCall( - "currentResultsCommitment", - "currentResultsCommitment():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); + get voiceCreditBalance(): BigInt { + return this[1].toBigInt(); } - currentSpentVoiceCreditsCommitment(): BigInt { - let result = super.call( - "currentSpentVoiceCreditsCommitment", - "currentSpentVoiceCreditsCommitment():(uint256)", - [] - ); - - return result[0].toBigInt(); + get timestamp(): BigInt { + return this[2].toBigInt(); } +} - try_currentSpentVoiceCreditsCommitment(): ethereum.CallResult { - let result = super.tryCall( - "currentSpentVoiceCreditsCommitment", - "currentSpentVoiceCreditsCommitment():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); +export class MACI__hashStateLeafInput_stateLeafPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); } - emptyVoteOptionTreeRoot(): BigInt { - let result = super.call( - "emptyVoteOptionTreeRoot", - "emptyVoteOptionTreeRoot():(uint256)", - [] - ); - - return result[0].toBigInt(); + get y(): BigInt { + return this[1].toBigInt(); } +} - try_emptyVoteOptionTreeRoot(): ethereum.CallResult { - let result = super.tryCall( - "emptyVoteOptionTreeRoot", - "emptyVoteOptionTreeRoot():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); +export class MACI extends ethereum.SmartContract { + static bind(address: Address): MACI { + return new MACI("MACI", address); } - genBatchUstPublicSignals( - _newStateRoot: BigInt, - _ecdhPubKeys: Array - ): Array { + deployPoll( + _duration: BigInt, + _maxValues: MACI__deployPollInput_maxValuesStruct, + _treeDepths: MACI__deployPollInput_treeDepthsStruct, + _coordinatorPubKey: MACI__deployPollInput_coordinatorPubKeyStruct + ): Address { let result = super.call( - "genBatchUstPublicSignals", - "genBatchUstPublicSignals(uint256,(uint256,uint256)[]):(uint256[])", + "deployPoll", + "deployPoll(uint256,(uint256,uint256),(uint8,uint8,uint8,uint8),(uint256,uint256)):(address)", [ - ethereum.Value.fromUnsignedBigInt(_newStateRoot), - ethereum.Value.fromTupleArray(_ecdhPubKeys) + ethereum.Value.fromUnsignedBigInt(_duration), + ethereum.Value.fromTuple(_maxValues), + ethereum.Value.fromTuple(_treeDepths), + ethereum.Value.fromTuple(_coordinatorPubKey) ] ); - return result[0].toBigIntArray(); + return result[0].toAddress(); } - try_genBatchUstPublicSignals( - _newStateRoot: BigInt, - _ecdhPubKeys: Array - ): ethereum.CallResult> { + try_deployPoll( + _duration: BigInt, + _maxValues: MACI__deployPollInput_maxValuesStruct, + _treeDepths: MACI__deployPollInput_treeDepthsStruct, + _coordinatorPubKey: MACI__deployPollInput_coordinatorPubKeyStruct + ): ethereum.CallResult
{ let result = super.tryCall( - "genBatchUstPublicSignals", - "genBatchUstPublicSignals(uint256,(uint256,uint256)[]):(uint256[])", + "deployPoll", + "deployPoll(uint256,(uint256,uint256),(uint8,uint8,uint8,uint8),(uint256,uint256)):(address)", [ - ethereum.Value.fromUnsignedBigInt(_newStateRoot), - ethereum.Value.fromTupleArray(_ecdhPubKeys) + ethereum.Value.fromUnsignedBigInt(_duration), + ethereum.Value.fromTuple(_maxValues), + ethereum.Value.fromTuple(_treeDepths), + ethereum.Value.fromTuple(_coordinatorPubKey) ] ); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + return ethereum.CallResult.fromValue(value[0].toAddress()); } - genQvtPublicSignals( - _intermediateStateRoot: BigInt, - _newResultsCommitment: BigInt, - _newSpentVoiceCreditsCommitment: BigInt, - _newPerVOSpentVoiceCreditsCommitment: BigInt, - _totalVotes: BigInt - ): Array { - let result = super.call( - "genQvtPublicSignals", - "genQvtPublicSignals(uint256,uint256,uint256,uint256,uint256):(uint256[])", - [ - ethereum.Value.fromUnsignedBigInt(_intermediateStateRoot), - ethereum.Value.fromUnsignedBigInt(_newResultsCommitment), - ethereum.Value.fromUnsignedBigInt(_newSpentVoiceCreditsCommitment), - ethereum.Value.fromUnsignedBigInt(_newPerVOSpentVoiceCreditsCommitment), - ethereum.Value.fromUnsignedBigInt(_totalVotes) - ] - ); + getPoll(_pollId: BigInt): Address { + let result = super.call("getPoll", "getPoll(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(_pollId) + ]); - return result[0].toBigIntArray(); + return result[0].toAddress(); } - try_genQvtPublicSignals( - _intermediateStateRoot: BigInt, - _newResultsCommitment: BigInt, - _newSpentVoiceCreditsCommitment: BigInt, - _newPerVOSpentVoiceCreditsCommitment: BigInt, - _totalVotes: BigInt - ): ethereum.CallResult> { - let result = super.tryCall( - "genQvtPublicSignals", - "genQvtPublicSignals(uint256,uint256,uint256,uint256,uint256):(uint256[])", - [ - ethereum.Value.fromUnsignedBigInt(_intermediateStateRoot), - ethereum.Value.fromUnsignedBigInt(_newResultsCommitment), - ethereum.Value.fromUnsignedBigInt(_newSpentVoiceCreditsCommitment), - ethereum.Value.fromUnsignedBigInt(_newPerVOSpentVoiceCreditsCommitment), - ethereum.Value.fromUnsignedBigInt(_totalVotes) - ] - ); + try_getPoll(_pollId: BigInt): ethereum.CallResult
{ + let result = super.tryCall("getPoll", "getPoll(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(_pollId) + ]); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigIntArray()); + return ethereum.CallResult.fromValue(value[0].toAddress()); } - getMessageTreeRoot(): BigInt { - let result = super.call( - "getMessageTreeRoot", - "getMessageTreeRoot():(uint256)", - [] - ); + getStateAqRoot(): BigInt { + let result = super.call("getStateAqRoot", "getStateAqRoot():(uint256)", []); return result[0].toBigInt(); } - try_getMessageTreeRoot(): ethereum.CallResult { + try_getStateAqRoot(): ethereum.CallResult { let result = super.tryCall( - "getMessageTreeRoot", - "getMessageTreeRoot():(uint256)", + "getStateAqRoot", + "getStateAqRoot():(uint256)", [] ); if (result.reverted) { @@ -645,22 +324,18 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBigInt()); } - getStateTreeRoot(): BigInt { - let result = super.call( - "getStateTreeRoot", - "getStateTreeRoot():(uint256)", - [] - ); + hash2(array: Array): BigInt { + let result = super.call("hash2", "hash2(uint256[2]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); return result[0].toBigInt(); } - try_getStateTreeRoot(): ethereum.CallResult { - let result = super.tryCall( - "getStateTreeRoot", - "getStateTreeRoot():(uint256)", - [] - ); + try_hash2(array: Array): ethereum.CallResult { + let result = super.tryCall("hash2", "hash2(uint256[2]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); if (result.reverted) { return new ethereum.CallResult(); } @@ -668,62 +343,35 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBigInt()); } - hasUnprocessedMessages(): boolean { - let result = super.call( - "hasUnprocessedMessages", - "hasUnprocessedMessages():(bool)", - [] - ); - - return result[0].toBoolean(); - } - - try_hasUnprocessedMessages(): ethereum.CallResult { - let result = super.tryCall( - "hasUnprocessedMessages", - "hasUnprocessedMessages():(bool)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - hasUntalliedStateLeaves(): boolean { - let result = super.call( - "hasUntalliedStateLeaves", - "hasUntalliedStateLeaves():(bool)", - [] - ); + hash3(array: Array): BigInt { + let result = super.call("hash3", "hash3(uint256[3]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); - return result[0].toBoolean(); + return result[0].toBigInt(); } - try_hasUntalliedStateLeaves(): ethereum.CallResult { - let result = super.tryCall( - "hasUntalliedStateLeaves", - "hasUntalliedStateLeaves():(bool)", - [] - ); + try_hash3(array: Array): ethereum.CallResult { + let result = super.tryCall("hash3", "hash3(uint256[3]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); + return ethereum.CallResult.fromValue(value[0].toBigInt()); } - hash11(array: Array): BigInt { - let result = super.call("hash11", "hash11(uint256[]):(uint256)", [ + hash4(array: Array): BigInt { + let result = super.call("hash4", "hash4(uint256[4]):(uint256)", [ ethereum.Value.fromUnsignedBigIntArray(array) ]); return result[0].toBigInt(); } - try_hash11(array: Array): ethereum.CallResult { - let result = super.tryCall("hash11", "hash11(uint256[]):(uint256)", [ + try_hash4(array: Array): ethereum.CallResult { + let result = super.tryCall("hash4", "hash4(uint256[4]):(uint256)", [ ethereum.Value.fromUnsignedBigIntArray(array) ]); if (result.reverted) { @@ -784,35 +432,10 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBigInt()); } - hashMessage(_message: MACI__hashMessageInput_messageStruct): BigInt { - let result = super.call( - "hashMessage", - "hashMessage((uint256,uint256[10])):(uint256)", - [ethereum.Value.fromTuple(_message)] - ); - - return result[0].toBigInt(); - } - - try_hashMessage( - _message: MACI__hashMessageInput_messageStruct - ): ethereum.CallResult { - let result = super.tryCall( - "hashMessage", - "hashMessage((uint256,uint256[10])):(uint256)", - [ethereum.Value.fromTuple(_message)] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - hashStateLeaf(_stateLeaf: MACI__hashStateLeafInput_stateLeafStruct): BigInt { let result = super.call( "hashStateLeaf", - "hashStateLeaf(((uint256,uint256),uint256,uint256,uint256)):(uint256)", + "hashStateLeaf(((uint256,uint256),uint256,uint256)):(uint256)", [ethereum.Value.fromTuple(_stateLeaf)] ); @@ -824,7 +447,7 @@ export class MACI extends ethereum.SmartContract { ): ethereum.CallResult { let result = super.tryCall( "hashStateLeaf", - "hashStateLeaf(((uint256,uint256),uint256,uint256,uint256)):(uint256)", + "hashStateLeaf(((uint256,uint256),uint256,uint256)):(uint256)", [ethereum.Value.fromTuple(_stateLeaf)] ); if (result.reverted) { @@ -834,29 +457,6 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBigInt()); } - hashedBlankStateLeaf(): BigInt { - let result = super.call( - "hashedBlankStateLeaf", - "hashedBlankStateLeaf():(uint256)", - [] - ); - - return result[0].toBigInt(); - } - - try_hashedBlankStateLeaf(): ethereum.CallResult { - let result = super.tryCall( - "hashedBlankStateLeaf", - "hashedBlankStateLeaf():(uint256)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - initialVoiceCreditProxy(): Address { let result = super.call( "initialVoiceCreditProxy", @@ -880,89 +480,34 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toAddress()); } - maxMessages(): BigInt { - let result = super.call("maxMessages", "maxMessages():(uint256)", []); - - return result[0].toBigInt(); - } - - try_maxMessages(): ethereum.CallResult { - let result = super.tryCall("maxMessages", "maxMessages():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - maxUsers(): BigInt { - let result = super.call("maxUsers", "maxUsers():(uint256)", []); + isInitialised(): boolean { + let result = super.call("isInitialised", "isInitialised():(bool)", []); - return result[0].toBigInt(); - } - - try_maxUsers(): ethereum.CallResult { - let result = super.tryCall("maxUsers", "maxUsers():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - messageBatchSize(): i32 { - let result = super.call( - "messageBatchSize", - "messageBatchSize():(uint8)", - [] - ); - - return result[0].toI32(); - } - - try_messageBatchSize(): ethereum.CallResult { - let result = super.tryCall( - "messageBatchSize", - "messageBatchSize():(uint8)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toI32()); - } - - messageTree(): Address { - let result = super.call("messageTree", "messageTree():(address)", []); - - return result[0].toAddress(); + return result[0].toBoolean(); } - try_messageTree(): ethereum.CallResult
{ - let result = super.tryCall("messageTree", "messageTree():(address)", []); + try_isInitialised(): ethereum.CallResult { + let result = super.tryCall("isInitialised", "isInitialised():(bool)", []); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; - return ethereum.CallResult.fromValue(value[0].toAddress()); + return ethereum.CallResult.fromValue(value[0].toBoolean()); } - messageTreeMaxLeafIndex(): BigInt { - let result = super.call( - "messageTreeMaxLeafIndex", - "messageTreeMaxLeafIndex():(uint256)", - [] - ); + mergeStateAq(_pollId: BigInt): BigInt { + let result = super.call("mergeStateAq", "mergeStateAq(uint256):(uint256)", [ + ethereum.Value.fromUnsignedBigInt(_pollId) + ]); return result[0].toBigInt(); } - try_messageTreeMaxLeafIndex(): ethereum.CallResult { + try_mergeStateAq(_pollId: BigInt): ethereum.CallResult { let result = super.tryCall( - "messageTreeMaxLeafIndex", - "messageTreeMaxLeafIndex():(uint256)", - [] + "mergeStateAq", + "mergeStateAq(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(_pollId)] ); if (result.reverted) { return new ethereum.CallResult(); @@ -971,14 +516,14 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBigInt()); } - numMessages(): BigInt { - let result = super.call("numMessages", "numMessages():(uint256)", []); + nextPollId(): BigInt { + let result = super.call("nextPollId", "nextPollId():(uint256)", []); return result[0].toBigInt(); } - try_numMessages(): ethereum.CallResult { - let result = super.tryCall("numMessages", "numMessages():(uint256)", []); + try_nextPollId(): ethereum.CallResult { + let result = super.tryCall("nextPollId", "nextPollId():(uint256)", []); if (result.reverted) { return new ethereum.CallResult(); } @@ -1001,21 +546,21 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBigInt()); } - originalCurrentResultsCommitment(): BigInt { + numStateLeaves(param0: BigInt): BigInt { let result = super.call( - "originalCurrentResultsCommitment", - "originalCurrentResultsCommitment():(uint256)", - [] + "numStateLeaves", + "numStateLeaves(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(param0)] ); return result[0].toBigInt(); } - try_originalCurrentResultsCommitment(): ethereum.CallResult { + try_numStateLeaves(param0: BigInt): ethereum.CallResult { let result = super.tryCall( - "originalCurrentResultsCommitment", - "originalCurrentResultsCommitment():(uint256)", - [] + "numStateLeaves", + "numStateLeaves(uint256):(uint256)", + [ethereum.Value.fromUnsignedBigInt(param0)] ); if (result.reverted) { return new ethereum.CallResult(); @@ -1024,68 +569,48 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBigInt()); } - originalSpentVoiceCreditsCommitment(): BigInt { - let result = super.call( - "originalSpentVoiceCreditsCommitment", - "originalSpentVoiceCreditsCommitment():(uint256)", - [] - ); + owner(): Address { + let result = super.call("owner", "owner():(address)", []); - return result[0].toBigInt(); + return result[0].toAddress(); } - try_originalSpentVoiceCreditsCommitment(): ethereum.CallResult { - let result = super.tryCall( - "originalSpentVoiceCreditsCommitment", - "originalSpentVoiceCreditsCommitment():(uint256)", - [] - ); + try_owner(): ethereum.CallResult
{ + let result = super.tryCall("owner", "owner():(address)", []); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); + return ethereum.CallResult.fromValue(value[0].toAddress()); } - signUpDurationSeconds(): BigInt { - let result = super.call( - "signUpDurationSeconds", - "signUpDurationSeconds():(uint256)", - [] - ); + pollFactory(): Address { + let result = super.call("pollFactory", "pollFactory():(address)", []); - return result[0].toBigInt(); + return result[0].toAddress(); } - try_signUpDurationSeconds(): ethereum.CallResult { - let result = super.tryCall( - "signUpDurationSeconds", - "signUpDurationSeconds():(uint256)", - [] - ); + try_pollFactory(): ethereum.CallResult
{ + let result = super.tryCall("pollFactory", "pollFactory():(address)", []); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); + return ethereum.CallResult.fromValue(value[0].toAddress()); } - signUpGatekeeper(): Address { - let result = super.call( - "signUpGatekeeper", - "signUpGatekeeper():(address)", - [] - ); + polls(param0: BigInt): Address { + let result = super.call("polls", "polls(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); return result[0].toAddress(); } - try_signUpGatekeeper(): ethereum.CallResult
{ - let result = super.tryCall( - "signUpGatekeeper", - "signUpGatekeeper():(address)", - [] - ); + try_polls(param0: BigInt): ethereum.CallResult
{ + let result = super.tryCall("polls", "polls(uint256):(address)", [ + ethereum.Value.fromUnsignedBigInt(param0) + ]); if (result.reverted) { return new ethereum.CallResult(); } @@ -1093,21 +618,19 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toAddress()); } - signUpTimestamp(): BigInt { - let result = super.call( - "signUpTimestamp", - "signUpTimestamp():(uint256)", - [] - ); + sha256Hash(array: Array): BigInt { + let result = super.call("sha256Hash", "sha256Hash(uint256[]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); return result[0].toBigInt(); } - try_signUpTimestamp(): ethereum.CallResult { + try_sha256Hash(array: Array): ethereum.CallResult { let result = super.tryCall( - "signUpTimestamp", - "signUpTimestamp():(uint256)", - [] + "sha256Hash", + "sha256Hash(uint256[]):(uint256)", + [ethereum.Value.fromUnsignedBigIntArray(array)] ); if (result.reverted) { return new ethereum.CallResult(); @@ -1116,35 +639,43 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBigInt()); } - stateRoot(): BigInt { - let result = super.call("stateRoot", "stateRoot():(uint256)", []); + signUpGatekeeper(): Address { + let result = super.call( + "signUpGatekeeper", + "signUpGatekeeper():(address)", + [] + ); - return result[0].toBigInt(); + return result[0].toAddress(); } - try_stateRoot(): ethereum.CallResult { - let result = super.tryCall("stateRoot", "stateRoot():(uint256)", []); + try_signUpGatekeeper(): ethereum.CallResult
{ + let result = super.tryCall( + "signUpGatekeeper", + "signUpGatekeeper():(address)", + [] + ); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); + return ethereum.CallResult.fromValue(value[0].toAddress()); } - stateRootBeforeProcessing(): BigInt { + signUpTimestamp(): BigInt { let result = super.call( - "stateRootBeforeProcessing", - "stateRootBeforeProcessing():(uint256)", + "signUpTimestamp", + "signUpTimestamp():(uint256)", [] ); return result[0].toBigInt(); } - try_stateRootBeforeProcessing(): ethereum.CallResult { + try_signUpTimestamp(): ethereum.CallResult { let result = super.tryCall( - "stateRootBeforeProcessing", - "stateRootBeforeProcessing():(uint256)", + "signUpTimestamp", + "signUpTimestamp():(uint256)", [] ); if (result.reverted) { @@ -1154,14 +685,14 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toBigInt()); } - stateTree(): Address { - let result = super.call("stateTree", "stateTree():(address)", []); + stateAq(): Address { + let result = super.call("stateAq", "stateAq():(address)", []); return result[0].toAddress(); } - try_stateTree(): ethereum.CallResult
{ - let result = super.tryCall("stateTree", "stateTree():(address)", []); + try_stateAq(): ethereum.CallResult
{ + let result = super.tryCall("stateAq", "stateAq():(address)", []); if (result.reverted) { return new ethereum.CallResult(); } @@ -1169,16 +700,16 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toAddress()); } - tallyBatchSize(): i32 { - let result = super.call("tallyBatchSize", "tallyBatchSize():(uint8)", []); + stateTreeDepth(): i32 { + let result = super.call("stateTreeDepth", "stateTreeDepth():(uint8)", []); return result[0].toI32(); } - try_tallyBatchSize(): ethereum.CallResult { + try_stateTreeDepth(): ethereum.CallResult { let result = super.tryCall( - "tallyBatchSize", - "tallyBatchSize():(uint8)", + "stateTreeDepth", + "stateTreeDepth():(uint8)", [] ); if (result.reverted) { @@ -1188,130 +719,34 @@ export class MACI extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toI32()); } - totalVotes(): BigInt { - let result = super.call("totalVotes", "totalVotes():(uint256)", []); - - return result[0].toBigInt(); - } - - try_totalVotes(): ethereum.CallResult { - let result = super.tryCall("totalVotes", "totalVotes():(uint256)", []); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); - } - - treeDepths(): MACI__treeDepthsResult { - let result = super.call( - "treeDepths", - "treeDepths():(uint8,uint8,uint8)", - [] - ); - - return new MACI__treeDepthsResult( - result[0].toI32(), - result[1].toI32(), - result[2].toI32() - ); - } - - try_treeDepths(): ethereum.CallResult { - let result = super.tryCall( - "treeDepths", - "treeDepths():(uint8,uint8,uint8)", - [] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue( - new MACI__treeDepthsResult( - value[0].toI32(), - value[1].toI32(), - value[2].toI32() - ) - ); - } - - verifySpentVoiceCredits(_spent: BigInt, _salt: BigInt): boolean { - let result = super.call( - "verifySpentVoiceCredits", - "verifySpentVoiceCredits(uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(_spent), - ethereum.Value.fromUnsignedBigInt(_salt) - ] - ); - - return result[0].toBoolean(); - } - - try_verifySpentVoiceCredits( - _spent: BigInt, - _salt: BigInt - ): ethereum.CallResult { - let result = super.tryCall( - "verifySpentVoiceCredits", - "verifySpentVoiceCredits(uint256,uint256):(bool)", - [ - ethereum.Value.fromUnsignedBigInt(_spent), - ethereum.Value.fromUnsignedBigInt(_salt) - ] - ); - if (result.reverted) { - return new ethereum.CallResult(); - } - let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBoolean()); - } - - voteOptionsMaxLeafIndex(): BigInt { - let result = super.call( - "voteOptionsMaxLeafIndex", - "voteOptionsMaxLeafIndex():(uint256)", - [] - ); + topupCredit(): Address { + let result = super.call("topupCredit", "topupCredit():(address)", []); - return result[0].toBigInt(); + return result[0].toAddress(); } - try_voteOptionsMaxLeafIndex(): ethereum.CallResult { - let result = super.tryCall( - "voteOptionsMaxLeafIndex", - "voteOptionsMaxLeafIndex():(uint256)", - [] - ); + try_topupCredit(): ethereum.CallResult
{ + let result = super.tryCall("topupCredit", "topupCredit():(address)", []); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); + return ethereum.CallResult.fromValue(value[0].toAddress()); } - votingDurationSeconds(): BigInt { - let result = super.call( - "votingDurationSeconds", - "votingDurationSeconds():(uint256)", - [] - ); + vkRegistry(): Address { + let result = super.call("vkRegistry", "vkRegistry():(address)", []); - return result[0].toBigInt(); + return result[0].toAddress(); } - try_votingDurationSeconds(): ethereum.CallResult { - let result = super.tryCall( - "votingDurationSeconds", - "votingDurationSeconds():(uint256)", - [] - ); + try_vkRegistry(): ethereum.CallResult
{ + let result = super.tryCall("vkRegistry", "vkRegistry():(address)", []); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; - return ethereum.CallResult.fromValue(value[0].toBigInt()); + return ethereum.CallResult.fromValue(value[0].toAddress()); } } @@ -1332,106 +767,108 @@ export class ConstructorCall__Inputs { this._call = call; } - get _treeDepths(): ConstructorCall_treeDepthsStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); + get _pollFactory(): Address { + return this._call.inputValues[0].value.toAddress(); } - get _batchSizes(): ConstructorCall_batchSizesStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); + get _signUpGatekeeper(): Address { + return this._call.inputValues[1].value.toAddress(); } - get _maxValues(): ConstructorCall_maxValuesStruct { - return changetype( - this._call.inputValues[2].value.toTuple() - ); + get _initialVoiceCreditProxy(): Address { + return this._call.inputValues[2].value.toAddress(); } +} - get _signUpGatekeeper(): Address { - return this._call.inputValues[3].value.toAddress(); +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; } +} - get _batchUstVerifier(): Address { - return this._call.inputValues[4].value.toAddress(); +export class DeployPollCall extends ethereum.Call { + get inputs(): DeployPollCall__Inputs { + return new DeployPollCall__Inputs(this); } - get _qvtVerifier(): Address { - return this._call.inputValues[5].value.toAddress(); + get outputs(): DeployPollCall__Outputs { + return new DeployPollCall__Outputs(this); } +} - get _signUpDurationSeconds(): BigInt { - return this._call.inputValues[6].value.toBigInt(); +export class DeployPollCall__Inputs { + _call: DeployPollCall; + + constructor(call: DeployPollCall) { + this._call = call; } - get _votingDurationSeconds(): BigInt { - return this._call.inputValues[7].value.toBigInt(); + get _duration(): BigInt { + return this._call.inputValues[0].value.toBigInt(); } - get _initialVoiceCreditProxy(): Address { - return this._call.inputValues[8].value.toAddress(); + get _maxValues(): DeployPollCall_maxValuesStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); } - get _coordinatorPubKey(): ConstructorCall_coordinatorPubKeyStruct { - return changetype( - this._call.inputValues[9].value.toTuple() + get _treeDepths(): DeployPollCall_treeDepthsStruct { + return changetype( + this._call.inputValues[2].value.toTuple() ); } - get _coordinatorAddress(): Address { - return this._call.inputValues[10].value.toAddress(); + get _coordinatorPubKey(): DeployPollCall_coordinatorPubKeyStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); } } -export class ConstructorCall__Outputs { - _call: ConstructorCall; +export class DeployPollCall__Outputs { + _call: DeployPollCall; - constructor(call: ConstructorCall) { + constructor(call: DeployPollCall) { this._call = call; } -} -export class ConstructorCall_treeDepthsStruct extends ethereum.Tuple { - get stateTreeDepth(): i32 { - return this[0].toI32(); + get value0(): Address { + return this._call.outputValues[0].value.toAddress(); } +} - get messageTreeDepth(): i32 { - return this[1].toI32(); +export class DeployPollCall_maxValuesStruct extends ethereum.Tuple { + get maxMessages(): BigInt { + return this[0].toBigInt(); } - get voteOptionTreeDepth(): i32 { - return this[2].toI32(); + get maxVoteOptions(): BigInt { + return this[1].toBigInt(); } } -export class ConstructorCall_batchSizesStruct extends ethereum.Tuple { - get tallyBatchSize(): i32 { +export class DeployPollCall_treeDepthsStruct extends ethereum.Tuple { + get intStateTreeDepth(): i32 { return this[0].toI32(); } - get messageBatchSize(): i32 { + get messageTreeSubDepth(): i32 { return this[1].toI32(); } -} - -export class ConstructorCall_maxValuesStruct extends ethereum.Tuple { - get maxUsers(): BigInt { - return this[0].toBigInt(); - } - get maxMessages(): BigInt { - return this[1].toBigInt(); + get messageTreeDepth(): i32 { + return this[2].toI32(); } - get maxVoteOptions(): BigInt { - return this[2].toBigInt(); + get voteOptionTreeDepth(): i32 { + return this[3].toI32(); } } -export class ConstructorCall_coordinatorPubKeyStruct extends ethereum.Tuple { +export class DeployPollCall_coordinatorPubKeyStruct extends ethereum.Tuple { get x(): BigInt { return this[0].toBigInt(); } @@ -1441,190 +878,134 @@ export class ConstructorCall_coordinatorPubKeyStruct extends ethereum.Tuple { } } -export class BatchProcessMessageCall extends ethereum.Call { - get inputs(): BatchProcessMessageCall__Inputs { - return new BatchProcessMessageCall__Inputs(this); +export class InitCall extends ethereum.Call { + get inputs(): InitCall__Inputs { + return new InitCall__Inputs(this); } - get outputs(): BatchProcessMessageCall__Outputs { - return new BatchProcessMessageCall__Outputs(this); + get outputs(): InitCall__Outputs { + return new InitCall__Outputs(this); } } -export class BatchProcessMessageCall__Inputs { - _call: BatchProcessMessageCall; +export class InitCall__Inputs { + _call: InitCall; - constructor(call: BatchProcessMessageCall) { + constructor(call: InitCall) { this._call = call; } - get _newStateRoot(): BigInt { - return this._call.inputValues[0].value.toBigInt(); - } - - get _ecdhPubKeys(): Array { - return this._call.inputValues[1].value.toTupleArray< - BatchProcessMessageCall_ecdhPubKeysStruct - >(); + get _vkRegistry(): Address { + return this._call.inputValues[0].value.toAddress(); } - get _proof(): Array { - return this._call.inputValues[2].value.toBigIntArray(); + get _topupCredit(): Address { + return this._call.inputValues[1].value.toAddress(); } } -export class BatchProcessMessageCall__Outputs { - _call: BatchProcessMessageCall; +export class InitCall__Outputs { + _call: InitCall; - constructor(call: BatchProcessMessageCall) { + constructor(call: InitCall) { this._call = call; } } -export class BatchProcessMessageCall_ecdhPubKeysStruct extends ethereum.Tuple { - get x(): BigInt { - return this[0].toBigInt(); +export class MergeStateAqCall extends ethereum.Call { + get inputs(): MergeStateAqCall__Inputs { + return new MergeStateAqCall__Inputs(this); } - get y(): BigInt { - return this[1].toBigInt(); + get outputs(): MergeStateAqCall__Outputs { + return new MergeStateAqCall__Outputs(this); } } -export class CoordinatorResetCall extends ethereum.Call { - get inputs(): CoordinatorResetCall__Inputs { - return new CoordinatorResetCall__Inputs(this); +export class MergeStateAqCall__Inputs { + _call: MergeStateAqCall; + + constructor(call: MergeStateAqCall) { + this._call = call; } - get outputs(): CoordinatorResetCall__Outputs { - return new CoordinatorResetCall__Outputs(this); + get _pollId(): BigInt { + return this._call.inputValues[0].value.toBigInt(); } } -export class CoordinatorResetCall__Inputs { - _call: CoordinatorResetCall; +export class MergeStateAqCall__Outputs { + _call: MergeStateAqCall; - constructor(call: CoordinatorResetCall) { + constructor(call: MergeStateAqCall) { this._call = call; } -} -export class CoordinatorResetCall__Outputs { - _call: CoordinatorResetCall; - - constructor(call: CoordinatorResetCall) { - this._call = call; + get value0(): BigInt { + return this._call.outputValues[0].value.toBigInt(); } } -export class ProveVoteTallyBatchCall extends ethereum.Call { - get inputs(): ProveVoteTallyBatchCall__Inputs { - return new ProveVoteTallyBatchCall__Inputs(this); +export class MergeStateAqSubRootsCall extends ethereum.Call { + get inputs(): MergeStateAqSubRootsCall__Inputs { + return new MergeStateAqSubRootsCall__Inputs(this); } - get outputs(): ProveVoteTallyBatchCall__Outputs { - return new ProveVoteTallyBatchCall__Outputs(this); + get outputs(): MergeStateAqSubRootsCall__Outputs { + return new MergeStateAqSubRootsCall__Outputs(this); } } -export class ProveVoteTallyBatchCall__Inputs { - _call: ProveVoteTallyBatchCall; +export class MergeStateAqSubRootsCall__Inputs { + _call: MergeStateAqSubRootsCall; - constructor(call: ProveVoteTallyBatchCall) { + constructor(call: MergeStateAqSubRootsCall) { this._call = call; } - get _intermediateStateRoot(): BigInt { + get _numSrQueueOps(): BigInt { return this._call.inputValues[0].value.toBigInt(); } - get _newResultsCommitment(): BigInt { + get _pollId(): BigInt { return this._call.inputValues[1].value.toBigInt(); } - - get _newSpentVoiceCreditsCommitment(): BigInt { - return this._call.inputValues[2].value.toBigInt(); - } - - get _newPerVOSpentVoiceCreditsCommitment(): BigInt { - return this._call.inputValues[3].value.toBigInt(); - } - - get _totalVotes(): BigInt { - return this._call.inputValues[4].value.toBigInt(); - } - - get _proof(): Array { - return this._call.inputValues[5].value.toBigIntArray(); - } } -export class ProveVoteTallyBatchCall__Outputs { - _call: ProveVoteTallyBatchCall; +export class MergeStateAqSubRootsCall__Outputs { + _call: MergeStateAqSubRootsCall; - constructor(call: ProveVoteTallyBatchCall) { + constructor(call: MergeStateAqSubRootsCall) { this._call = call; } } -export class PublishMessageCall extends ethereum.Call { - get inputs(): PublishMessageCall__Inputs { - return new PublishMessageCall__Inputs(this); +export class RenounceOwnershipCall extends ethereum.Call { + get inputs(): RenounceOwnershipCall__Inputs { + return new RenounceOwnershipCall__Inputs(this); } - get outputs(): PublishMessageCall__Outputs { - return new PublishMessageCall__Outputs(this); + get outputs(): RenounceOwnershipCall__Outputs { + return new RenounceOwnershipCall__Outputs(this); } } -export class PublishMessageCall__Inputs { - _call: PublishMessageCall; +export class RenounceOwnershipCall__Inputs { + _call: RenounceOwnershipCall; - constructor(call: PublishMessageCall) { + constructor(call: RenounceOwnershipCall) { this._call = call; } - - get _message(): PublishMessageCall_messageStruct { - return changetype( - this._call.inputValues[0].value.toTuple() - ); - } - - get _encPubKey(): PublishMessageCall_encPubKeyStruct { - return changetype( - this._call.inputValues[1].value.toTuple() - ); - } } -export class PublishMessageCall__Outputs { - _call: PublishMessageCall; +export class RenounceOwnershipCall__Outputs { + _call: RenounceOwnershipCall; - constructor(call: PublishMessageCall) { + constructor(call: RenounceOwnershipCall) { this._call = call; } } -export class PublishMessageCall_messageStruct extends ethereum.Tuple { - get iv(): BigInt { - return this[0].toBigInt(); - } - - get data(): Array { - return this[1].toBigIntArray(); - } -} - -export class PublishMessageCall_encPubKeyStruct extends ethereum.Tuple { - get x(): BigInt { - return this[0].toBigInt(); - } - - get y(): BigInt { - return this[1].toBigInt(); - } -} - export class SignUpCall extends ethereum.Call { get inputs(): SignUpCall__Inputs { return new SignUpCall__Inputs(this); @@ -1642,8 +1023,8 @@ export class SignUpCall__Inputs { this._call = call; } - get _userPubKey(): SignUpCall_userPubKeyStruct { - return changetype( + get _pubKey(): SignUpCall_pubKeyStruct { + return changetype( this._call.inputValues[0].value.toTuple() ); } @@ -1665,7 +1046,7 @@ export class SignUpCall__Outputs { } } -export class SignUpCall_userPubKeyStruct extends ethereum.Tuple { +export class SignUpCall_pubKeyStruct extends ethereum.Tuple { get x(): BigInt { return this[0].toBigInt(); } @@ -1674,3 +1055,33 @@ export class SignUpCall_userPubKeyStruct extends ethereum.Tuple { return this[1].toBigInt(); } } + +export class TransferOwnershipCall extends ethereum.Call { + get inputs(): TransferOwnershipCall__Inputs { + return new TransferOwnershipCall__Inputs(this); + } + + get outputs(): TransferOwnershipCall__Outputs { + return new TransferOwnershipCall__Outputs(this); + } +} + +export class TransferOwnershipCall__Inputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } + + get newOwner(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class TransferOwnershipCall__Outputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } +} diff --git a/subgraph/generated/templates/OptimisticRecipientRegistry/OptimisticRecipientRegistry.ts b/subgraph/generated/templates/OptimisticRecipientRegistry/OptimisticRecipientRegistry.ts index 20d805ce5..afb85c261 100644 --- a/subgraph/generated/templates/OptimisticRecipientRegistry/OptimisticRecipientRegistry.ts +++ b/subgraph/generated/templates/OptimisticRecipientRegistry/OptimisticRecipientRegistry.ts @@ -255,6 +255,29 @@ export class OptimisticRecipientRegistry extends ethereum.SmartContract { return ethereum.CallResult.fromValue(value[0].toAddress()); } + getRecipientCount(): BigInt { + let result = super.call( + "getRecipientCount", + "getRecipientCount():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_getRecipientCount(): ethereum.CallResult { + let result = super.tryCall( + "getRecipientCount", + "getRecipientCount():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + maxRecipients(): BigInt { let result = super.call("maxRecipients", "maxRecipients():(uint256)", []); diff --git a/subgraph/generated/templates/Poll/FundingRound.ts b/subgraph/generated/templates/Poll/FundingRound.ts new file mode 100644 index 000000000..bde4327d0 --- /dev/null +++ b/subgraph/generated/templates/Poll/FundingRound.ts @@ -0,0 +1,842 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class Contribution extends ethereum.Event { + get params(): Contribution__Params { + return new Contribution__Params(this); + } +} + +export class Contribution__Params { + _event: Contribution; + + constructor(event: Contribution) { + this._event = event; + } + + get _sender(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get _amount(): BigInt { + return this._event.parameters[1].value.toBigInt(); + } +} + +export class ContributionWithdrawn extends ethereum.Event { + get params(): ContributionWithdrawn__Params { + return new ContributionWithdrawn__Params(this); + } +} + +export class ContributionWithdrawn__Params { + _event: ContributionWithdrawn; + + constructor(event: ContributionWithdrawn) { + this._event = event; + } + + get _contributor(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class FundsClaimed extends ethereum.Event { + get params(): FundsClaimed__Params { + return new FundsClaimed__Params(this); + } +} + +export class FundsClaimed__Params { + _event: FundsClaimed; + + constructor(event: FundsClaimed) { + this._event = event; + } + + get _voteOptionIndex(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } + + get _recipient(): Address { + return this._event.parameters[1].value.toAddress(); + } + + get _amount(): BigInt { + return this._event.parameters[2].value.toBigInt(); + } +} + +export class OwnershipTransferred extends ethereum.Event { + get params(): OwnershipTransferred__Params { + return new OwnershipTransferred__Params(this); + } +} + +export class OwnershipTransferred__Params { + _event: OwnershipTransferred; + + constructor(event: OwnershipTransferred) { + this._event = event; + } + + get previousOwner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newOwner(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class TallyPublished extends ethereum.Event { + get params(): TallyPublished__Params { + return new TallyPublished__Params(this); + } +} + +export class TallyPublished__Params { + _event: TallyPublished; + + constructor(event: TallyPublished) { + this._event = event; + } + + get _tallyHash(): string { + return this._event.parameters[0].value.toString(); + } +} + +export class Voted extends ethereum.Event { + get params(): Voted__Params { + return new Voted__Params(this); + } +} + +export class Voted__Params { + _event: Voted; + + constructor(event: Voted) { + this._event = event; + } + + get _contributor(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class FundingRound extends ethereum.SmartContract { + static bind(address: Address): FundingRound { + return new FundingRound("FundingRound", address); + } + + contributorCount(): BigInt { + let result = super.call( + "contributorCount", + "contributorCount():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_contributorCount(): ethereum.CallResult { + let result = super.tryCall( + "contributorCount", + "contributorCount():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + coordinator(): Address { + let result = super.call("coordinator", "coordinator():(address)", []); + + return result[0].toAddress(); + } + + try_coordinator(): ethereum.CallResult
{ + let result = super.tryCall("coordinator", "coordinator():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + getAllocatedAmount(_tallyResult: BigInt, _spent: BigInt): BigInt { + let result = super.call( + "getAllocatedAmount", + "getAllocatedAmount(uint256,uint256):(uint256)", + [ + ethereum.Value.fromUnsignedBigInt(_tallyResult), + ethereum.Value.fromUnsignedBigInt(_spent) + ] + ); + + return result[0].toBigInt(); + } + + try_getAllocatedAmount( + _tallyResult: BigInt, + _spent: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "getAllocatedAmount", + "getAllocatedAmount(uint256,uint256):(uint256)", + [ + ethereum.Value.fromUnsignedBigInt(_tallyResult), + ethereum.Value.fromUnsignedBigInt(_spent) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + getVoiceCredits(param0: Address, _data: Bytes): BigInt { + let result = super.call( + "getVoiceCredits", + "getVoiceCredits(address,bytes):(uint256)", + [ethereum.Value.fromAddress(param0), ethereum.Value.fromBytes(_data)] + ); + + return result[0].toBigInt(); + } + + try_getVoiceCredits( + param0: Address, + _data: Bytes + ): ethereum.CallResult { + let result = super.tryCall( + "getVoiceCredits", + "getVoiceCredits(address,bytes):(uint256)", + [ethereum.Value.fromAddress(param0), ethereum.Value.fromBytes(_data)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + isCancelled(): boolean { + let result = super.call("isCancelled", "isCancelled():(bool)", []); + + return result[0].toBoolean(); + } + + try_isCancelled(): ethereum.CallResult { + let result = super.tryCall("isCancelled", "isCancelled():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + isFinalized(): boolean { + let result = super.call("isFinalized", "isFinalized():(bool)", []); + + return result[0].toBoolean(); + } + + try_isFinalized(): ethereum.CallResult { + let result = super.tryCall("isFinalized", "isFinalized():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + maci(): Address { + let result = super.call("maci", "maci():(address)", []); + + return result[0].toAddress(); + } + + try_maci(): ethereum.CallResult
{ + let result = super.tryCall("maci", "maci():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + matchingPoolSize(): BigInt { + let result = super.call( + "matchingPoolSize", + "matchingPoolSize():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_matchingPoolSize(): ethereum.CallResult { + let result = super.tryCall( + "matchingPoolSize", + "matchingPoolSize():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + nativeToken(): Address { + let result = super.call("nativeToken", "nativeToken():(address)", []); + + return result[0].toAddress(); + } + + try_nativeToken(): ethereum.CallResult
{ + let result = super.tryCall("nativeToken", "nativeToken():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + owner(): Address { + let result = super.call("owner", "owner():(address)", []); + + return result[0].toAddress(); + } + + try_owner(): ethereum.CallResult
{ + let result = super.tryCall("owner", "owner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + recipientRegistry(): Address { + let result = super.call( + "recipientRegistry", + "recipientRegistry():(address)", + [] + ); + + return result[0].toAddress(); + } + + try_recipientRegistry(): ethereum.CallResult
{ + let result = super.tryCall( + "recipientRegistry", + "recipientRegistry():(address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + tallyHash(): string { + let result = super.call("tallyHash", "tallyHash():(string)", []); + + return result[0].toString(); + } + + try_tallyHash(): ethereum.CallResult { + let result = super.tryCall("tallyHash", "tallyHash():(string)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + poll(): Address { + let result = super.call("poll", "poll():(address)", []); + + return result[0].toAddress(); + } + + try_poll(): ethereum.CallResult
{ + let result = super.tryCall("poll", "poll():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + totalSpent(): BigInt { + let result = super.call("totalSpent", "totalSpent():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalSpent(): ethereum.CallResult { + let result = super.tryCall("totalSpent", "totalSpent():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + totalVotes(): BigInt { + let result = super.call("totalVotes", "totalVotes():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalVotes(): ethereum.CallResult { + let result = super.tryCall("totalVotes", "totalVotes():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + userRegistry(): Address { + let result = super.call("userRegistry", "userRegistry():(address)", []); + + return result[0].toAddress(); + } + + try_userRegistry(): ethereum.CallResult
{ + let result = super.tryCall("userRegistry", "userRegistry():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + voiceCreditFactor(): BigInt { + let result = super.call( + "voiceCreditFactor", + "voiceCreditFactor():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_voiceCreditFactor(): ethereum.CallResult { + let result = super.tryCall( + "voiceCreditFactor", + "voiceCreditFactor():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get _nativeToken(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get _userRegistry(): Address { + return this._call.inputValues[1].value.toAddress(); + } + + get _recipientRegistry(): Address { + return this._call.inputValues[2].value.toAddress(); + } + + get _coordinator(): Address { + return this._call.inputValues[3].value.toAddress(); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class CancelCall extends ethereum.Call { + get inputs(): CancelCall__Inputs { + return new CancelCall__Inputs(this); + } + + get outputs(): CancelCall__Outputs { + return new CancelCall__Outputs(this); + } +} + +export class CancelCall__Inputs { + _call: CancelCall; + + constructor(call: CancelCall) { + this._call = call; + } +} + +export class CancelCall__Outputs { + _call: CancelCall; + + constructor(call: CancelCall) { + this._call = call; + } +} + +export class ContributeCall extends ethereum.Call { + get inputs(): ContributeCall__Inputs { + return new ContributeCall__Inputs(this); + } + + get outputs(): ContributeCall__Outputs { + return new ContributeCall__Outputs(this); + } +} + +export class ContributeCall__Inputs { + _call: ContributeCall; + + constructor(call: ContributeCall) { + this._call = call; + } + + get pubKey(): ContributeCallPubKeyStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class ContributeCall__Outputs { + _call: ContributeCall; + + constructor(call: ContributeCall) { + this._call = call; + } +} + +export class ContributeCallPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class FinalizeCall extends ethereum.Call { + get inputs(): FinalizeCall__Inputs { + return new FinalizeCall__Inputs(this); + } + + get outputs(): FinalizeCall__Outputs { + return new FinalizeCall__Outputs(this); + } +} + +export class FinalizeCall__Inputs { + _call: FinalizeCall; + + constructor(call: FinalizeCall) { + this._call = call; + } + + get _totalSpent(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get _totalSpentSalt(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class FinalizeCall__Outputs { + _call: FinalizeCall; + + constructor(call: FinalizeCall) { + this._call = call; + } +} + +export class PublishTallyHashCall extends ethereum.Call { + get inputs(): PublishTallyHashCall__Inputs { + return new PublishTallyHashCall__Inputs(this); + } + + get outputs(): PublishTallyHashCall__Outputs { + return new PublishTallyHashCall__Outputs(this); + } +} + +export class PublishTallyHashCall__Inputs { + _call: PublishTallyHashCall; + + constructor(call: PublishTallyHashCall) { + this._call = call; + } + + get _tallyHash(): string { + return this._call.inputValues[0].value.toString(); + } +} + +export class PublishTallyHashCall__Outputs { + _call: PublishTallyHashCall; + + constructor(call: PublishTallyHashCall) { + this._call = call; + } +} + +export class RegisterCall extends ethereum.Call { + get inputs(): RegisterCall__Inputs { + return new RegisterCall__Inputs(this); + } + + get outputs(): RegisterCall__Outputs { + return new RegisterCall__Outputs(this); + } +} + +export class RegisterCall__Inputs { + _call: RegisterCall; + + constructor(call: RegisterCall) { + this._call = call; + } + + get value0(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get _data(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class RegisterCall__Outputs { + _call: RegisterCall; + + constructor(call: RegisterCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall extends ethereum.Call { + get inputs(): RenounceOwnershipCall__Inputs { + return new RenounceOwnershipCall__Inputs(this); + } + + get outputs(): RenounceOwnershipCall__Outputs { + return new RenounceOwnershipCall__Outputs(this); + } +} + +export class RenounceOwnershipCall__Inputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall__Outputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class SetMaciCall extends ethereum.Call { + get inputs(): SetMaciCall__Inputs { + return new SetMaciCall__Inputs(this); + } + + get outputs(): SetMaciCall__Outputs { + return new SetMaciCall__Outputs(this); + } +} + +export class SetMaciCall__Inputs { + _call: SetMaciCall; + + constructor(call: SetMaciCall) { + this._call = call; + } + + get _maci(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetMaciCall__Outputs { + _call: SetMaciCall; + + constructor(call: SetMaciCall) { + this._call = call; + } +} + +export class SubmitMessageBatchCall extends ethereum.Call { + get inputs(): SubmitMessageBatchCall__Inputs { + return new SubmitMessageBatchCall__Inputs(this); + } + + get outputs(): SubmitMessageBatchCall__Outputs { + return new SubmitMessageBatchCall__Outputs(this); + } +} + +export class SubmitMessageBatchCall__Inputs { + _call: SubmitMessageBatchCall; + + constructor(call: SubmitMessageBatchCall) { + this._call = call; + } + + get _messages(): Array { + return this._call.inputValues[0].value.toTupleArray< + SubmitMessageBatchCall_messagesStruct + >(); + } + + get _encPubKeys(): Array { + return this._call.inputValues[1].value.toTupleArray< + SubmitMessageBatchCall_encPubKeysStruct + >(); + } +} + +export class SubmitMessageBatchCall__Outputs { + _call: SubmitMessageBatchCall; + + constructor(call: SubmitMessageBatchCall) { + this._call = call; + } +} + +export class SubmitMessageBatchCall_messagesStruct extends ethereum.Tuple { + get iv(): BigInt { + return this[0].toBigInt(); + } + + get data(): Array { + return this[1].toBigIntArray(); + } +} + +export class SubmitMessageBatchCall_encPubKeysStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class TransferOwnershipCall extends ethereum.Call { + get inputs(): TransferOwnershipCall__Inputs { + return new TransferOwnershipCall__Inputs(this); + } + + get outputs(): TransferOwnershipCall__Outputs { + return new TransferOwnershipCall__Outputs(this); + } +} + +export class TransferOwnershipCall__Inputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } + + get newOwner(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class TransferOwnershipCall__Outputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } +} + +export class WithdrawContributionCall extends ethereum.Call { + get inputs(): WithdrawContributionCall__Inputs { + return new WithdrawContributionCall__Inputs(this); + } + + get outputs(): WithdrawContributionCall__Outputs { + return new WithdrawContributionCall__Outputs(this); + } +} + +export class WithdrawContributionCall__Inputs { + _call: WithdrawContributionCall; + + constructor(call: WithdrawContributionCall) { + this._call = call; + } + + get _contributors(): Array
{ + return this._call.inputValues[0].value.toAddressArray(); + } +} + +export class WithdrawContributionCall__Outputs { + _call: WithdrawContributionCall; + + constructor(call: WithdrawContributionCall) { + this._call = call; + } +} diff --git a/subgraph/generated/templates/Poll/Poll.ts b/subgraph/generated/templates/Poll/Poll.ts new file mode 100644 index 000000000..193c7b156 --- /dev/null +++ b/subgraph/generated/templates/Poll/Poll.ts @@ -0,0 +1,1461 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt +} from "@graphprotocol/graph-ts"; + +export class MergeMaciStateAq extends ethereum.Event { + get params(): MergeMaciStateAq__Params { + return new MergeMaciStateAq__Params(this); + } +} + +export class MergeMaciStateAq__Params { + _event: MergeMaciStateAq; + + constructor(event: MergeMaciStateAq) { + this._event = event; + } + + get _stateRoot(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class MergeMaciStateAqSubRoots extends ethereum.Event { + get params(): MergeMaciStateAqSubRoots__Params { + return new MergeMaciStateAqSubRoots__Params(this); + } +} + +export class MergeMaciStateAqSubRoots__Params { + _event: MergeMaciStateAqSubRoots; + + constructor(event: MergeMaciStateAqSubRoots) { + this._event = event; + } + + get _numSrQueueOps(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class MergeMessageAq extends ethereum.Event { + get params(): MergeMessageAq__Params { + return new MergeMessageAq__Params(this); + } +} + +export class MergeMessageAq__Params { + _event: MergeMessageAq; + + constructor(event: MergeMessageAq) { + this._event = event; + } + + get _messageRoot(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class MergeMessageAqSubRoots extends ethereum.Event { + get params(): MergeMessageAqSubRoots__Params { + return new MergeMessageAqSubRoots__Params(this); + } +} + +export class MergeMessageAqSubRoots__Params { + _event: MergeMessageAqSubRoots; + + constructor(event: MergeMessageAqSubRoots) { + this._event = event; + } + + get _numSrQueueOps(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class OwnershipTransferred extends ethereum.Event { + get params(): OwnershipTransferred__Params { + return new OwnershipTransferred__Params(this); + } +} + +export class OwnershipTransferred__Params { + _event: OwnershipTransferred; + + constructor(event: OwnershipTransferred) { + this._event = event; + } + + get previousOwner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newOwner(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class PublishMessage extends ethereum.Event { + get params(): PublishMessage__Params { + return new PublishMessage__Params(this); + } +} + +export class PublishMessage__Params { + _event: PublishMessage; + + constructor(event: PublishMessage) { + this._event = event; + } + + get _message(): PublishMessage_messageStruct { + return changetype( + this._event.parameters[0].value.toTuple() + ); + } + + get _encPubKey(): PublishMessage_encPubKeyStruct { + return changetype( + this._event.parameters[1].value.toTuple() + ); + } +} + +export class PublishMessage_messageStruct extends ethereum.Tuple { + get msgType(): BigInt { + return this[0].toBigInt(); + } + + get data(): Array { + return this[1].toBigIntArray(); + } +} + +export class PublishMessage_encPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class TopupMessage extends ethereum.Event { + get params(): TopupMessage__Params { + return new TopupMessage__Params(this); + } +} + +export class TopupMessage__Params { + _event: TopupMessage; + + constructor(event: TopupMessage) { + this._event = event; + } + + get _message(): TopupMessage_messageStruct { + return changetype( + this._event.parameters[0].value.toTuple() + ); + } +} + +export class TopupMessage_messageStruct extends ethereum.Tuple { + get msgType(): BigInt { + return this[0].toBigInt(); + } + + get data(): Array { + return this[1].toBigIntArray(); + } +} + +export class Poll__batchSizesResult { + value0: i32; + value1: i32; + value2: i32; + + constructor(value0: i32, value1: i32, value2: i32) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set( + "value0", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value0)) + ); + map.set( + "value1", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) + ); + map.set( + "value2", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value2)) + ); + return map; + } + + getMessageBatchSize(): i32 { + return this.value0; + } + + getTallyBatchSize(): i32 { + return this.value1; + } + + getSubsidyBatchSize(): i32 { + return this.value2; + } +} + +export class Poll__coordinatorPubKeyResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getX(): BigInt { + return this.value0; + } + + getY(): BigInt { + return this.value1; + } +} + +export class Poll__extContractsResult { + value0: Address; + value1: Address; + value2: Address; + value3: Address; + + constructor( + value0: Address, + value1: Address, + value2: Address, + value3: Address + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromAddress(this.value0)); + map.set("value1", ethereum.Value.fromAddress(this.value1)); + map.set("value2", ethereum.Value.fromAddress(this.value2)); + map.set("value3", ethereum.Value.fromAddress(this.value3)); + return map; + } + + getVkRegistry(): Address { + return this.value0; + } + + getMaci(): Address { + return this.value1; + } + + getMessageAq(): Address { + return this.value2; + } + + getTopupCredit(): Address { + return this.value3; + } +} + +export class Poll__getDeployTimeAndDurationResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getValue0(): BigInt { + return this.value0; + } + + getValue1(): BigInt { + return this.value1; + } +} + +export class Poll__hashMessageAndEncPubKeyInput_messageStruct extends ethereum.Tuple { + get msgType(): BigInt { + return this[0].toBigInt(); + } + + get data(): Array { + return this[1].toBigIntArray(); + } +} + +export class Poll__hashMessageAndEncPubKeyInput_encPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class Poll__maxValuesResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getMaxMessages(): BigInt { + return this.value0; + } + + getMaxVoteOptions(): BigInt { + return this.value1; + } +} + +export class Poll__numSignUpsAndMessagesResult { + value0: BigInt; + value1: BigInt; + + constructor(value0: BigInt, value1: BigInt) { + this.value0 = value0; + this.value1 = value1; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromUnsignedBigInt(this.value0)); + map.set("value1", ethereum.Value.fromUnsignedBigInt(this.value1)); + return map; + } + + getValue0(): BigInt { + return this.value0; + } + + getValue1(): BigInt { + return this.value1; + } +} + +export class Poll__padAndHashMessageResultValue0Struct extends ethereum.Tuple { + get msgType(): BigInt { + return this[0].toBigInt(); + } + + get data(): Array { + return this[1].toBigIntArray(); + } +} + +export class Poll__padAndHashMessageResultValue1Struct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class Poll__padAndHashMessageResult { + value0: Poll__padAndHashMessageResultValue0Struct; + value1: Poll__padAndHashMessageResultValue1Struct; + value2: BigInt; + + constructor( + value0: Poll__padAndHashMessageResultValue0Struct, + value1: Poll__padAndHashMessageResultValue1Struct, + value2: BigInt + ) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set("value0", ethereum.Value.fromTuple(this.value0)); + map.set("value1", ethereum.Value.fromTuple(this.value1)); + map.set("value2", ethereum.Value.fromUnsignedBigInt(this.value2)); + return map; + } + + getValue0(): Poll__padAndHashMessageResultValue0Struct { + return this.value0; + } + + getValue1(): Poll__padAndHashMessageResultValue1Struct { + return this.value1; + } + + getValue2(): BigInt { + return this.value2; + } +} + +export class Poll__treeDepthsResult { + value0: i32; + value1: i32; + value2: i32; + value3: i32; + + constructor(value0: i32, value1: i32, value2: i32, value3: i32) { + this.value0 = value0; + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + + toMap(): TypedMap { + let map = new TypedMap(); + map.set( + "value0", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value0)) + ); + map.set( + "value1", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value1)) + ); + map.set( + "value2", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value2)) + ); + map.set( + "value3", + ethereum.Value.fromUnsignedBigInt(BigInt.fromI32(this.value3)) + ); + return map; + } + + getIntStateTreeDepth(): i32 { + return this.value0; + } + + getMessageTreeSubDepth(): i32 { + return this.value1; + } + + getMessageTreeDepth(): i32 { + return this.value2; + } + + getVoteOptionTreeDepth(): i32 { + return this.value3; + } +} + +export class Poll extends ethereum.SmartContract { + static bind(address: Address): Poll { + return new Poll("Poll", address); + } + + batchSizes(): Poll__batchSizesResult { + let result = super.call( + "batchSizes", + "batchSizes():(uint24,uint24,uint24)", + [] + ); + + return new Poll__batchSizesResult( + result[0].toI32(), + result[1].toI32(), + result[2].toI32() + ); + } + + try_batchSizes(): ethereum.CallResult { + let result = super.tryCall( + "batchSizes", + "batchSizes():(uint24,uint24,uint24)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__batchSizesResult( + value[0].toI32(), + value[1].toI32(), + value[2].toI32() + ) + ); + } + + coordinatorPubKey(): Poll__coordinatorPubKeyResult { + let result = super.call( + "coordinatorPubKey", + "coordinatorPubKey():(uint256,uint256)", + [] + ); + + return new Poll__coordinatorPubKeyResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_coordinatorPubKey(): ethereum.CallResult { + let result = super.tryCall( + "coordinatorPubKey", + "coordinatorPubKey():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__coordinatorPubKeyResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + coordinatorPubKeyHash(): BigInt { + let result = super.call( + "coordinatorPubKeyHash", + "coordinatorPubKeyHash():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_coordinatorPubKeyHash(): ethereum.CallResult { + let result = super.tryCall( + "coordinatorPubKeyHash", + "coordinatorPubKeyHash():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + currentSbCommitment(): BigInt { + let result = super.call( + "currentSbCommitment", + "currentSbCommitment():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_currentSbCommitment(): ethereum.CallResult { + let result = super.tryCall( + "currentSbCommitment", + "currentSbCommitment():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + extContracts(): Poll__extContractsResult { + let result = super.call( + "extContracts", + "extContracts():(address,address,address,address)", + [] + ); + + return new Poll__extContractsResult( + result[0].toAddress(), + result[1].toAddress(), + result[2].toAddress(), + result[3].toAddress() + ); + } + + try_extContracts(): ethereum.CallResult { + let result = super.tryCall( + "extContracts", + "extContracts():(address,address,address,address)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__extContractsResult( + value[0].toAddress(), + value[1].toAddress(), + value[2].toAddress(), + value[3].toAddress() + ) + ); + } + + getDeployTimeAndDuration(): Poll__getDeployTimeAndDurationResult { + let result = super.call( + "getDeployTimeAndDuration", + "getDeployTimeAndDuration():(uint256,uint256)", + [] + ); + + return new Poll__getDeployTimeAndDurationResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_getDeployTimeAndDuration(): ethereum.CallResult< + Poll__getDeployTimeAndDurationResult + > { + let result = super.tryCall( + "getDeployTimeAndDuration", + "getDeployTimeAndDuration():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__getDeployTimeAndDurationResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + hash2(array: Array): BigInt { + let result = super.call("hash2", "hash2(uint256[2]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_hash2(array: Array): ethereum.CallResult { + let result = super.tryCall("hash2", "hash2(uint256[2]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hash3(array: Array): BigInt { + let result = super.call("hash3", "hash3(uint256[3]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_hash3(array: Array): ethereum.CallResult { + let result = super.tryCall("hash3", "hash3(uint256[3]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hash4(array: Array): BigInt { + let result = super.call("hash4", "hash4(uint256[4]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_hash4(array: Array): ethereum.CallResult { + let result = super.tryCall("hash4", "hash4(uint256[4]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hash5(array: Array): BigInt { + let result = super.call("hash5", "hash5(uint256[5]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_hash5(array: Array): ethereum.CallResult { + let result = super.tryCall("hash5", "hash5(uint256[5]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hashLeftRight(_left: BigInt, _right: BigInt): BigInt { + let result = super.call( + "hashLeftRight", + "hashLeftRight(uint256,uint256):(uint256)", + [ + ethereum.Value.fromUnsignedBigInt(_left), + ethereum.Value.fromUnsignedBigInt(_right) + ] + ); + + return result[0].toBigInt(); + } + + try_hashLeftRight( + _left: BigInt, + _right: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "hashLeftRight", + "hashLeftRight(uint256,uint256):(uint256)", + [ + ethereum.Value.fromUnsignedBigInt(_left), + ethereum.Value.fromUnsignedBigInt(_right) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + hashMessageAndEncPubKey( + _message: Poll__hashMessageAndEncPubKeyInput_messageStruct, + _encPubKey: Poll__hashMessageAndEncPubKeyInput_encPubKeyStruct + ): BigInt { + let result = super.call( + "hashMessageAndEncPubKey", + "hashMessageAndEncPubKey((uint256,uint256[10]),(uint256,uint256)):(uint256)", + [ethereum.Value.fromTuple(_message), ethereum.Value.fromTuple(_encPubKey)] + ); + + return result[0].toBigInt(); + } + + try_hashMessageAndEncPubKey( + _message: Poll__hashMessageAndEncPubKeyInput_messageStruct, + _encPubKey: Poll__hashMessageAndEncPubKeyInput_encPubKeyStruct + ): ethereum.CallResult { + let result = super.tryCall( + "hashMessageAndEncPubKey", + "hashMessageAndEncPubKey((uint256,uint256[10]),(uint256,uint256)):(uint256)", + [ethereum.Value.fromTuple(_message), ethereum.Value.fromTuple(_encPubKey)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + maxValues(): Poll__maxValuesResult { + let result = super.call("maxValues", "maxValues():(uint256,uint256)", []); + + return new Poll__maxValuesResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_maxValues(): ethereum.CallResult { + let result = super.tryCall( + "maxValues", + "maxValues():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__maxValuesResult(value[0].toBigInt(), value[1].toBigInt()) + ); + } + + mergedStateRoot(): BigInt { + let result = super.call( + "mergedStateRoot", + "mergedStateRoot():(uint256)", + [] + ); + + return result[0].toBigInt(); + } + + try_mergedStateRoot(): ethereum.CallResult { + let result = super.tryCall( + "mergedStateRoot", + "mergedStateRoot():(uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + numSignUpsAndMessages(): Poll__numSignUpsAndMessagesResult { + let result = super.call( + "numSignUpsAndMessages", + "numSignUpsAndMessages():(uint256,uint256)", + [] + ); + + return new Poll__numSignUpsAndMessagesResult( + result[0].toBigInt(), + result[1].toBigInt() + ); + } + + try_numSignUpsAndMessages(): ethereum.CallResult< + Poll__numSignUpsAndMessagesResult + > { + let result = super.tryCall( + "numSignUpsAndMessages", + "numSignUpsAndMessages():(uint256,uint256)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__numSignUpsAndMessagesResult( + value[0].toBigInt(), + value[1].toBigInt() + ) + ); + } + + owner(): Address { + let result = super.call("owner", "owner():(address)", []); + + return result[0].toAddress(); + } + + try_owner(): ethereum.CallResult
{ + let result = super.tryCall("owner", "owner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + padAndHashMessage( + dataToPad: Array, + msgType: BigInt + ): Poll__padAndHashMessageResult { + let result = super.call( + "padAndHashMessage", + "padAndHashMessage(uint256[2],uint256):((uint256,uint256[10]),(uint256,uint256),uint256)", + [ + ethereum.Value.fromUnsignedBigIntArray(dataToPad), + ethereum.Value.fromUnsignedBigInt(msgType) + ] + ); + + return changetype( + new Poll__padAndHashMessageResult( + changetype( + result[0].toTuple() + ), + changetype( + result[1].toTuple() + ), + result[2].toBigInt() + ) + ); + } + + try_padAndHashMessage( + dataToPad: Array, + msgType: BigInt + ): ethereum.CallResult { + let result = super.tryCall( + "padAndHashMessage", + "padAndHashMessage(uint256[2],uint256):((uint256,uint256[10]),(uint256,uint256),uint256)", + [ + ethereum.Value.fromUnsignedBigIntArray(dataToPad), + ethereum.Value.fromUnsignedBigInt(msgType) + ] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + changetype( + new Poll__padAndHashMessageResult( + changetype( + value[0].toTuple() + ), + changetype( + value[1].toTuple() + ), + value[2].toBigInt() + ) + ) + ); + } + + sha256Hash(array: Array): BigInt { + let result = super.call("sha256Hash", "sha256Hash(uint256[]):(uint256)", [ + ethereum.Value.fromUnsignedBigIntArray(array) + ]); + + return result[0].toBigInt(); + } + + try_sha256Hash(array: Array): ethereum.CallResult { + let result = super.tryCall( + "sha256Hash", + "sha256Hash(uint256[]):(uint256)", + [ethereum.Value.fromUnsignedBigIntArray(array)] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + stateAqMerged(): boolean { + let result = super.call("stateAqMerged", "stateAqMerged():(bool)", []); + + return result[0].toBoolean(); + } + + try_stateAqMerged(): ethereum.CallResult { + let result = super.tryCall("stateAqMerged", "stateAqMerged():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + treeDepths(): Poll__treeDepthsResult { + let result = super.call( + "treeDepths", + "treeDepths():(uint8,uint8,uint8,uint8)", + [] + ); + + return new Poll__treeDepthsResult( + result[0].toI32(), + result[1].toI32(), + result[2].toI32(), + result[3].toI32() + ); + } + + try_treeDepths(): ethereum.CallResult { + let result = super.tryCall( + "treeDepths", + "treeDepths():(uint8,uint8,uint8,uint8)", + [] + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + new Poll__treeDepthsResult( + value[0].toI32(), + value[1].toI32(), + value[2].toI32(), + value[3].toI32() + ) + ); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get _duration(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get _maxValues(): ConstructorCall_maxValuesStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } + + get _treeDepths(): ConstructorCall_treeDepthsStruct { + return changetype( + this._call.inputValues[2].value.toTuple() + ); + } + + get _batchSizes(): ConstructorCall_batchSizesStruct { + return changetype( + this._call.inputValues[3].value.toTuple() + ); + } + + get _coordinatorPubKey(): ConstructorCall_coordinatorPubKeyStruct { + return changetype( + this._call.inputValues[4].value.toTuple() + ); + } + + get _extContracts(): ConstructorCall_extContractsStruct { + return changetype( + this._call.inputValues[5].value.toTuple() + ); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCall_maxValuesStruct extends ethereum.Tuple { + get maxMessages(): BigInt { + return this[0].toBigInt(); + } + + get maxVoteOptions(): BigInt { + return this[1].toBigInt(); + } +} + +export class ConstructorCall_treeDepthsStruct extends ethereum.Tuple { + get intStateTreeDepth(): i32 { + return this[0].toI32(); + } + + get messageTreeSubDepth(): i32 { + return this[1].toI32(); + } + + get messageTreeDepth(): i32 { + return this[2].toI32(); + } + + get voteOptionTreeDepth(): i32 { + return this[3].toI32(); + } +} + +export class ConstructorCall_batchSizesStruct extends ethereum.Tuple { + get messageBatchSize(): i32 { + return this[0].toI32(); + } + + get tallyBatchSize(): i32 { + return this[1].toI32(); + } + + get subsidyBatchSize(): i32 { + return this[2].toI32(); + } +} + +export class ConstructorCall_coordinatorPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class ConstructorCall_extContractsStruct extends ethereum.Tuple { + get vkRegistry(): Address { + return this[0].toAddress(); + } + + get maci(): Address { + return this[1].toAddress(); + } + + get messageAq(): Address { + return this[2].toAddress(); + } + + get topupCredit(): Address { + return this[3].toAddress(); + } +} + +export class InitCall extends ethereum.Call { + get inputs(): InitCall__Inputs { + return new InitCall__Inputs(this); + } + + get outputs(): InitCall__Outputs { + return new InitCall__Outputs(this); + } +} + +export class InitCall__Inputs { + _call: InitCall; + + constructor(call: InitCall) { + this._call = call; + } +} + +export class InitCall__Outputs { + _call: InitCall; + + constructor(call: InitCall) { + this._call = call; + } +} + +export class MergeMaciStateAqCall extends ethereum.Call { + get inputs(): MergeMaciStateAqCall__Inputs { + return new MergeMaciStateAqCall__Inputs(this); + } + + get outputs(): MergeMaciStateAqCall__Outputs { + return new MergeMaciStateAqCall__Outputs(this); + } +} + +export class MergeMaciStateAqCall__Inputs { + _call: MergeMaciStateAqCall; + + constructor(call: MergeMaciStateAqCall) { + this._call = call; + } + + get _pollId(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class MergeMaciStateAqCall__Outputs { + _call: MergeMaciStateAqCall; + + constructor(call: MergeMaciStateAqCall) { + this._call = call; + } +} + +export class MergeMaciStateAqSubRootsCall extends ethereum.Call { + get inputs(): MergeMaciStateAqSubRootsCall__Inputs { + return new MergeMaciStateAqSubRootsCall__Inputs(this); + } + + get outputs(): MergeMaciStateAqSubRootsCall__Outputs { + return new MergeMaciStateAqSubRootsCall__Outputs(this); + } +} + +export class MergeMaciStateAqSubRootsCall__Inputs { + _call: MergeMaciStateAqSubRootsCall; + + constructor(call: MergeMaciStateAqSubRootsCall) { + this._call = call; + } + + get _numSrQueueOps(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get _pollId(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class MergeMaciStateAqSubRootsCall__Outputs { + _call: MergeMaciStateAqSubRootsCall; + + constructor(call: MergeMaciStateAqSubRootsCall) { + this._call = call; + } +} + +export class MergeMessageAqCall extends ethereum.Call { + get inputs(): MergeMessageAqCall__Inputs { + return new MergeMessageAqCall__Inputs(this); + } + + get outputs(): MergeMessageAqCall__Outputs { + return new MergeMessageAqCall__Outputs(this); + } +} + +export class MergeMessageAqCall__Inputs { + _call: MergeMessageAqCall; + + constructor(call: MergeMessageAqCall) { + this._call = call; + } +} + +export class MergeMessageAqCall__Outputs { + _call: MergeMessageAqCall; + + constructor(call: MergeMessageAqCall) { + this._call = call; + } +} + +export class MergeMessageAqSubRootsCall extends ethereum.Call { + get inputs(): MergeMessageAqSubRootsCall__Inputs { + return new MergeMessageAqSubRootsCall__Inputs(this); + } + + get outputs(): MergeMessageAqSubRootsCall__Outputs { + return new MergeMessageAqSubRootsCall__Outputs(this); + } +} + +export class MergeMessageAqSubRootsCall__Inputs { + _call: MergeMessageAqSubRootsCall; + + constructor(call: MergeMessageAqSubRootsCall) { + this._call = call; + } + + get _numSrQueueOps(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class MergeMessageAqSubRootsCall__Outputs { + _call: MergeMessageAqSubRootsCall; + + constructor(call: MergeMessageAqSubRootsCall) { + this._call = call; + } +} + +export class PublishMessageCall extends ethereum.Call { + get inputs(): PublishMessageCall__Inputs { + return new PublishMessageCall__Inputs(this); + } + + get outputs(): PublishMessageCall__Outputs { + return new PublishMessageCall__Outputs(this); + } +} + +export class PublishMessageCall__Inputs { + _call: PublishMessageCall; + + constructor(call: PublishMessageCall) { + this._call = call; + } + + get _message(): PublishMessageCall_messageStruct { + return changetype( + this._call.inputValues[0].value.toTuple() + ); + } + + get _encPubKey(): PublishMessageCall_encPubKeyStruct { + return changetype( + this._call.inputValues[1].value.toTuple() + ); + } +} + +export class PublishMessageCall__Outputs { + _call: PublishMessageCall; + + constructor(call: PublishMessageCall) { + this._call = call; + } +} + +export class PublishMessageCall_messageStruct extends ethereum.Tuple { + get msgType(): BigInt { + return this[0].toBigInt(); + } + + get data(): Array { + return this[1].toBigIntArray(); + } +} + +export class PublishMessageCall_encPubKeyStruct extends ethereum.Tuple { + get x(): BigInt { + return this[0].toBigInt(); + } + + get y(): BigInt { + return this[1].toBigInt(); + } +} + +export class RenounceOwnershipCall extends ethereum.Call { + get inputs(): RenounceOwnershipCall__Inputs { + return new RenounceOwnershipCall__Inputs(this); + } + + get outputs(): RenounceOwnershipCall__Outputs { + return new RenounceOwnershipCall__Outputs(this); + } +} + +export class RenounceOwnershipCall__Inputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall__Outputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class TopupCall extends ethereum.Call { + get inputs(): TopupCall__Inputs { + return new TopupCall__Inputs(this); + } + + get outputs(): TopupCall__Outputs { + return new TopupCall__Outputs(this); + } +} + +export class TopupCall__Inputs { + _call: TopupCall; + + constructor(call: TopupCall) { + this._call = call; + } + + get stateIndex(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get amount(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class TopupCall__Outputs { + _call: TopupCall; + + constructor(call: TopupCall) { + this._call = call; + } +} + +export class TransferOwnershipCall extends ethereum.Call { + get inputs(): TransferOwnershipCall__Inputs { + return new TransferOwnershipCall__Inputs(this); + } + + get outputs(): TransferOwnershipCall__Outputs { + return new TransferOwnershipCall__Outputs(this); + } +} + +export class TransferOwnershipCall__Inputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } + + get newOwner(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class TransferOwnershipCall__Outputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } +} diff --git a/subgraph/schema.graphql b/subgraph/schema.graphql index 4236432fd..ab72afa11 100644 --- a/subgraph/schema.graphql +++ b/subgraph/schema.graphql @@ -1,4 +1,4 @@ -type FundingRoundFactory @entity { +type ClrFund @entity { id: ID! owner: Bytes coordinator: Bytes @@ -26,7 +26,7 @@ type FundingRoundFactory @entity { maxMessages: BigInt maxVoteOptions: BigInt - fundingRounds: [FundingRound!] @derivedFrom(field: "fundingRoundFactory") + fundingRounds: [FundingRound!] @derivedFrom(field: "clrFund") createdAt: String lastUpdatedAt: String @@ -35,7 +35,7 @@ type FundingRoundFactory @entity { type Message @entity { id: ID! data: [BigInt!] - iv: BigInt! + msgType: BigInt! publicKey: PublicKey fundingRound: FundingRound submittedBy: Bytes @@ -56,8 +56,9 @@ type PublicKey @entity { type FundingRound @entity { id: ID! - fundingRoundFactory: FundingRoundFactory + clrFund: ClrFund maci: Bytes + pollAddress: Bytes messages: [Message!] @derivedFrom(field: "fundingRound") recipientRegistry: RecipientRegistry recipientRegistryAddress: Bytes @@ -69,6 +70,12 @@ type FundingRound @entity { signUpDeadline: BigInt votingDeadline: BigInt + stateTreeDepth: Int + messageTreeDepth: Int + voteOptionTreeDepth: Int + + coordinatorPubKeyX: BigInt + coordinatorPubKeyY: BigInt coordinator: Bytes voiceCreditFactor: BigInt @@ -91,7 +98,7 @@ type FundingRound @entity { type RecipientRegistry @entity { id: ID! - fundingRoundFactory: FundingRoundFactory + clrFund: ClrFund baseDeposit: BigInt challengePeriodDuration: BigInt controller: Bytes @@ -127,7 +134,7 @@ type Recipient @entity { type ContributorRegistry @entity { id: ID! - fundingRoundFactory: FundingRoundFactory! + clrFund: ClrFund! context: String owner: Bytes contributors: [Contributor!] @derivedFrom(field: "contributorRegistry") @@ -154,7 +161,6 @@ type Contributor @entity { type Coordinator @entity { id: ID! - # fundingRoundFactory: FundingRoundFactory! contact: String createdAt: String diff --git a/subgraph/src/FundingRoundFactoryMapping.ts b/subgraph/src/ClrFundMapping.ts similarity index 55% rename from subgraph/src/FundingRoundFactoryMapping.ts rename to subgraph/src/ClrFundMapping.ts index 6a081c229..a957a9fad 100644 --- a/subgraph/src/FundingRoundFactoryMapping.ts +++ b/subgraph/src/ClrFundMapping.ts @@ -7,16 +7,18 @@ import { RoundFinalized, RoundStarted, TokenChanged, - FundingRoundFactory as FundingRoundFactoryContract, -} from '../generated/FundingRoundFactory/FundingRoundFactory' + ClrFund as ClrFundContract, +} from '../generated/ClrFund/ClrFund' -import { Token as TokenContract } from '../generated/FundingRoundFactory/Token' +import { Token as TokenContract } from '../generated/ClrFund/Token' +import { Poll as PollContract } from '../generated/ClrFund/Poll' +import { MACI as MACIContract } from '../generated/ClrFund/MACI' -import { MACIFactory as MACIFactoryContract } from '../generated/FundingRoundFactory/MACIFactory' -import { FundingRound as FundingRoundContract } from '../generated/FundingRoundFactory/FundingRound' +import { MACIFactory as MACIFactoryContract } from '../generated/ClrFund/MACIFactory' +import { FundingRound as FundingRoundContract } from '../generated/ClrFund/FundingRound' -import { OptimisticRecipientRegistry as RecipientRegistryContract } from '../generated/FundingRoundFactory/OptimisticRecipientRegistry' -import { BrightIdUserRegistry as BrightIdUserRegistryContract } from '../generated/FundingRoundFactory/BrightIdUserRegistry' +import { OptimisticRecipientRegistry as RecipientRegistryContract } from '../generated/ClrFund/OptimisticRecipientRegistry' +import { BrightIdUserRegistry as BrightIdUserRegistryContract } from '../generated/ClrFund/BrightIdUserRegistry' import { createRecipientRegistry } from './RecipientRegistry' import { @@ -25,7 +27,7 @@ import { MACI as MACITemplate, } from '../generated/templates' import { - FundingRoundFactory, + ClrFund, FundingRound, RecipientRegistry, ContributorRegistry, @@ -33,12 +35,12 @@ import { } from '../generated/schema' function createContributorRegistry( - fundingRoundFactoryAddress: Address, + clrFundAddress: Address, contributorRegistryAddress: Address ): ContributorRegistry { log.info('New contributorRegistry', []) - let owner = fundingRoundFactoryAddress + let owner = clrFundAddress let contributorRegistryId = contributorRegistryAddress.toHexString() let brightIdUserRegistryContract = BrightIdUserRegistryContract.bind( @@ -50,8 +52,7 @@ function createContributorRegistry( ? 'BrightId user registry' : 'simple user registry' contributorRegistry.owner = owner - contributorRegistry.fundingRoundFactory = - fundingRoundFactoryAddress.toHexString() + contributorRegistry.clrFund = clrFundAddress.toHexString() contributorRegistry.save() return contributorRegistry @@ -82,108 +83,86 @@ function createToken(tokenAddress: Address, blockTimestamp: BigInt): Token { return token } -function createOrUpdateFundingRoundFactory( - fundingRoundFactoryAddress: Address, +function createOrUpdateClrFund( + clrFundAddress: Address, timestamp: BigInt -): FundingRoundFactory { - let fundingRoundFactoryId = fundingRoundFactoryAddress.toHexString() +): ClrFund { + let clrFundId = clrFundAddress.toHexString() - let fundingRoundFactoryContract = FundingRoundFactoryContract.bind( - fundingRoundFactoryAddress - ) + let clrFundContract = ClrFundContract.bind(clrFundAddress) - let loadedFactory = FundingRoundFactory.load(fundingRoundFactoryId) - let fundingRoundFactory = loadedFactory - ? loadedFactory - : new FundingRoundFactory(fundingRoundFactoryId) + let loadedClrFund = ClrFund.load(clrFundId) + let clrFund = loadedClrFund ? loadedClrFund : new ClrFund(clrFundId) - let maciFactoryAddressCall = fundingRoundFactoryContract.try_maciFactory() + let maciFactoryAddressCall = clrFundContract.try_maciFactory() if (maciFactoryAddressCall.reverted) { log.info('TRY maciFactoryAddress Failed', []) } else { let maciFactoryAddress = maciFactoryAddressCall.value let maciFactoryContract = MACIFactoryContract.bind(maciFactoryAddress) - let batchUstVerifier = maciFactoryContract.batchUstVerifier() - let qvtVerifier = maciFactoryContract.qvtVerifier() - let votingDuration = maciFactoryContract.votingDuration() - let signUpDuration = maciFactoryContract.signUpDuration() - - let tallyBatchSize = maciFactoryContract.batchSizes().value0 - let messageBatchSize = maciFactoryContract.batchSizes().value1 - let stateTreeDepth = maciFactoryContract.treeDepths().value0 - let messageTreeDepth = maciFactoryContract.treeDepths().value1 - let voteOptionTreeDepth = maciFactoryContract.treeDepths().value2 - let maxUsers = maciFactoryContract.maxValues().value0 - let maxMessages = maciFactoryContract.maxValues().value1 - let maxVoteOptions = maciFactoryContract.maxValues().value2 - - fundingRoundFactory.maciFactory = maciFactoryAddress - fundingRoundFactory.batchUstVerifier = batchUstVerifier - fundingRoundFactory.qvtVerifier = qvtVerifier - fundingRoundFactory.votingDuration = votingDuration - fundingRoundFactory.signUpDuration = signUpDuration - fundingRoundFactory.tallyBatchSize = BigInt.fromI32(tallyBatchSize) - fundingRoundFactory.messageBatchSize = BigInt.fromI32(messageBatchSize) - fundingRoundFactory.messageTreeDepth = BigInt.fromI32(messageTreeDepth) - fundingRoundFactory.stateTreeDepth = BigInt.fromI32(stateTreeDepth) - fundingRoundFactory.voteOptionTreeDepth = - BigInt.fromI32(voteOptionTreeDepth) - fundingRoundFactory.maxUsers = maxUsers - fundingRoundFactory.maxMessages = maxMessages - fundingRoundFactory.maxVoteOptions = maxVoteOptions + + let stateTreeDepth = maciFactoryContract.stateTreeDepth() + let messageTreeDepth = maciFactoryContract.treeDepths().value2 + let voteOptionTreeDepth = maciFactoryContract.treeDepths().value3 + let maxMessages = maciFactoryContract.maxValues().value0 + let maxVoteOptions = maciFactoryContract.maxValues().value1 + + clrFund.maciFactory = maciFactoryAddress + clrFund.messageTreeDepth = BigInt.fromI32(messageTreeDepth) + clrFund.stateTreeDepth = BigInt.fromI32(stateTreeDepth) + clrFund.voteOptionTreeDepth = BigInt.fromI32(voteOptionTreeDepth) + clrFund.maxMessages = maxMessages + clrFund.maxVoteOptions = maxVoteOptions log.info('New maciFactoryAddress', []) } - let nativeToken = fundingRoundFactoryContract.nativeToken() + let nativeToken = clrFundContract.nativeToken() let nativeTokenId = nativeToken.toHexString() let nativeTokenEntity = Token.load(nativeTokenId) if (!nativeTokenEntity) { createToken(nativeToken, timestamp) } - let coordinator = fundingRoundFactoryContract.coordinator() - let owner = fundingRoundFactoryContract.owner() + let coordinator = clrFundContract.coordinator() + let owner = clrFundContract.owner() //Check if these registries already exist/are being tracked - let recipientRegistryAddress = fundingRoundFactoryContract.recipientRegistry() + let recipientRegistryAddress = clrFundContract.recipientRegistry() let recipientRegistryId = recipientRegistryAddress.toHexString() let recipientRegistry = RecipientRegistry.load(recipientRegistryId) if (!recipientRegistry) { - createRecipientRegistry(fundingRoundFactoryId, recipientRegistryAddress) + createRecipientRegistry(clrFundId, recipientRegistryAddress) } - let contributorRegistryAddress = fundingRoundFactoryContract.userRegistry() + let contributorRegistryAddress = clrFundContract.userRegistry() let contributorRegistryId = contributorRegistryAddress.toHexString() let contributorRegistry = ContributorRegistry.load(contributorRegistryId) if (!contributorRegistry) { - createContributorRegistry( - fundingRoundFactoryAddress, - contributorRegistryAddress - ) + createContributorRegistry(clrFundAddress, contributorRegistryAddress) } - fundingRoundFactory.contributorRegistry = contributorRegistryId - fundingRoundFactory.recipientRegistry = recipientRegistryId - fundingRoundFactory.contributorRegistryAddress = contributorRegistryAddress - fundingRoundFactory.recipientRegistryAddress = recipientRegistryAddress - fundingRoundFactory.nativeToken = nativeToken - fundingRoundFactory.nativeTokenInfo = nativeTokenId - fundingRoundFactory.coordinator = coordinator - fundingRoundFactory.owner = owner - - fundingRoundFactory.save() - return fundingRoundFactory + clrFund.contributorRegistry = contributorRegistryId + clrFund.recipientRegistry = recipientRegistryId + clrFund.contributorRegistryAddress = contributorRegistryAddress + clrFund.recipientRegistryAddress = recipientRegistryAddress + clrFund.nativeToken = nativeToken + clrFund.nativeTokenInfo = nativeTokenId + clrFund.coordinator = coordinator + clrFund.owner = owner + + clrFund.save() + return clrFund } export function handleCoordinatorChanged(event: CoordinatorChanged): void { log.info('handleCoordinatorChanged', []) - createOrUpdateFundingRoundFactory(event.address, event.block.timestamp) + createOrUpdateClrFund(event.address, event.block.timestamp) } export function handleFundingSourceAdded(event: FundingSourceAdded): void { log.info('handleFundingSourceAdded', []) - createOrUpdateFundingRoundFactory(event.address, event.block.timestamp) + createOrUpdateClrFund(event.address, event.block.timestamp) } export function handleFundingSourceRemoved(event: FundingSourceRemoved): void { @@ -192,7 +171,7 @@ export function handleFundingSourceRemoved(event: FundingSourceRemoved): void { export function handleOwnershipTransferred(event: OwnershipTransferred): void { log.info('handleOwnershipTransferred', [event.params.newOwner.toHexString()]) - createOrUpdateFundingRoundFactory(event.address, event.block.timestamp) + createOrUpdateClrFund(event.address, event.block.timestamp) } export function handleRoundFinalized(event: RoundFinalized): void { @@ -224,22 +203,14 @@ export function handleRoundFinalized(event: RoundFinalized): void { export function handleRoundStarted(event: RoundStarted): void { log.info('handleRoundStarted!!!', []) - let fundingRoundFactoryId = event.address.toHexString() + let clrFundId = event.address.toHexString() let fundingRoundId = event.params._round.toHexString() - let fundingRoundFactory = createOrUpdateFundingRoundFactory( - event.address, - event.block.timestamp - ) + let clrFund = createOrUpdateClrFund(event.address, event.block.timestamp) FundingRoundTemplate.create(event.params._round) - let fundingRoundFactoryContract = FundingRoundFactoryContract.bind( - event.address - ) let fundingRoundAddress = event.params._round - let fundingRoundContract = FundingRoundContract.bind(fundingRoundAddress) - let fundingRound = new FundingRound(fundingRoundId) log.info('Get all the things', []) @@ -257,7 +228,7 @@ export function handleRoundStarted(event: RoundStarted): void { MACITemplate.create(maci) - fundingRound.fundingRoundFactory = fundingRoundFactoryId + fundingRound.clrFund = clrFundId fundingRound.nativeToken = nativeToken fundingRound.nativeTokenInfo = nativeTokenId fundingRound.coordinator = coordinator @@ -265,43 +236,64 @@ export function handleRoundStarted(event: RoundStarted): void { fundingRound.voiceCreditFactor = voiceCreditFactor fundingRound.contributorCount = contributorCount fundingRound.matchingPoolSize = matchingPoolSize + fundingRound.startTime = event.block.timestamp - let recipientRegistryId = fundingRoundFactory.recipientRegistry - let recipientRegistryAddress = fundingRoundFactory.recipientRegistryAddress - - let contributorRegistryId = fundingRoundFactory.contributorRegistry - let contributorRegistryAddress = - fundingRoundFactory.contributorRegistryAddress + let recipientRegistryId = clrFund.recipientRegistry + let recipientRegistryAddress = clrFund.recipientRegistryAddress - log.info('TRY maciFactoryAddress', []) - let maciFactoryAddressCall = fundingRoundFactoryContract.try_maciFactory() + let contributorRegistryId = clrFund.contributorRegistry + let contributorRegistryAddress = clrFund.contributorRegistryAddress - if (maciFactoryAddressCall.reverted) { - log.info('TRY maciFactoryAddress Failed', []) - } else { - let maciFactoryAddress = maciFactoryAddressCall.value - let maciFactoryContract = MACIFactoryContract.bind(maciFactoryAddress) - let votingDuration = maciFactoryContract.votingDuration() - let signUpDuration = maciFactoryContract.signUpDuration() + let maciContract = MACIContract.bind(maci) + let stateTreeDepth = maciContract.try_stateTreeDepth() + if (!stateTreeDepth.reverted) { + fundingRound.stateTreeDepth = stateTreeDepth.value + } - fundingRound.signUpDeadline = event.block.timestamp.plus(signUpDuration) - fundingRound.votingDeadline = event.block.timestamp - .plus(signUpDuration) - .plus(votingDuration) + log.info('TRY pollAddress', []) + let pollAddressCall = fundingRoundContract.try_poll() - log.info('New maciFactoryAddress', []) + if (pollAddressCall.reverted) { + log.info('TRY pollAddress Failed', []) + } else { + let pollAddress = pollAddressCall.value + fundingRound.pollAddress = pollAddress + + let pollContract = PollContract.bind(pollAddress) + let deployTimeAndDuration = pollContract.try_getDeployTimeAndDuration() + if (!deployTimeAndDuration.reverted) { + let deployTime = deployTimeAndDuration.value.value0 + let duration = deployTimeAndDuration.value.value1 + // MACI's signup deadline is the same as the voting deadline + fundingRound.signUpDeadline = deployTime.plus(duration) + fundingRound.votingDeadline = fundingRound.signUpDeadline + fundingRound.startTime = deployTime + + log.info('New pollAddress', []) + } + + let treeDepths = pollContract.try_treeDepths() + if (!treeDepths.reverted) { + fundingRound.messageTreeDepth = treeDepths.value.value2 + fundingRound.voteOptionTreeDepth = treeDepths.value.value3 + } + + let coordinatorPubKey = pollContract.try_coordinatorPubKey() + if (!coordinatorPubKey.reverted) { + fundingRound.coordinatorPubKeyX = coordinatorPubKey.value.value0 + fundingRound.coordinatorPubKeyY = coordinatorPubKey.value.value1 + } } - fundingRoundFactory.currentRound = fundingRoundId + clrFund.currentRound = fundingRoundId - fundingRoundFactory.save() + clrFund.save() //NOTE: Set the registries for the round fundingRound.contributorRegistry = contributorRegistryId fundingRound.recipientRegistry = recipientRegistryId fundingRound.contributorRegistryAddress = contributorRegistryAddress fundingRound.recipientRegistryAddress = recipientRegistryAddress - fundingRound.startTime = event.block.timestamp fundingRound.recipientCount = BigInt.fromString('0') fundingRound.save() @@ -309,5 +301,5 @@ export function handleRoundStarted(event: RoundStarted): void { export function handleTokenChanged(event: TokenChanged): void { log.info('handleTokenChanged {}', [event.params._token.toHexString()]) - createOrUpdateFundingRoundFactory(event.address, event.block.timestamp) + createOrUpdateClrFund(event.address, event.block.timestamp) } diff --git a/subgraph/src/MACIMapping.ts b/subgraph/src/MACIMapping.ts index fb9876957..cbc2c17d7 100644 --- a/subgraph/src/MACIMapping.ts +++ b/subgraph/src/MACIMapping.ts @@ -1,7 +1,8 @@ import { log, ByteArray, crypto, BigInt } from '@graphprotocol/graph-ts' -import { PublishMessage, SignUp } from '../generated/templates/MACI/MACI' +import { SignUp } from '../generated/templates/MACI/MACI' -import { FundingRound, Message, PublicKey } from '../generated/schema' +import { FundingRound, PublicKey } from '../generated/schema' +import { makePublicKeyId } from './PublicKey' // It is also possible to access smart contracts from mappings. For // example, the contract that has emitted the event can be connected to @@ -19,71 +20,8 @@ import { FundingRound, Message, PublicKey } from '../generated/schema' // - contract.verifications(...) // - contract.verifier(...) -function makePubKeyId(x: BigInt, y: BigInt): string { - let pubKeyX = x.toString() - let pubKeyY = y.toString() - let pubKeyXY = ByteArray.fromUTF8(pubKeyX + '.' + pubKeyY) - let publicKeyId = crypto.keccak256(pubKeyXY).toHexString() - return publicKeyId -} - -export function handlePublishMessage(event: PublishMessage): void { - if (!event.transaction.to) { - log.error( - 'Error: handlePublishMessage failed fundingRound not registered', - [] - ) - return - } - - let fundingRoundId = event.transaction.to!.toHex() - let fundingRound = FundingRound.load(fundingRoundId) - if (fundingRound == null) { - log.error( - 'Error: handlePublishMessage failed fundingRound not registered', - [] - ) - return - } - - let messageID = - event.transaction.hash.toHexString() + - '-' + - event.transactionLogIndex.toString() - - let timestamp = event.block.timestamp.toString() - let message = new Message(messageID) - message.data = event.params._message.data - message.iv = event.params._message.iv - message.blockNumber = event.block.number - message.transactionIndex = event.transaction.index - message.submittedBy = event.transaction.from - - let publicKeyId = makePubKeyId( - event.params._encPubKey.x, - event.params._encPubKey.y - ) - let publicKey = PublicKey.load(publicKeyId) - - //NOTE: If the public keys aren't being tracked initialize them - if (publicKey == null) { - let publicKey = new PublicKey(publicKeyId) - publicKey.x = event.params._encPubKey.x - publicKey.y = event.params._encPubKey.y - publicKey.fundingRound = fundingRoundId - - publicKey.save() - } - - message.publicKey = publicKeyId - message.timestamp = timestamp - message.fundingRound = fundingRoundId - message.save() - log.info('handlePublishMessage', []) -} - export function handleSignUp(event: SignUp): void { - let publicKeyId = makePubKeyId( + let publicKeyId = makePublicKeyId( event.params._userPubKey.x, event.params._userPubKey.y ) diff --git a/subgraph/src/PollMapping.ts b/subgraph/src/PollMapping.ts new file mode 100644 index 000000000..59360c3c3 --- /dev/null +++ b/subgraph/src/PollMapping.ts @@ -0,0 +1,60 @@ +import { log, ByteArray, crypto, BigInt } from '@graphprotocol/graph-ts' +import { PublishMessage } from '../generated/templates/Poll/Poll' + +import { FundingRound, Message, PublicKey } from '../generated/schema' +import { makePublicKeyId } from './PublicKey' + +export function handlePublishMessage(event: PublishMessage): void { + if (!event.transaction.to) { + log.error( + 'Error: handlePublishMessage failed fundingRound not registered', + [] + ) + return + } + + let fundingRoundId = event.transaction.to!.toHex() + let fundingRound = FundingRound.load(fundingRoundId) + if (fundingRound == null) { + log.error( + 'Error: handlePublishMessage failed fundingRound not registered', + [] + ) + return + } + + let messageID = + event.transaction.hash.toHexString() + + '-' + + event.transactionLogIndex.toString() + + let timestamp = event.block.timestamp.toString() + let message = new Message(messageID) + message.data = event.params._message.data + message.msgType = event.params._message.msgType + message.blockNumber = event.block.number + message.transactionIndex = event.transaction.index + message.submittedBy = event.transaction.from + + let publicKeyId = makePublicKeyId( + event.params._encPubKey.x, + event.params._encPubKey.y + ) + let publicKey = PublicKey.load(publicKeyId) + + //NOTE: If the public keys aren't being tracked initialize them + if (publicKey == null) { + let publicKey = new PublicKey(publicKeyId) + publicKey.x = event.params._encPubKey.x + publicKey.y = event.params._encPubKey.y + publicKey.fundingRound = fundingRoundId + + publicKey.save() + } + + message.publicKey = publicKeyId + message.timestamp = timestamp + message.fundingRound = fundingRoundId + message.save() + log.info('handlePublishMessage', []) +} diff --git a/subgraph/src/PublicKey.ts b/subgraph/src/PublicKey.ts new file mode 100644 index 000000000..9859dfe8e --- /dev/null +++ b/subgraph/src/PublicKey.ts @@ -0,0 +1,12 @@ +import { ByteArray, crypto, BigInt } from '@graphprotocol/graph-ts' +import { FundingRound, PublicKey } from '../generated/schema' + +// Create the PublicKey entity id used in subgraph +// using MACI public key x and y values +export function makePublicKeyId(x: BigInt, y: BigInt): string { + let publicKeyX = x.toString() + let publicKeyY = y.toString() + let publicKeyXY = ByteArray.fromUTF8(publicKeyX + '.' + publicKeyY) + let publicKeyId = crypto.keccak256(publicKeyXY).toHexString() + return publicKeyId +} diff --git a/subgraph/src/RecipientRegistry.ts b/subgraph/src/RecipientRegistry.ts index f809b70f6..a9af36950 100644 --- a/subgraph/src/RecipientRegistry.ts +++ b/subgraph/src/RecipientRegistry.ts @@ -1,14 +1,14 @@ import { Address, BigInt } from '@graphprotocol/graph-ts' import { OptimisticRecipientRegistry as RecipientRegistryContract } from '../generated/OptimisticRecipientRegistry/OptimisticRecipientRegistry' -import { RecipientRegistry, FundingRoundFactory } from '../generated/schema' +import { RecipientRegistry, ClrFund } from '../generated/schema' import { OptimisticRecipientRegistry as RecipientRegistryTemplate } from '../generated/templates' /* * Create the recipient registry entity */ export function createRecipientRegistry( - fundingRoundFactoryId: string, + clrFundId: string, recipientRegistryAddress: Address ): RecipientRegistry { let recipientRegistryId = recipientRegistryAddress.toHexString() @@ -41,7 +41,7 @@ export function createRecipientRegistry( if (!owner.reverted) { recipientRegistry.owner = owner.value } - recipientRegistry.fundingRoundFactory = fundingRoundFactoryId + recipientRegistry.clrFund = clrFundId recipientRegistry.save() return recipientRegistry @@ -59,17 +59,17 @@ export function loadRecipientRegistry( let recipientRegistryContract = RecipientRegistryContract.bind(address) let controller = recipientRegistryContract.try_controller() if (!controller.reverted) { - // Recipient registry's controller must be the factory - let factoryId = controller.value.toHexString() - let factory = FundingRoundFactory.load(factoryId) - if (factory) { + // Recipient registry's controller must be the ClrFund contract + let clrFundId = controller.value.toHexString() + let clrFund = ClrFund.load(clrFundId) + if (clrFund) { /* This is our registry, create it */ - recipientRegistry = createRecipientRegistry(factory.id, address) + recipientRegistry = createRecipientRegistry(clrFund.id, address) // update factory - factory.recipientRegistry = recipientRegistryId - factory.recipientRegistryAddress = address - factory.save() + clrFund.recipientRegistry = recipientRegistryId + clrFund.recipientRegistryAddress = address + clrFund.save() } } } diff --git a/subgraph/subgraph.template.yaml b/subgraph/subgraph.template.yaml index 219c4aa13..adf7a2396 100644 --- a/subgraph/subgraph.template.yaml +++ b/subgraph/subgraph.template.yaml @@ -5,25 +5,26 @@ schema: file: ./schema.graphql dataSources: - kind: ethereum/contract - name: FundingRoundFactory + name: ClrFund network: {{network}} source: address: '{{address}}' - abi: FundingRoundFactory - startBlock: {{factoryStartBlock}} + abi: ClrFund + startBlock: {{clrFundStartBlock}} mapping: kind: ethereum/events apiVersion: 0.0.7 language: wasm/assemblyscript entities: - - FundingRoundFactory + - ClrFund - RecipientRegistry - ContributorRegistry - FundingRound - Token + - Poll abis: - - name: FundingRoundFactory - file: ./abis/FundingRoundFactory.json + - name: ClrFund + file: ./abis/ClrFund.json - name: FundingRound file: ./abis/FundingRound.json - name: MACIFactory @@ -34,6 +35,10 @@ dataSources: file: ./abis/BrightIdUserRegistry.json - name: Token file: ./abis/Token.json + - name: Poll + file: ./abis/Poll.json + - name: MACI + file: ./abis/MACI.json eventHandlers: - event: CoordinatorChanged(address) handler: handleCoordinatorChanged @@ -49,7 +54,7 @@ dataSources: handler: handleRoundStarted - event: TokenChanged(address) handler: handleTokenChanged - file: ./src/FundingRoundFactoryMapping.ts + file: ./src/ClrFundMapping.ts - kind: ethereum/contract name: OptimisticRecipientRegistry network: {{network}} @@ -173,8 +178,27 @@ templates: - name: FundingRound file: ./abis/FundingRound.json eventHandlers: - - event: PublishMessage((uint256,uint256[10]),(uint256,uint256)) - handler: handlePublishMessage - - event: SignUp((uint256,uint256),uint256,uint256) + - event: SignUp(uint256,(uint256,uint256),uint256,uint256) handler: handleSignUp file: ./src/MACIMapping.ts + - name: Poll + kind: ethereum/contract + network: {{network}} + source: + abi: Poll + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Poll + - FundingRound + abis: + - name: Poll + file: ./abis/Poll.json + - name: FundingRound + file: ./abis/FundingRound.json + eventHandlers: + - event: PublishMessage((uint256,uint256[10]),(uint256,uint256)) + handler: handlePublishMessage + file: ./src/PollMapping.ts diff --git a/subgraph/subgraph.yaml b/subgraph/subgraph.yaml index e5019a71d..524a44ea0 100644 --- a/subgraph/subgraph.yaml +++ b/subgraph/subgraph.yaml @@ -5,25 +5,26 @@ schema: file: ./schema.graphql dataSources: - kind: ethereum/contract - name: FundingRoundFactory + name: ClrFund network: xdai source: address: '0x4ede8f30d9c2dc96a9d6787e9c4a478424fb960a' - abi: FundingRoundFactory + abi: ClrFund startBlock: 15217676 mapping: kind: ethereum/events apiVersion: 0.0.7 language: wasm/assemblyscript entities: - - FundingRoundFactory + - ClrFund - RecipientRegistry - ContributorRegistry - FundingRound - Token + - Poll abis: - - name: FundingRoundFactory - file: ./abis/FundingRoundFactory.json + - name: ClrFund + file: ./abis/ClrFund.json - name: FundingRound file: ./abis/FundingRound.json - name: MACIFactory @@ -34,6 +35,10 @@ dataSources: file: ./abis/BrightIdUserRegistry.json - name: Token file: ./abis/Token.json + - name: Poll + file: ./abis/Poll.json + - name: MACI + file: ./abis/MACI.json eventHandlers: - event: CoordinatorChanged(address) handler: handleCoordinatorChanged @@ -49,7 +54,7 @@ dataSources: handler: handleRoundStarted - event: TokenChanged(address) handler: handleTokenChanged - file: ./src/FundingRoundFactoryMapping.ts + file: ./src/ClrFundMapping.ts - kind: ethereum/contract name: OptimisticRecipientRegistry network: xdai @@ -173,8 +178,27 @@ templates: - name: FundingRound file: ./abis/FundingRound.json eventHandlers: - - event: PublishMessage((uint256,uint256[10]),(uint256,uint256)) - handler: handlePublishMessage - - event: SignUp((uint256,uint256),uint256,uint256) + - event: SignUp(uint256,(uint256,uint256),uint256,uint256) handler: handleSignUp file: ./src/MACIMapping.ts + - name: Poll + kind: ethereum/contract + network: xdai + source: + abi: Poll + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Poll + - FundingRound + abis: + - name: Poll + file: ./abis/Poll.json + - name: FundingRound + file: ./abis/FundingRound.json + eventHandlers: + - event: PublishMessage((uint256,uint256[10]),(uint256,uint256)) + handler: handlePublishMessage + file: ./src/PollMapping.ts diff --git a/vue-app/.env.example b/vue-app/.env.example index 238134534..e74e2fcbc 100644 --- a/vue-app/.env.example +++ b/vue-app/.env.example @@ -19,7 +19,7 @@ VITE_IPFS_SECRET_API_KEY= VITE_SUBGRAPH_URL=http://localhost:8000/subgraphs/name/clrfund/clrfund -VITE_CLRFUND_FACTORY_ADDRESS=0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 +VITE_CLRFUND_ADDRESS=0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 # Supported values: simple, brightid, snapshot, merkle VITE_USER_REGISTRY_TYPE=simple diff --git a/vue-app/src/App.vue b/vue-app/src/App.vue index 93fcc83b1..665c833b0 100644 --- a/vue-app/src/App.vue +++ b/vue-app/src/App.vue @@ -166,7 +166,7 @@ onMounted(async () => { } appReady.value = true - await appStore.loadFactoryInfo() + await appStore.loadClrFundInfo() await appStore.loadMACIFactoryInfo() await appStore.loadRoundInfo() await recipientStore.loadRecipientRegistryInfo() @@ -190,7 +190,7 @@ watch(walletUser, async () => { web3Provider: walletUser.value.web3Provider, } // make sure factory is loaded - await appStore.loadFactoryInfo() + await appStore.loadClrFundInfo() userStore.loginUser(user) await userStore.loadUserInfo() await userStore.loadBrightID() diff --git a/vue-app/src/api/abi.ts b/vue-app/src/api/abi.ts index a31e2c0ab..9add92259 100644 --- a/vue-app/src/api/abi.ts +++ b/vue-app/src/api/abi.ts @@ -1,8 +1,9 @@ import { abi as ERC20 } from '../../../contracts/build/contracts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.json' -import { abi as FundingRoundFactory } from '../../../contracts/build/contracts/contracts/ClrFund.sol/ClrFund.json' +import { abi as ClrFund } from '../../../contracts/build/contracts/contracts/ClrFund.sol/ClrFund.json' import { abi as FundingRound } from '../../../contracts/build/contracts/contracts/FundingRound.sol/FundingRound.json' import { abi as MACIFactory } from '../../../contracts/build/contracts/contracts/MACIFactory.sol/MACIFactory.json' import { abi as MACI } from '../../../contracts/build/contracts/@clrfund/maci-contracts/contracts/MACI.sol/MACI.json' +import { abi as Poll } from '../../../contracts/build/contracts/@clrfund/maci-contracts/contracts/Poll.sol/Poll.json' import { abi as UserRegistry } from '../../../contracts/build/contracts/contracts/userRegistry/IUserRegistry.sol/IUserRegistry.json' import { abi as BrightIdUserRegistry } from '../../../contracts/build/contracts/contracts/userRegistry/BrightIdUserRegistry.sol/BrightIdUserRegistry.json' import { abi as SnapshotUserRegistry } from '../../../contracts/build/contracts/contracts/userRegistry/SnapshotUserRegistry.sol/SnapshotUserRegistry.json' @@ -14,10 +15,11 @@ import { abi as KlerosGTCRAdapter } from '../../../contracts/build/contracts/con export { ERC20, - FundingRoundFactory, + ClrFund, FundingRound, MACIFactory, MACI, + Poll, UserRegistry, SnapshotUserRegistry, MerkleUserRegistry, diff --git a/vue-app/src/api/factory.ts b/vue-app/src/api/clrFund.ts similarity index 65% rename from vue-app/src/api/factory.ts rename to vue-app/src/api/clrFund.ts index 32ea5795d..f9e28b3aa 100644 --- a/vue-app/src/api/factory.ts +++ b/vue-app/src/api/clrFund.ts @@ -1,17 +1,17 @@ import { BigNumber } from 'ethers' -import { factory } from './core' +import { clrFundContract } from './core' import sdk from '@/graphql/sdk' -export interface Factory { - fundingRoundAddress: string +export interface ClrFund { nativeTokenAddress: string nativeTokenSymbol: string nativeTokenDecimals: number userRegistryAddress: string + recipientRegistryAddress: string matchingPool: BigNumber } -export async function getFactoryInfo() { +export async function getClrFundInfo() { let nativeTokenAddress = '' let nativeTokenSymbol = '' let nativeTokenDecimals = 0 @@ -20,22 +20,22 @@ export async function getFactoryInfo() { let recipientRegistryAddress = '' try { - const data = await sdk.GetFactoryInfo({ - factoryAddress: factory.address.toLowerCase(), + const data = await sdk.GetClrFundInfo({ + clrFundAddress: clrFundContract.address.toLowerCase(), }) - const nativeTokenInfo = data.fundingRoundFactory?.nativeTokenInfo + const nativeTokenInfo = data.clrFund?.nativeTokenInfo if (nativeTokenInfo) { nativeTokenAddress = nativeTokenInfo.tokenAddress || '' nativeTokenSymbol = nativeTokenInfo.symbol || '' nativeTokenDecimals = Number(nativeTokenInfo.decimals) || 0 } - userRegistryAddress = data.fundingRoundFactory?.contributorRegistryAddress || '' - recipientRegistryAddress = data.fundingRoundFactory?.recipientRegistryAddress || '' + userRegistryAddress = data.clrFund?.contributorRegistryAddress || '' + recipientRegistryAddress = data.clrFund?.recipientRegistryAddress || '' } catch (err) { /* eslint-disable-next-line no-console */ - console.error('Failed GetFactoryInfo', err) + console.error('Failed GetClrFundInfo', err) } try { @@ -46,7 +46,6 @@ export async function getFactoryInfo() { } return { - fundingRoundAddress: factory.address, nativeTokenAddress, nativeTokenSymbol, nativeTokenDecimals, @@ -57,6 +56,6 @@ export async function getFactoryInfo() { } export async function getMatchingFunds(nativeTokenAddress: string): Promise { - const matchingFunds = await factory.getMatchingFunds(nativeTokenAddress) + const matchingFunds = await clrFundContract.getMatchingFunds(nativeTokenAddress) return matchingFunds } diff --git a/vue-app/src/api/contributions.ts b/vue-app/src/api/contributions.ts index f709564b7..74bbafba9 100644 --- a/vue-app/src/api/contributions.ts +++ b/vue-app/src/api/contributions.ts @@ -6,7 +6,7 @@ import { Keypair, PubKey, PrivKey, Message, Command, getPubKeyId } from '@clrfun import type { RoundInfo } from './round' import { FundingRound, ERC20 } from './abi' -import { factory, provider } from './core' +import { clrFundContract, provider } from './core' import type { Project } from './projects' import sdk from '@/graphql/sdk' import { Transaction } from '@/utils/transaction' @@ -88,7 +88,7 @@ export async function getContributionAmount( } export async function getTotalContributed(fundingRoundAddress: string): Promise<{ count: number; amount: BigNumber }> { - const nativeTokenAddress = await factory.nativeToken() + const nativeTokenAddress = await clrFundContract.nativeToken() const nativeToken = new Contract(nativeTokenAddress, ERC20, provider) const balance = await nativeToken.balanceOf(fundingRoundAddress) diff --git a/vue-app/src/api/core.ts b/vue-app/src/api/core.ts index 3a4467de9..9f5049ca2 100644 --- a/vue-app/src/api/core.ts +++ b/vue-app/src/api/core.ts @@ -1,6 +1,6 @@ import { ethers } from 'ethers' -import { FundingRoundFactory } from './abi' +import { ClrFund } from './abi' import { CHAIN_INFO } from '@/utils/chains' import historicalRounds from '@/rounds/rounds.json' @@ -35,13 +35,9 @@ if (!ipfsPinningJwt && !(ipfsApiKey && ipfsSecretApiKey)) { ) } -//TODO: need to be able to pass the factory contract address dynamically, note all places this is used make factory address a parameter that defaults to the env. variable set +//TODO: need to be able to pass the clrfund contract address dynamically, note all places this is used make clrfund address a parameter that defaults to the env. variable set //NOTE: these calls will be replaced by subgraph queries eventually. -export const factory = new ethers.Contract( - import.meta.env.VITE_CLRFUND_FACTORY_ADDRESS as string, - FundingRoundFactory, - provider, -) +export const clrFundContract = new ethers.Contract(import.meta.env.VITE_CLRFUND_ADDRESS as string, ClrFund, provider) export const userRegistryType = import.meta.env.VITE_USER_REGISTRY_TYPE export enum UserRegistryType { BRIGHT_ID = 'brightid', diff --git a/vue-app/src/api/maci-factory.ts b/vue-app/src/api/maci-factory.ts index 3cc909dbd..9dfd1bd1f 100644 --- a/vue-app/src/api/maci-factory.ts +++ b/vue-app/src/api/maci-factory.ts @@ -1,6 +1,6 @@ import { Contract } from 'ethers' import { MACIFactory as MACIFactoryABI } from './abi' -import { factory, provider } from './core' +import { clrFundContract, provider } from './core' export interface MACIFactory { maciFactoryAddress: string @@ -8,7 +8,7 @@ export interface MACIFactory { } export async function getMACIFactoryInfo(): Promise { - const maciFactoryAddress = await factory.maciFactory() + const maciFactoryAddress = await clrFundContract.maciFactory() const maciFactory = new Contract(maciFactoryAddress, MACIFactoryABI, provider) const treeDepths = await maciFactory.treeDepths() diff --git a/vue-app/src/api/projects.ts b/vue-app/src/api/projects.ts index c1a065bd8..1733dcce6 100644 --- a/vue-app/src/api/projects.ts +++ b/vue-app/src/api/projects.ts @@ -1,7 +1,7 @@ import { BigNumber, Contract, Signer } from 'ethers' import type { TransactionResponse } from '@ethersproject/abstract-provider' import { FundingRound, OptimisticRecipientRegistry } from './abi' -import { factory, provider, recipientRegistryType, ipfsGatewayUrl } from './core' +import { clrFundContract, provider, recipientRegistryType, ipfsGatewayUrl } from './core' import SimpleRegistry from './recipient-registry-simple' import OptimisticRegistry from './recipient-registry-optimistic' @@ -49,15 +49,14 @@ export interface Project { extra?: any // Registry-specific data } -//TODO: update anywhere this is called to take factory address as a parameter +//TODO: update anywhere this is called to take ClrFund address as a parameter //NOTE: why isn't this included in the vuex state schema? export async function getRecipientRegistryAddress(roundAddress: string | null): Promise { if (roundAddress !== null) { const fundingRound = new Contract(roundAddress, FundingRound, provider) return await fundingRound.recipientRegistry() } else { - //TODO: upgrade factory to take it's address as a parameter - return await factory.recipientRegistry() + return await clrFundContract.recipientRegistry() } } diff --git a/vue-app/src/api/round.ts b/vue-app/src/api/round.ts index a42d8cf8a..c5d9ca88b 100644 --- a/vue-app/src/api/round.ts +++ b/vue-app/src/api/round.ts @@ -2,8 +2,8 @@ import { BigNumber, Contract, utils } from 'ethers' import { DateTime } from 'luxon' import { PubKey } from '@clrfund/common' -import { FundingRound, MACI } from './abi' -import { provider, factory } from './core' +import { FundingRound, Poll } from './abi' +import { provider, clrFundContract } from './core' import { getTotalContributed } from './contributions' import { isVoidedRound } from './rounds' import sdk from '@/graphql/sdk' @@ -53,9 +53,9 @@ export enum RoundStatus { Finalized = 'Finalized', Cancelled = 'Cancelled', } -//TODO: update to take factory address as a parameter, default to env. variable +//TODO: update to take ClrFund address as a parameter, default to env. variable export async function getCurrentRound(): Promise { - const fundingRoundAddress = await factory.getCurrentRound() + const fundingRoundAddress = await clrFundContract.getCurrentRound() if (fundingRoundAddress === '0x0000000000000000000000000000000000000000') { return null } @@ -127,7 +127,7 @@ export async function getLeaderboardRoundInfo(fundingRoundAddress: string, netwo return round } -//TODO: update to take factory address as a parameter, default to env. variable +//TODO: update to take ClrFund address as a parameter, default to env. variable export async function getRoundInfo( fundingRoundAddress: string, cachedRound?: RoundInfo | null, @@ -148,44 +148,34 @@ export async function getRoundInfo( } const { + pollAddress, maci: maciAddress, recipientRegistryAddress, contributorRegistryAddress: userRegistryAddress, isFinalized, isCancelled, + stateTreeDepth, + messageTreeDepth, + voteOptionTreeDepth, + startTime, + signUpDeadline, + votingDeadline, + coordinatorPubKeyX, + coordinatorPubKeyY, } = data.fundingRound const voiceCreditFactor = BigNumber.from(data.fundingRound.voiceCreditFactor) - const maci = new Contract(maciAddress, MACI, provider) - const [ - maciTreeDepths, - signUpTimestamp, - signUpDurationSeconds, - votingDurationSeconds, - coordinatorPubKeyRaw, - messages, - ] = await Promise.all([ - maci.treeDepths(), - maci.signUpTimestamp(), - maci.signUpDurationSeconds(), - maci.votingDurationSeconds(), - maci.coordinatorPubKey(), - maci.numMessages(), - ]) - const startTime = DateTime.fromSeconds(signUpTimestamp.toNumber()) - const signUpDeadline = DateTime.fromSeconds(signUpTimestamp.add(signUpDurationSeconds).toNumber()) - const votingDeadline = DateTime.fromSeconds( - signUpTimestamp.add(signUpDurationSeconds).add(votingDurationSeconds).toNumber(), - ) - const coordinatorPubKey = new PubKey([BigInt(coordinatorPubKeyRaw.x), BigInt(coordinatorPubKeyRaw.y)]) + const poll = new Contract(pollAddress, Poll, provider) + const [, messages] = await poll.numSignUpsAndMessages() + const coordinatorPubKey = new PubKey([BigInt(coordinatorPubKeyX), BigInt(coordinatorPubKeyY)]) const nativeTokenAddress = data.fundingRound.nativeTokenInfo?.tokenAddress || '' const nativeTokenSymbol = data.fundingRound.nativeTokenInfo?.symbol || '' const nativeTokenDecimals = Number(data.fundingRound.nativeTokenInfo?.decimals || '') - const maxContributors = 2 ** maciTreeDepths.stateTreeDepth - 1 - const maxMessages = 2 ** maciTreeDepths.messageTreeDepth - 1 + const maxContributors = stateTreeDepth ? 2 ** stateTreeDepth - 1 : 0 + const maxMessages = messageTreeDepth ? 2 ** messageTreeDepth - 1 : 0 const now = DateTime.local() const contributionsInfo = await getTotalContributed(fundingRoundAddress) const contributors = contributionsInfo.count @@ -203,7 +193,7 @@ export async function getRoundInfo( } else if (messages >= maxMessages) { status = RoundStatus.Tallying contributions = contributionsInfo.amount - matchingPool = await factory.getMatchingFunds(nativeTokenAddress) + matchingPool = await clrFundContract.getMatchingFunds(nativeTokenAddress) } else { if (now < signUpDeadline && contributors < maxContributors) { status = RoundStatus.Contributing @@ -213,8 +203,8 @@ export async function getRoundInfo( status = RoundStatus.Tallying } contributions = contributionsInfo.amount - //TODO: update to take factory address as a parameter, default to env. variable - matchingPool = await factory.getMatchingFunds(nativeTokenAddress) + //TODO: update to take ClrFund address as a parameter, default to env. variable + matchingPool = await clrFundContract.getMatchingFunds(nativeTokenAddress) } const totalFunds = matchingPool.add(contributions) @@ -224,9 +214,9 @@ export async function getRoundInfo( recipientRegistryAddress: utils.getAddress(recipientRegistryAddress), userRegistryAddress: utils.getAddress(userRegistryAddress), maciAddress: utils.getAddress(maciAddress), - recipientTreeDepth: maciTreeDepths.voteOptionTreeDepth, + recipientTreeDepth: voteOptionTreeDepth || 1, maxContributors, - maxRecipients: 5 ** maciTreeDepths.voteOptionTreeDepth - 1, + maxRecipients: voteOptionTreeDepth ? 5 ** voteOptionTreeDepth - 1 : 0, maxMessages, coordinatorPubKey, nativeTokenAddress: utils.getAddress(nativeTokenAddress), @@ -234,9 +224,9 @@ export async function getRoundInfo( nativeTokenDecimals, voiceCreditFactor, status, - startTime, - signUpDeadline, - votingDeadline, + startTime: DateTime.fromSeconds(Number(startTime || 0)), + signUpDeadline: DateTime.fromSeconds(Number(signUpDeadline || 0)), + votingDeadline: DateTime.fromSeconds(Number(votingDeadline || 0)), totalFunds, matchingPool, contributions, diff --git a/vue-app/src/api/rounds.ts b/vue-app/src/api/rounds.ts index 05f5d18c4..a33feff1e 100644 --- a/vue-app/src/api/rounds.ts +++ b/vue-app/src/api/rounds.ts @@ -19,10 +19,8 @@ function toRoundId({ network, address }: { network: string; address: string }): return `${network}-${address}`.toLowerCase() } -//TODO: update to take factory address as a parameter +//TODO: update to take ClrFund address as a parameter export async function getRounds(): Promise { - //TODO: updateto pass factory address as a parameter, default to env. variable - let data try { data = await sdk.GetRounds() diff --git a/vue-app/src/api/user.ts b/vue-app/src/api/user.ts index 252f44a15..9cee1f442 100644 --- a/vue-app/src/api/user.ts +++ b/vue-app/src/api/user.ts @@ -3,7 +3,7 @@ import { BigNumber, Contract, Signer, type ContractTransaction } from 'ethers' import type { Web3Provider } from '@ethersproject/providers' import { FundingRound, UserRegistry, ERC20 } from './abi' -import { factory, ipfsGatewayUrl, provider, operator } from './core' +import { clrFundContract, ipfsGatewayUrl, provider, operator } from './core' import type { BrightId } from './bright-id' import { SnapshotUserRegistry, MerkleUserRegistry } from './abi' import { @@ -21,7 +21,7 @@ To get logged in, sign this message to prove you have access to this wallet. Thi You will be asked to sign each time you load the app. -Contract address: ${factory.address.toLowerCase()}.` +Contract address: ${clrFundContract.address.toLowerCase()}.` export interface User { walletAddress: string diff --git a/vue-app/src/components/MatchingFundsModal.vue b/vue-app/src/components/MatchingFundsModal.vue index 344d4c5b2..b8f662127 100644 --- a/vue-app/src/components/MatchingFundsModal.vue +++ b/vue-app/src/components/MatchingFundsModal.vue @@ -72,7 +72,7 @@ import { formatAmount } from '@/utils/amounts' import { formatUnits } from '@ethersproject/units' import { ERC20 } from '@/api/abi' -import { factory } from '@/api/core' +import { clrFundContract } from '@/api/core' import { VueFinalModal } from 'vue-final-modal' import { useAppStore, useUserStore } from '@/stores' @@ -129,16 +129,17 @@ async function contributeMatchingFunds() { const token = new Contract(nativeTokenAddress.value, ERC20, userStore.signer) const _amount = parseFixed(amount.value, nativeTokenDecimals.value) - // TODO: update to take factory address as a parameter from the route props, default to env. variable + // TODO: update to take ClrFund address as a parameter from the route props, default to env. variable const matchingPoolAddress = import.meta.env.VITE_MATCHING_POOL_ADDRESS ? import.meta.env.VITE_MATCHING_POOL_ADDRESS - : factory.address + : clrFundContract.address try { await waitForTransaction(token.transfer(matchingPoolAddress, _amount), hash => (transferTxHash.value = hash)) } catch (error) { - transferTxError.value = error.message - if (error.message.indexOf('Nonce too high') >= 0 && import.meta.env.MODE === 'development') { + const errorMessage = (error as Error).message + transferTxError.value = errorMessage + if (errorMessage.indexOf('Nonce too high') >= 0 && import.meta.env.MODE === 'development') { transferTxError.value = 'Have you been buidling?? Reset your nonce! 🪄' } return diff --git a/vue-app/src/components/RoundInformation.vue b/vue-app/src/components/RoundInformation.vue index e90f7ecb8..3b0b087de 100644 --- a/vue-app/src/components/RoundInformation.vue +++ b/vue-app/src/components/RoundInformation.vue @@ -426,7 +426,7 @@ function addMatchingFunds(): void { close() // Reload matching pool size appStore.loadRoundInfo() - appStore.loadFactoryInfo() + appStore.loadClrFundInfo() }, }, }) diff --git a/vue-app/src/graphql/API.ts b/vue-app/src/graphql/API.ts index c007dd1dc..15c5c5433 100644 --- a/vue-app/src/graphql/API.ts +++ b/vue-app/src/graphql/API.ts @@ -29,49 +29,121 @@ export type Block_Height = { number_gte: InputMaybe; }; -export type Contribution = { - __typename?: 'Contribution'; - amount: Maybe; - contributor: Maybe; +export type ClrFund = { + __typename?: 'ClrFund'; + batchUstVerifier: Maybe; + contributorRegistry: Maybe; + contributorRegistryAddress: Maybe; + coordinator: Maybe; + coordinatorPubKey: Maybe; createdAt: Maybe; - fundingRound: Maybe; + currentRound: Maybe; + fundingRounds: Maybe>; id: Scalars['ID']; - voiceCredits: Maybe; + lastUpdatedAt: Maybe; + maciFactory: Maybe; + maxMessages: Maybe; + maxUsers: Maybe; + maxVoteOptions: Maybe; + messageBatchSize: Maybe; + messageTreeDepth: Maybe; + nativeToken: Maybe; + nativeTokenInfo: Maybe; + owner: Maybe; + qvtVerifier: Maybe; + recipientRegistry: Maybe; + recipientRegistryAddress: Maybe; + signUpDuration: Maybe; + stateTreeDepth: Maybe; + tallyBatchSize: Maybe; + voteOptionTreeDepth: Maybe; + votingDuration: Maybe; }; -export type Contribution_Filter = { + +export type ClrFundFundingRoundsArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + +export type ClrFund_Filter = { /** Filter for the block changed event. */ _change_block: InputMaybe; - amount: InputMaybe; - amount_gt: InputMaybe; - amount_gte: InputMaybe; - amount_in: InputMaybe>; - amount_lt: InputMaybe; - amount_lte: InputMaybe; - amount_not: InputMaybe; - amount_not_in: InputMaybe>; - and: InputMaybe>>; - contributor: InputMaybe; - contributor_: InputMaybe; - contributor_contains: InputMaybe; - contributor_contains_nocase: InputMaybe; - contributor_ends_with: InputMaybe; - contributor_ends_with_nocase: InputMaybe; - contributor_gt: InputMaybe; - contributor_gte: InputMaybe; - contributor_in: InputMaybe>; - contributor_lt: InputMaybe; - contributor_lte: InputMaybe; - contributor_not: InputMaybe; - contributor_not_contains: InputMaybe; - contributor_not_contains_nocase: InputMaybe; - contributor_not_ends_with: InputMaybe; - contributor_not_ends_with_nocase: InputMaybe; - contributor_not_in: InputMaybe>; - contributor_not_starts_with: InputMaybe; - contributor_not_starts_with_nocase: InputMaybe; - contributor_starts_with: InputMaybe; - contributor_starts_with_nocase: InputMaybe; + and: InputMaybe>>; + batchUstVerifier: InputMaybe; + batchUstVerifier_contains: InputMaybe; + batchUstVerifier_gt: InputMaybe; + batchUstVerifier_gte: InputMaybe; + batchUstVerifier_in: InputMaybe>; + batchUstVerifier_lt: InputMaybe; + batchUstVerifier_lte: InputMaybe; + batchUstVerifier_not: InputMaybe; + batchUstVerifier_not_contains: InputMaybe; + batchUstVerifier_not_in: InputMaybe>; + contributorRegistry: InputMaybe; + contributorRegistryAddress: InputMaybe; + contributorRegistryAddress_contains: InputMaybe; + contributorRegistryAddress_gt: InputMaybe; + contributorRegistryAddress_gte: InputMaybe; + contributorRegistryAddress_in: InputMaybe>; + contributorRegistryAddress_lt: InputMaybe; + contributorRegistryAddress_lte: InputMaybe; + contributorRegistryAddress_not: InputMaybe; + contributorRegistryAddress_not_contains: InputMaybe; + contributorRegistryAddress_not_in: InputMaybe>; + contributorRegistry_: InputMaybe; + contributorRegistry_contains: InputMaybe; + contributorRegistry_contains_nocase: InputMaybe; + contributorRegistry_ends_with: InputMaybe; + contributorRegistry_ends_with_nocase: InputMaybe; + contributorRegistry_gt: InputMaybe; + contributorRegistry_gte: InputMaybe; + contributorRegistry_in: InputMaybe>; + contributorRegistry_lt: InputMaybe; + contributorRegistry_lte: InputMaybe; + contributorRegistry_not: InputMaybe; + contributorRegistry_not_contains: InputMaybe; + contributorRegistry_not_contains_nocase: InputMaybe; + contributorRegistry_not_ends_with: InputMaybe; + contributorRegistry_not_ends_with_nocase: InputMaybe; + contributorRegistry_not_in: InputMaybe>; + contributorRegistry_not_starts_with: InputMaybe; + contributorRegistry_not_starts_with_nocase: InputMaybe; + contributorRegistry_starts_with: InputMaybe; + contributorRegistry_starts_with_nocase: InputMaybe; + coordinator: InputMaybe; + coordinatorPubKey: InputMaybe; + coordinatorPubKey_contains: InputMaybe; + coordinatorPubKey_contains_nocase: InputMaybe; + coordinatorPubKey_ends_with: InputMaybe; + coordinatorPubKey_ends_with_nocase: InputMaybe; + coordinatorPubKey_gt: InputMaybe; + coordinatorPubKey_gte: InputMaybe; + coordinatorPubKey_in: InputMaybe>; + coordinatorPubKey_lt: InputMaybe; + coordinatorPubKey_lte: InputMaybe; + coordinatorPubKey_not: InputMaybe; + coordinatorPubKey_not_contains: InputMaybe; + coordinatorPubKey_not_contains_nocase: InputMaybe; + coordinatorPubKey_not_ends_with: InputMaybe; + coordinatorPubKey_not_ends_with_nocase: InputMaybe; + coordinatorPubKey_not_in: InputMaybe>; + coordinatorPubKey_not_starts_with: InputMaybe; + coordinatorPubKey_not_starts_with_nocase: InputMaybe; + coordinatorPubKey_starts_with: InputMaybe; + coordinatorPubKey_starts_with_nocase: InputMaybe; + coordinator_contains: InputMaybe; + coordinator_gt: InputMaybe; + coordinator_gte: InputMaybe; + coordinator_in: InputMaybe>; + coordinator_lt: InputMaybe; + coordinator_lte: InputMaybe; + coordinator_not: InputMaybe; + coordinator_not_contains: InputMaybe; + coordinator_not_in: InputMaybe>; createdAt: InputMaybe; createdAt_contains: InputMaybe; createdAt_contains_nocase: InputMaybe; @@ -92,206 +164,28 @@ export type Contribution_Filter = { createdAt_not_starts_with_nocase: InputMaybe; createdAt_starts_with: InputMaybe; createdAt_starts_with_nocase: InputMaybe; - fundingRound: InputMaybe; - fundingRound_: InputMaybe; - fundingRound_contains: InputMaybe; - fundingRound_contains_nocase: InputMaybe; - fundingRound_ends_with: InputMaybe; - fundingRound_ends_with_nocase: InputMaybe; - fundingRound_gt: InputMaybe; - fundingRound_gte: InputMaybe; - fundingRound_in: InputMaybe>; - fundingRound_lt: InputMaybe; - fundingRound_lte: InputMaybe; - fundingRound_not: InputMaybe; - fundingRound_not_contains: InputMaybe; - fundingRound_not_contains_nocase: InputMaybe; - fundingRound_not_ends_with: InputMaybe; - fundingRound_not_ends_with_nocase: InputMaybe; - fundingRound_not_in: InputMaybe>; - fundingRound_not_starts_with: InputMaybe; - fundingRound_not_starts_with_nocase: InputMaybe; - fundingRound_starts_with: InputMaybe; - fundingRound_starts_with_nocase: InputMaybe; - id: InputMaybe; - id_gt: InputMaybe; - id_gte: InputMaybe; - id_in: InputMaybe>; - id_lt: InputMaybe; - id_lte: InputMaybe; - id_not: InputMaybe; - id_not_in: InputMaybe>; - or: InputMaybe>>; - voiceCredits: InputMaybe; - voiceCredits_gt: InputMaybe; - voiceCredits_gte: InputMaybe; - voiceCredits_in: InputMaybe>; - voiceCredits_lt: InputMaybe; - voiceCredits_lte: InputMaybe; - voiceCredits_not: InputMaybe; - voiceCredits_not_in: InputMaybe>; -}; - -export enum Contribution_OrderBy { - Amount = 'amount', - Contributor = 'contributor', - ContributorContributorAddress = 'contributor__contributorAddress', - ContributorCreatedAt = 'contributor__createdAt', - ContributorId = 'contributor__id', - ContributorLastUpdatedAt = 'contributor__lastUpdatedAt', - ContributorVerifiedTimeStamp = 'contributor__verifiedTimeStamp', - CreatedAt = 'createdAt', - FundingRound = 'fundingRound', - FundingRoundContributorCount = 'fundingRound__contributorCount', - FundingRoundContributorRegistryAddress = 'fundingRound__contributorRegistryAddress', - FundingRoundCoordinator = 'fundingRound__coordinator', - FundingRoundCreatedAt = 'fundingRound__createdAt', - FundingRoundId = 'fundingRound__id', - FundingRoundIsCancelled = 'fundingRound__isCancelled', - FundingRoundIsFinalized = 'fundingRound__isFinalized', - FundingRoundLastUpdatedAt = 'fundingRound__lastUpdatedAt', - FundingRoundMaci = 'fundingRound__maci', - FundingRoundMatchingPoolSize = 'fundingRound__matchingPoolSize', - FundingRoundNativeToken = 'fundingRound__nativeToken', - FundingRoundRecipientCount = 'fundingRound__recipientCount', - FundingRoundRecipientRegistryAddress = 'fundingRound__recipientRegistryAddress', - FundingRoundSignUpDeadline = 'fundingRound__signUpDeadline', - FundingRoundStartTime = 'fundingRound__startTime', - FundingRoundTallyHash = 'fundingRound__tallyHash', - FundingRoundTotalSpent = 'fundingRound__totalSpent', - FundingRoundTotalVotes = 'fundingRound__totalVotes', - FundingRoundVoiceCreditFactor = 'fundingRound__voiceCreditFactor', - FundingRoundVotingDeadline = 'fundingRound__votingDeadline', - Id = 'id', - VoiceCredits = 'voiceCredits' -} - -export type Contributor = { - __typename?: 'Contributor'; - contributions: Maybe>; - contributorAddress: Maybe; - contributorRegistry: ContributorRegistry; - createdAt: Maybe; - fundingRounds: Maybe>; - id: Scalars['ID']; - lastUpdatedAt: Maybe; - verifiedTimeStamp: Maybe; - votes: Maybe>; -}; - - -export type ContributorContributionsArgs = { - first?: InputMaybe; - orderBy: InputMaybe; - orderDirection: InputMaybe; - skip?: InputMaybe; - where: InputMaybe; -}; - - -export type ContributorFundingRoundsArgs = { - first?: InputMaybe; - orderBy: InputMaybe; - orderDirection: InputMaybe; - skip?: InputMaybe; - where: InputMaybe; -}; - - -export type ContributorVotesArgs = { - first?: InputMaybe; - orderBy: InputMaybe; - orderDirection: InputMaybe; - skip?: InputMaybe; - where: InputMaybe; -}; - -export type ContributorRegistry = { - __typename?: 'ContributorRegistry'; - context: Maybe; - contributors: Maybe>; - createdAt: Maybe; - fundingRoundFactory: FundingRoundFactory; - id: Scalars['ID']; - lastUpdatedAt: Maybe; - owner: Maybe; -}; - - -export type ContributorRegistryContributorsArgs = { - first?: InputMaybe; - orderBy: InputMaybe; - orderDirection: InputMaybe; - skip?: InputMaybe; - where: InputMaybe; -}; - -export type ContributorRegistry_Filter = { - /** Filter for the block changed event. */ - _change_block: InputMaybe; - and: InputMaybe>>; - context: InputMaybe; - context_contains: InputMaybe; - context_contains_nocase: InputMaybe; - context_ends_with: InputMaybe; - context_ends_with_nocase: InputMaybe; - context_gt: InputMaybe; - context_gte: InputMaybe; - context_in: InputMaybe>; - context_lt: InputMaybe; - context_lte: InputMaybe; - context_not: InputMaybe; - context_not_contains: InputMaybe; - context_not_contains_nocase: InputMaybe; - context_not_ends_with: InputMaybe; - context_not_ends_with_nocase: InputMaybe; - context_not_in: InputMaybe>; - context_not_starts_with: InputMaybe; - context_not_starts_with_nocase: InputMaybe; - context_starts_with: InputMaybe; - context_starts_with_nocase: InputMaybe; - contributors_: InputMaybe; - createdAt: InputMaybe; - createdAt_contains: InputMaybe; - createdAt_contains_nocase: InputMaybe; - createdAt_ends_with: InputMaybe; - createdAt_ends_with_nocase: InputMaybe; - createdAt_gt: InputMaybe; - createdAt_gte: InputMaybe; - createdAt_in: InputMaybe>; - createdAt_lt: InputMaybe; - createdAt_lte: InputMaybe; - createdAt_not: InputMaybe; - createdAt_not_contains: InputMaybe; - createdAt_not_contains_nocase: InputMaybe; - createdAt_not_ends_with: InputMaybe; - createdAt_not_ends_with_nocase: InputMaybe; - createdAt_not_in: InputMaybe>; - createdAt_not_starts_with: InputMaybe; - createdAt_not_starts_with_nocase: InputMaybe; - createdAt_starts_with: InputMaybe; - createdAt_starts_with_nocase: InputMaybe; - fundingRoundFactory: InputMaybe; - fundingRoundFactory_: InputMaybe; - fundingRoundFactory_contains: InputMaybe; - fundingRoundFactory_contains_nocase: InputMaybe; - fundingRoundFactory_ends_with: InputMaybe; - fundingRoundFactory_ends_with_nocase: InputMaybe; - fundingRoundFactory_gt: InputMaybe; - fundingRoundFactory_gte: InputMaybe; - fundingRoundFactory_in: InputMaybe>; - fundingRoundFactory_lt: InputMaybe; - fundingRoundFactory_lte: InputMaybe; - fundingRoundFactory_not: InputMaybe; - fundingRoundFactory_not_contains: InputMaybe; - fundingRoundFactory_not_contains_nocase: InputMaybe; - fundingRoundFactory_not_ends_with: InputMaybe; - fundingRoundFactory_not_ends_with_nocase: InputMaybe; - fundingRoundFactory_not_in: InputMaybe>; - fundingRoundFactory_not_starts_with: InputMaybe; - fundingRoundFactory_not_starts_with_nocase: InputMaybe; - fundingRoundFactory_starts_with: InputMaybe; - fundingRoundFactory_starts_with_nocase: InputMaybe; + currentRound: InputMaybe; + currentRound_: InputMaybe; + currentRound_contains: InputMaybe; + currentRound_contains_nocase: InputMaybe; + currentRound_ends_with: InputMaybe; + currentRound_ends_with_nocase: InputMaybe; + currentRound_gt: InputMaybe; + currentRound_gte: InputMaybe; + currentRound_in: InputMaybe>; + currentRound_lt: InputMaybe; + currentRound_lte: InputMaybe; + currentRound_not: InputMaybe; + currentRound_not_contains: InputMaybe; + currentRound_not_contains_nocase: InputMaybe; + currentRound_not_ends_with: InputMaybe; + currentRound_not_ends_with_nocase: InputMaybe; + currentRound_not_in: InputMaybe>; + currentRound_not_starts_with: InputMaybe; + currentRound_not_starts_with_nocase: InputMaybe; + currentRound_starts_with: InputMaybe; + currentRound_starts_with_nocase: InputMaybe; + fundingRounds_: InputMaybe; id: InputMaybe; id_gt: InputMaybe; id_gte: InputMaybe; @@ -320,7 +214,88 @@ export type ContributorRegistry_Filter = { lastUpdatedAt_not_starts_with_nocase: InputMaybe; lastUpdatedAt_starts_with: InputMaybe; lastUpdatedAt_starts_with_nocase: InputMaybe; - or: InputMaybe>>; + maciFactory: InputMaybe; + maciFactory_contains: InputMaybe; + maciFactory_gt: InputMaybe; + maciFactory_gte: InputMaybe; + maciFactory_in: InputMaybe>; + maciFactory_lt: InputMaybe; + maciFactory_lte: InputMaybe; + maciFactory_not: InputMaybe; + maciFactory_not_contains: InputMaybe; + maciFactory_not_in: InputMaybe>; + maxMessages: InputMaybe; + maxMessages_gt: InputMaybe; + maxMessages_gte: InputMaybe; + maxMessages_in: InputMaybe>; + maxMessages_lt: InputMaybe; + maxMessages_lte: InputMaybe; + maxMessages_not: InputMaybe; + maxMessages_not_in: InputMaybe>; + maxUsers: InputMaybe; + maxUsers_gt: InputMaybe; + maxUsers_gte: InputMaybe; + maxUsers_in: InputMaybe>; + maxUsers_lt: InputMaybe; + maxUsers_lte: InputMaybe; + maxUsers_not: InputMaybe; + maxUsers_not_in: InputMaybe>; + maxVoteOptions: InputMaybe; + maxVoteOptions_gt: InputMaybe; + maxVoteOptions_gte: InputMaybe; + maxVoteOptions_in: InputMaybe>; + maxVoteOptions_lt: InputMaybe; + maxVoteOptions_lte: InputMaybe; + maxVoteOptions_not: InputMaybe; + maxVoteOptions_not_in: InputMaybe>; + messageBatchSize: InputMaybe; + messageBatchSize_gt: InputMaybe; + messageBatchSize_gte: InputMaybe; + messageBatchSize_in: InputMaybe>; + messageBatchSize_lt: InputMaybe; + messageBatchSize_lte: InputMaybe; + messageBatchSize_not: InputMaybe; + messageBatchSize_not_in: InputMaybe>; + messageTreeDepth: InputMaybe; + messageTreeDepth_gt: InputMaybe; + messageTreeDepth_gte: InputMaybe; + messageTreeDepth_in: InputMaybe>; + messageTreeDepth_lt: InputMaybe; + messageTreeDepth_lte: InputMaybe; + messageTreeDepth_not: InputMaybe; + messageTreeDepth_not_in: InputMaybe>; + nativeToken: InputMaybe; + nativeTokenInfo: InputMaybe; + nativeTokenInfo_: InputMaybe; + nativeTokenInfo_contains: InputMaybe; + nativeTokenInfo_contains_nocase: InputMaybe; + nativeTokenInfo_ends_with: InputMaybe; + nativeTokenInfo_ends_with_nocase: InputMaybe; + nativeTokenInfo_gt: InputMaybe; + nativeTokenInfo_gte: InputMaybe; + nativeTokenInfo_in: InputMaybe>; + nativeTokenInfo_lt: InputMaybe; + nativeTokenInfo_lte: InputMaybe; + nativeTokenInfo_not: InputMaybe; + nativeTokenInfo_not_contains: InputMaybe; + nativeTokenInfo_not_contains_nocase: InputMaybe; + nativeTokenInfo_not_ends_with: InputMaybe; + nativeTokenInfo_not_ends_with_nocase: InputMaybe; + nativeTokenInfo_not_in: InputMaybe>; + nativeTokenInfo_not_starts_with: InputMaybe; + nativeTokenInfo_not_starts_with_nocase: InputMaybe; + nativeTokenInfo_starts_with: InputMaybe; + nativeTokenInfo_starts_with_nocase: InputMaybe; + nativeToken_contains: InputMaybe; + nativeToken_gt: InputMaybe; + nativeToken_gte: InputMaybe; + nativeToken_in: InputMaybe>; + nativeToken_lt: InputMaybe; + nativeToken_lte: InputMaybe; + nativeToken_not: InputMaybe; + nativeToken_not_contains: InputMaybe; + nativeToken_not_in: InputMaybe>; + or: InputMaybe>>; owner: InputMaybe; owner_contains: InputMaybe; owner_gt: InputMaybe; @@ -331,284 +306,207 @@ export type ContributorRegistry_Filter = { owner_not: InputMaybe; owner_not_contains: InputMaybe; owner_not_in: InputMaybe>; + qvtVerifier: InputMaybe; + qvtVerifier_contains: InputMaybe; + qvtVerifier_gt: InputMaybe; + qvtVerifier_gte: InputMaybe; + qvtVerifier_in: InputMaybe>; + qvtVerifier_lt: InputMaybe; + qvtVerifier_lte: InputMaybe; + qvtVerifier_not: InputMaybe; + qvtVerifier_not_contains: InputMaybe; + qvtVerifier_not_in: InputMaybe>; + recipientRegistry: InputMaybe; + recipientRegistryAddress: InputMaybe; + recipientRegistryAddress_contains: InputMaybe; + recipientRegistryAddress_gt: InputMaybe; + recipientRegistryAddress_gte: InputMaybe; + recipientRegistryAddress_in: InputMaybe>; + recipientRegistryAddress_lt: InputMaybe; + recipientRegistryAddress_lte: InputMaybe; + recipientRegistryAddress_not: InputMaybe; + recipientRegistryAddress_not_contains: InputMaybe; + recipientRegistryAddress_not_in: InputMaybe>; + recipientRegistry_: InputMaybe; + recipientRegistry_contains: InputMaybe; + recipientRegistry_contains_nocase: InputMaybe; + recipientRegistry_ends_with: InputMaybe; + recipientRegistry_ends_with_nocase: InputMaybe; + recipientRegistry_gt: InputMaybe; + recipientRegistry_gte: InputMaybe; + recipientRegistry_in: InputMaybe>; + recipientRegistry_lt: InputMaybe; + recipientRegistry_lte: InputMaybe; + recipientRegistry_not: InputMaybe; + recipientRegistry_not_contains: InputMaybe; + recipientRegistry_not_contains_nocase: InputMaybe; + recipientRegistry_not_ends_with: InputMaybe; + recipientRegistry_not_ends_with_nocase: InputMaybe; + recipientRegistry_not_in: InputMaybe>; + recipientRegistry_not_starts_with: InputMaybe; + recipientRegistry_not_starts_with_nocase: InputMaybe; + recipientRegistry_starts_with: InputMaybe; + recipientRegistry_starts_with_nocase: InputMaybe; + signUpDuration: InputMaybe; + signUpDuration_gt: InputMaybe; + signUpDuration_gte: InputMaybe; + signUpDuration_in: InputMaybe>; + signUpDuration_lt: InputMaybe; + signUpDuration_lte: InputMaybe; + signUpDuration_not: InputMaybe; + signUpDuration_not_in: InputMaybe>; + stateTreeDepth: InputMaybe; + stateTreeDepth_gt: InputMaybe; + stateTreeDepth_gte: InputMaybe; + stateTreeDepth_in: InputMaybe>; + stateTreeDepth_lt: InputMaybe; + stateTreeDepth_lte: InputMaybe; + stateTreeDepth_not: InputMaybe; + stateTreeDepth_not_in: InputMaybe>; + tallyBatchSize: InputMaybe; + tallyBatchSize_gt: InputMaybe; + tallyBatchSize_gte: InputMaybe; + tallyBatchSize_in: InputMaybe>; + tallyBatchSize_lt: InputMaybe; + tallyBatchSize_lte: InputMaybe; + tallyBatchSize_not: InputMaybe; + tallyBatchSize_not_in: InputMaybe>; + voteOptionTreeDepth: InputMaybe; + voteOptionTreeDepth_gt: InputMaybe; + voteOptionTreeDepth_gte: InputMaybe; + voteOptionTreeDepth_in: InputMaybe>; + voteOptionTreeDepth_lt: InputMaybe; + voteOptionTreeDepth_lte: InputMaybe; + voteOptionTreeDepth_not: InputMaybe; + voteOptionTreeDepth_not_in: InputMaybe>; + votingDuration: InputMaybe; + votingDuration_gt: InputMaybe; + votingDuration_gte: InputMaybe; + votingDuration_in: InputMaybe>; + votingDuration_lt: InputMaybe; + votingDuration_lte: InputMaybe; + votingDuration_not: InputMaybe; + votingDuration_not_in: InputMaybe>; }; -export enum ContributorRegistry_OrderBy { - Context = 'context', - Contributors = 'contributors', - CreatedAt = 'createdAt', - FundingRoundFactory = 'fundingRoundFactory', - FundingRoundFactoryBatchUstVerifier = 'fundingRoundFactory__batchUstVerifier', - FundingRoundFactoryContributorRegistryAddress = 'fundingRoundFactory__contributorRegistryAddress', - FundingRoundFactoryCoordinator = 'fundingRoundFactory__coordinator', - FundingRoundFactoryCoordinatorPubKey = 'fundingRoundFactory__coordinatorPubKey', - FundingRoundFactoryCreatedAt = 'fundingRoundFactory__createdAt', - FundingRoundFactoryId = 'fundingRoundFactory__id', - FundingRoundFactoryLastUpdatedAt = 'fundingRoundFactory__lastUpdatedAt', - FundingRoundFactoryMaciFactory = 'fundingRoundFactory__maciFactory', - FundingRoundFactoryMaxMessages = 'fundingRoundFactory__maxMessages', - FundingRoundFactoryMaxUsers = 'fundingRoundFactory__maxUsers', - FundingRoundFactoryMaxVoteOptions = 'fundingRoundFactory__maxVoteOptions', - FundingRoundFactoryMessageBatchSize = 'fundingRoundFactory__messageBatchSize', - FundingRoundFactoryMessageTreeDepth = 'fundingRoundFactory__messageTreeDepth', - FundingRoundFactoryNativeToken = 'fundingRoundFactory__nativeToken', - FundingRoundFactoryOwner = 'fundingRoundFactory__owner', - FundingRoundFactoryQvtVerifier = 'fundingRoundFactory__qvtVerifier', - FundingRoundFactoryRecipientRegistryAddress = 'fundingRoundFactory__recipientRegistryAddress', - FundingRoundFactorySignUpDuration = 'fundingRoundFactory__signUpDuration', - FundingRoundFactoryStateTreeDepth = 'fundingRoundFactory__stateTreeDepth', - FundingRoundFactoryTallyBatchSize = 'fundingRoundFactory__tallyBatchSize', - FundingRoundFactoryVoteOptionTreeDepth = 'fundingRoundFactory__voteOptionTreeDepth', - FundingRoundFactoryVotingDuration = 'fundingRoundFactory__votingDuration', - Id = 'id', - LastUpdatedAt = 'lastUpdatedAt', - Owner = 'owner' -} - -export type Contributor_Filter = { - /** Filter for the block changed event. */ - _change_block: InputMaybe; - and: InputMaybe>>; - contributions_: InputMaybe; - contributorAddress: InputMaybe; - contributorAddress_contains: InputMaybe; - contributorAddress_gt: InputMaybe; - contributorAddress_gte: InputMaybe; - contributorAddress_in: InputMaybe>; - contributorAddress_lt: InputMaybe; - contributorAddress_lte: InputMaybe; - contributorAddress_not: InputMaybe; - contributorAddress_not_contains: InputMaybe; - contributorAddress_not_in: InputMaybe>; - contributorRegistry: InputMaybe; - contributorRegistry_: InputMaybe; - contributorRegistry_contains: InputMaybe; - contributorRegistry_contains_nocase: InputMaybe; - contributorRegistry_ends_with: InputMaybe; - contributorRegistry_ends_with_nocase: InputMaybe; - contributorRegistry_gt: InputMaybe; - contributorRegistry_gte: InputMaybe; - contributorRegistry_in: InputMaybe>; - contributorRegistry_lt: InputMaybe; - contributorRegistry_lte: InputMaybe; - contributorRegistry_not: InputMaybe; - contributorRegistry_not_contains: InputMaybe; - contributorRegistry_not_contains_nocase: InputMaybe; - contributorRegistry_not_ends_with: InputMaybe; - contributorRegistry_not_ends_with_nocase: InputMaybe; - contributorRegistry_not_in: InputMaybe>; - contributorRegistry_not_starts_with: InputMaybe; - contributorRegistry_not_starts_with_nocase: InputMaybe; - contributorRegistry_starts_with: InputMaybe; - contributorRegistry_starts_with_nocase: InputMaybe; - createdAt: InputMaybe; - createdAt_contains: InputMaybe; - createdAt_contains_nocase: InputMaybe; - createdAt_ends_with: InputMaybe; - createdAt_ends_with_nocase: InputMaybe; - createdAt_gt: InputMaybe; - createdAt_gte: InputMaybe; - createdAt_in: InputMaybe>; - createdAt_lt: InputMaybe; - createdAt_lte: InputMaybe; - createdAt_not: InputMaybe; - createdAt_not_contains: InputMaybe; - createdAt_not_contains_nocase: InputMaybe; - createdAt_not_ends_with: InputMaybe; - createdAt_not_ends_with_nocase: InputMaybe; - createdAt_not_in: InputMaybe>; - createdAt_not_starts_with: InputMaybe; - createdAt_not_starts_with_nocase: InputMaybe; - createdAt_starts_with: InputMaybe; - createdAt_starts_with_nocase: InputMaybe; - fundingRounds: InputMaybe>; - fundingRounds_: InputMaybe; - fundingRounds_contains: InputMaybe>; - fundingRounds_contains_nocase: InputMaybe>; - fundingRounds_not: InputMaybe>; - fundingRounds_not_contains: InputMaybe>; - fundingRounds_not_contains_nocase: InputMaybe>; - id: InputMaybe; - id_gt: InputMaybe; - id_gte: InputMaybe; - id_in: InputMaybe>; - id_lt: InputMaybe; - id_lte: InputMaybe; - id_not: InputMaybe; - id_not_in: InputMaybe>; - lastUpdatedAt: InputMaybe; - lastUpdatedAt_contains: InputMaybe; - lastUpdatedAt_contains_nocase: InputMaybe; - lastUpdatedAt_ends_with: InputMaybe; - lastUpdatedAt_ends_with_nocase: InputMaybe; - lastUpdatedAt_gt: InputMaybe; - lastUpdatedAt_gte: InputMaybe; - lastUpdatedAt_in: InputMaybe>; - lastUpdatedAt_lt: InputMaybe; - lastUpdatedAt_lte: InputMaybe; - lastUpdatedAt_not: InputMaybe; - lastUpdatedAt_not_contains: InputMaybe; - lastUpdatedAt_not_contains_nocase: InputMaybe; - lastUpdatedAt_not_ends_with: InputMaybe; - lastUpdatedAt_not_ends_with_nocase: InputMaybe; - lastUpdatedAt_not_in: InputMaybe>; - lastUpdatedAt_not_starts_with: InputMaybe; - lastUpdatedAt_not_starts_with_nocase: InputMaybe; - lastUpdatedAt_starts_with: InputMaybe; - lastUpdatedAt_starts_with_nocase: InputMaybe; - or: InputMaybe>>; - verifiedTimeStamp: InputMaybe; - verifiedTimeStamp_contains: InputMaybe; - verifiedTimeStamp_contains_nocase: InputMaybe; - verifiedTimeStamp_ends_with: InputMaybe; - verifiedTimeStamp_ends_with_nocase: InputMaybe; - verifiedTimeStamp_gt: InputMaybe; - verifiedTimeStamp_gte: InputMaybe; - verifiedTimeStamp_in: InputMaybe>; - verifiedTimeStamp_lt: InputMaybe; - verifiedTimeStamp_lte: InputMaybe; - verifiedTimeStamp_not: InputMaybe; - verifiedTimeStamp_not_contains: InputMaybe; - verifiedTimeStamp_not_contains_nocase: InputMaybe; - verifiedTimeStamp_not_ends_with: InputMaybe; - verifiedTimeStamp_not_ends_with_nocase: InputMaybe; - verifiedTimeStamp_not_in: InputMaybe>; - verifiedTimeStamp_not_starts_with: InputMaybe; - verifiedTimeStamp_not_starts_with_nocase: InputMaybe; - verifiedTimeStamp_starts_with: InputMaybe; - verifiedTimeStamp_starts_with_nocase: InputMaybe; - votes_: InputMaybe; -}; - -export enum Contributor_OrderBy { - Contributions = 'contributions', - ContributorAddress = 'contributorAddress', +export enum ClrFund_OrderBy { + BatchUstVerifier = 'batchUstVerifier', ContributorRegistry = 'contributorRegistry', + ContributorRegistryAddress = 'contributorRegistryAddress', ContributorRegistryContext = 'contributorRegistry__context', ContributorRegistryCreatedAt = 'contributorRegistry__createdAt', ContributorRegistryId = 'contributorRegistry__id', ContributorRegistryLastUpdatedAt = 'contributorRegistry__lastUpdatedAt', ContributorRegistryOwner = 'contributorRegistry__owner', + Coordinator = 'coordinator', + CoordinatorPubKey = 'coordinatorPubKey', CreatedAt = 'createdAt', + CurrentRound = 'currentRound', + CurrentRoundContributorCount = 'currentRound__contributorCount', + CurrentRoundContributorRegistryAddress = 'currentRound__contributorRegistryAddress', + CurrentRoundCoordinator = 'currentRound__coordinator', + CurrentRoundCoordinatorPubKeyX = 'currentRound__coordinatorPubKeyX', + CurrentRoundCoordinatorPubKeyY = 'currentRound__coordinatorPubKeyY', + CurrentRoundCreatedAt = 'currentRound__createdAt', + CurrentRoundId = 'currentRound__id', + CurrentRoundIsCancelled = 'currentRound__isCancelled', + CurrentRoundIsFinalized = 'currentRound__isFinalized', + CurrentRoundLastUpdatedAt = 'currentRound__lastUpdatedAt', + CurrentRoundMaci = 'currentRound__maci', + CurrentRoundMatchingPoolSize = 'currentRound__matchingPoolSize', + CurrentRoundMessageTreeDepth = 'currentRound__messageTreeDepth', + CurrentRoundNativeToken = 'currentRound__nativeToken', + CurrentRoundPollAddress = 'currentRound__pollAddress', + CurrentRoundRecipientCount = 'currentRound__recipientCount', + CurrentRoundRecipientRegistryAddress = 'currentRound__recipientRegistryAddress', + CurrentRoundSignUpDeadline = 'currentRound__signUpDeadline', + CurrentRoundStartTime = 'currentRound__startTime', + CurrentRoundStateTreeDepth = 'currentRound__stateTreeDepth', + CurrentRoundTallyHash = 'currentRound__tallyHash', + CurrentRoundTotalSpent = 'currentRound__totalSpent', + CurrentRoundTotalVotes = 'currentRound__totalVotes', + CurrentRoundVoiceCreditFactor = 'currentRound__voiceCreditFactor', + CurrentRoundVoteOptionTreeDepth = 'currentRound__voteOptionTreeDepth', + CurrentRoundVotingDeadline = 'currentRound__votingDeadline', FundingRounds = 'fundingRounds', Id = 'id', LastUpdatedAt = 'lastUpdatedAt', - VerifiedTimeStamp = 'verifiedTimeStamp', - Votes = 'votes' + MaciFactory = 'maciFactory', + MaxMessages = 'maxMessages', + MaxUsers = 'maxUsers', + MaxVoteOptions = 'maxVoteOptions', + MessageBatchSize = 'messageBatchSize', + MessageTreeDepth = 'messageTreeDepth', + NativeToken = 'nativeToken', + NativeTokenInfo = 'nativeTokenInfo', + NativeTokenInfoCreatedAt = 'nativeTokenInfo__createdAt', + NativeTokenInfoDecimals = 'nativeTokenInfo__decimals', + NativeTokenInfoId = 'nativeTokenInfo__id', + NativeTokenInfoLastUpdatedAt = 'nativeTokenInfo__lastUpdatedAt', + NativeTokenInfoSymbol = 'nativeTokenInfo__symbol', + NativeTokenInfoTokenAddress = 'nativeTokenInfo__tokenAddress', + Owner = 'owner', + QvtVerifier = 'qvtVerifier', + RecipientRegistry = 'recipientRegistry', + RecipientRegistryAddress = 'recipientRegistryAddress', + RecipientRegistryBaseDeposit = 'recipientRegistry__baseDeposit', + RecipientRegistryChallengePeriodDuration = 'recipientRegistry__challengePeriodDuration', + RecipientRegistryController = 'recipientRegistry__controller', + RecipientRegistryCreatedAt = 'recipientRegistry__createdAt', + RecipientRegistryId = 'recipientRegistry__id', + RecipientRegistryLastUpdatedAt = 'recipientRegistry__lastUpdatedAt', + RecipientRegistryMaxRecipients = 'recipientRegistry__maxRecipients', + RecipientRegistryOwner = 'recipientRegistry__owner', + SignUpDuration = 'signUpDuration', + StateTreeDepth = 'stateTreeDepth', + TallyBatchSize = 'tallyBatchSize', + VoteOptionTreeDepth = 'voteOptionTreeDepth', + VotingDuration = 'votingDuration' } -export type Coordinator = { - __typename?: 'Coordinator'; - contact: Maybe; +export type Contribution = { + __typename?: 'Contribution'; + amount: Maybe; + contributor: Maybe; createdAt: Maybe; + fundingRound: Maybe; id: Scalars['ID']; - lastUpdatedAt: Maybe; + voiceCredits: Maybe; }; -export type Coordinator_Filter = { +export type Contribution_Filter = { /** Filter for the block changed event. */ _change_block: InputMaybe; - and: InputMaybe>>; - contact: InputMaybe; - contact_contains: InputMaybe; - contact_contains_nocase: InputMaybe; - contact_ends_with: InputMaybe; - contact_ends_with_nocase: InputMaybe; - contact_gt: InputMaybe; - contact_gte: InputMaybe; - contact_in: InputMaybe>; - contact_lt: InputMaybe; - contact_lte: InputMaybe; - contact_not: InputMaybe; - contact_not_contains: InputMaybe; - contact_not_contains_nocase: InputMaybe; - contact_not_ends_with: InputMaybe; - contact_not_ends_with_nocase: InputMaybe; - contact_not_in: InputMaybe>; - contact_not_starts_with: InputMaybe; - contact_not_starts_with_nocase: InputMaybe; - contact_starts_with: InputMaybe; - contact_starts_with_nocase: InputMaybe; - createdAt: InputMaybe; - createdAt_contains: InputMaybe; - createdAt_contains_nocase: InputMaybe; - createdAt_ends_with: InputMaybe; - createdAt_ends_with_nocase: InputMaybe; - createdAt_gt: InputMaybe; - createdAt_gte: InputMaybe; - createdAt_in: InputMaybe>; - createdAt_lt: InputMaybe; - createdAt_lte: InputMaybe; - createdAt_not: InputMaybe; - createdAt_not_contains: InputMaybe; - createdAt_not_contains_nocase: InputMaybe; - createdAt_not_ends_with: InputMaybe; - createdAt_not_ends_with_nocase: InputMaybe; - createdAt_not_in: InputMaybe>; - createdAt_not_starts_with: InputMaybe; - createdAt_not_starts_with_nocase: InputMaybe; - createdAt_starts_with: InputMaybe; - createdAt_starts_with_nocase: InputMaybe; - id: InputMaybe; - id_gt: InputMaybe; - id_gte: InputMaybe; - id_in: InputMaybe>; - id_lt: InputMaybe; - id_lte: InputMaybe; - id_not: InputMaybe; - id_not_in: InputMaybe>; - lastUpdatedAt: InputMaybe; - lastUpdatedAt_contains: InputMaybe; - lastUpdatedAt_contains_nocase: InputMaybe; - lastUpdatedAt_ends_with: InputMaybe; - lastUpdatedAt_ends_with_nocase: InputMaybe; - lastUpdatedAt_gt: InputMaybe; - lastUpdatedAt_gte: InputMaybe; - lastUpdatedAt_in: InputMaybe>; - lastUpdatedAt_lt: InputMaybe; - lastUpdatedAt_lte: InputMaybe; - lastUpdatedAt_not: InputMaybe; - lastUpdatedAt_not_contains: InputMaybe; - lastUpdatedAt_not_contains_nocase: InputMaybe; - lastUpdatedAt_not_ends_with: InputMaybe; - lastUpdatedAt_not_ends_with_nocase: InputMaybe; - lastUpdatedAt_not_in: InputMaybe>; - lastUpdatedAt_not_starts_with: InputMaybe; - lastUpdatedAt_not_starts_with_nocase: InputMaybe; - lastUpdatedAt_starts_with: InputMaybe; - lastUpdatedAt_starts_with_nocase: InputMaybe; - or: InputMaybe>>; -}; - -export enum Coordinator_OrderBy { - Contact = 'contact', - CreatedAt = 'createdAt', - Id = 'id', - LastUpdatedAt = 'lastUpdatedAt' -} - -export type Donation = { - __typename?: 'Donation'; - amount: Maybe; - createdAt: Maybe; - fundingRound: Maybe; - id: Scalars['ID']; - recipient: Maybe; - voteOptionIndex: Maybe; -}; - -export type Donation_Filter = { - /** Filter for the block changed event. */ - _change_block: InputMaybe; - amount: InputMaybe; - amount_gt: InputMaybe; - amount_gte: InputMaybe; - amount_in: InputMaybe>; - amount_lt: InputMaybe; - amount_lte: InputMaybe; - amount_not: InputMaybe; - amount_not_in: InputMaybe>; - and: InputMaybe>>; + amount: InputMaybe; + amount_gt: InputMaybe; + amount_gte: InputMaybe; + amount_in: InputMaybe>; + amount_lt: InputMaybe; + amount_lte: InputMaybe; + amount_not: InputMaybe; + amount_not_in: InputMaybe>; + and: InputMaybe>>; + contributor: InputMaybe; + contributor_: InputMaybe; + contributor_contains: InputMaybe; + contributor_contains_nocase: InputMaybe; + contributor_ends_with: InputMaybe; + contributor_ends_with_nocase: InputMaybe; + contributor_gt: InputMaybe; + contributor_gte: InputMaybe; + contributor_in: InputMaybe>; + contributor_lt: InputMaybe; + contributor_lte: InputMaybe; + contributor_not: InputMaybe; + contributor_not_contains: InputMaybe; + contributor_not_contains_nocase: InputMaybe; + contributor_not_ends_with: InputMaybe; + contributor_not_ends_with_nocase: InputMaybe; + contributor_not_in: InputMaybe>; + contributor_not_starts_with: InputMaybe; + contributor_not_starts_with_nocase: InputMaybe; + contributor_starts_with: InputMaybe; + contributor_starts_with_nocase: InputMaybe; createdAt: InputMaybe; createdAt_contains: InputMaybe; createdAt_contains_nocase: InputMaybe; @@ -658,34 +556,32 @@ export type Donation_Filter = { id_lte: InputMaybe; id_not: InputMaybe; id_not_in: InputMaybe>; - or: InputMaybe>>; - recipient: InputMaybe; - recipient_contains: InputMaybe; - recipient_gt: InputMaybe; - recipient_gte: InputMaybe; - recipient_in: InputMaybe>; - recipient_lt: InputMaybe; - recipient_lte: InputMaybe; - recipient_not: InputMaybe; - recipient_not_contains: InputMaybe; - recipient_not_in: InputMaybe>; - voteOptionIndex: InputMaybe; - voteOptionIndex_gt: InputMaybe; - voteOptionIndex_gte: InputMaybe; - voteOptionIndex_in: InputMaybe>; - voteOptionIndex_lt: InputMaybe; - voteOptionIndex_lte: InputMaybe; - voteOptionIndex_not: InputMaybe; - voteOptionIndex_not_in: InputMaybe>; + or: InputMaybe>>; + voiceCredits: InputMaybe; + voiceCredits_gt: InputMaybe; + voiceCredits_gte: InputMaybe; + voiceCredits_in: InputMaybe>; + voiceCredits_lt: InputMaybe; + voiceCredits_lte: InputMaybe; + voiceCredits_not: InputMaybe; + voiceCredits_not_in: InputMaybe>; }; -export enum Donation_OrderBy { +export enum Contribution_OrderBy { Amount = 'amount', + Contributor = 'contributor', + ContributorContributorAddress = 'contributor__contributorAddress', + ContributorCreatedAt = 'contributor__createdAt', + ContributorId = 'contributor__id', + ContributorLastUpdatedAt = 'contributor__lastUpdatedAt', + ContributorVerifiedTimeStamp = 'contributor__verifiedTimeStamp', CreatedAt = 'createdAt', FundingRound = 'fundingRound', FundingRoundContributorCount = 'fundingRound__contributorCount', FundingRoundContributorRegistryAddress = 'fundingRound__contributorRegistryAddress', FundingRoundCoordinator = 'fundingRound__coordinator', + FundingRoundCoordinatorPubKeyX = 'fundingRound__coordinatorPubKeyX', + FundingRoundCoordinatorPubKeyY = 'fundingRound__coordinatorPubKeyY', FundingRoundCreatedAt = 'fundingRound__createdAt', FundingRoundId = 'fundingRound__id', FundingRoundIsCancelled = 'fundingRound__isCancelled', @@ -693,56 +589,39 @@ export enum Donation_OrderBy { FundingRoundLastUpdatedAt = 'fundingRound__lastUpdatedAt', FundingRoundMaci = 'fundingRound__maci', FundingRoundMatchingPoolSize = 'fundingRound__matchingPoolSize', + FundingRoundMessageTreeDepth = 'fundingRound__messageTreeDepth', FundingRoundNativeToken = 'fundingRound__nativeToken', + FundingRoundPollAddress = 'fundingRound__pollAddress', FundingRoundRecipientCount = 'fundingRound__recipientCount', FundingRoundRecipientRegistryAddress = 'fundingRound__recipientRegistryAddress', FundingRoundSignUpDeadline = 'fundingRound__signUpDeadline', FundingRoundStartTime = 'fundingRound__startTime', + FundingRoundStateTreeDepth = 'fundingRound__stateTreeDepth', FundingRoundTallyHash = 'fundingRound__tallyHash', FundingRoundTotalSpent = 'fundingRound__totalSpent', FundingRoundTotalVotes = 'fundingRound__totalVotes', FundingRoundVoiceCreditFactor = 'fundingRound__voiceCreditFactor', + FundingRoundVoteOptionTreeDepth = 'fundingRound__voteOptionTreeDepth', FundingRoundVotingDeadline = 'fundingRound__votingDeadline', Id = 'id', - Recipient = 'recipient', - VoteOptionIndex = 'voteOptionIndex' + VoiceCredits = 'voiceCredits' } -export type FundingRound = { - __typename?: 'FundingRound'; +export type Contributor = { + __typename?: 'Contributor'; contributions: Maybe>; - contributorCount: Scalars['BigInt']; - contributorRegistry: Maybe; - contributorRegistryAddress: Maybe; - contributors: Maybe>; - coordinator: Maybe; + contributorAddress: Maybe; + contributorRegistry: ContributorRegistry; createdAt: Maybe; - fundingRoundFactory: Maybe; + fundingRounds: Maybe>; id: Scalars['ID']; - isCancelled: Maybe; - isFinalized: Maybe; lastUpdatedAt: Maybe; - maci: Maybe; - matchingPoolSize: Maybe; - messages: Maybe>; - nativeToken: Maybe; - nativeTokenInfo: Maybe; - recipientCount: Scalars['BigInt']; - recipientRegistry: Maybe; - recipientRegistryAddress: Maybe; - recipients: Maybe>; - signUpDeadline: Maybe; - startTime: Maybe; - tallyHash: Maybe; - totalSpent: Maybe; - totalVotes: Maybe; - voiceCreditFactor: Maybe; + verifiedTimeStamp: Maybe; votes: Maybe>; - votingDeadline: Maybe; }; -export type FundingRoundContributionsArgs = { +export type ContributorContributionsArgs = { first?: InputMaybe; orderBy: InputMaybe; orderDirection: InputMaybe; @@ -751,34 +630,16 @@ export type FundingRoundContributionsArgs = { }; -export type FundingRoundContributorsArgs = { - first?: InputMaybe; - orderBy: InputMaybe; - orderDirection: InputMaybe; - skip?: InputMaybe; - where: InputMaybe; -}; - - -export type FundingRoundMessagesArgs = { - first?: InputMaybe; - orderBy: InputMaybe; - orderDirection: InputMaybe; - skip?: InputMaybe; - where: InputMaybe; -}; - - -export type FundingRoundRecipientsArgs = { +export type ContributorFundingRoundsArgs = { first?: InputMaybe; - orderBy: InputMaybe; + orderBy: InputMaybe; orderDirection: InputMaybe; skip?: InputMaybe; - where: InputMaybe; + where: InputMaybe; }; -export type FundingRoundVotesArgs = { +export type ContributorVotesArgs = { first?: InputMaybe; orderBy: InputMaybe; orderDirection: InputMaybe; @@ -786,121 +647,72 @@ export type FundingRoundVotesArgs = { where: InputMaybe; }; -export type FundingRoundFactory = { - __typename?: 'FundingRoundFactory'; - batchUstVerifier: Maybe; - contributorRegistry: Maybe; - contributorRegistryAddress: Maybe; - coordinator: Maybe; - coordinatorPubKey: Maybe; +export type ContributorRegistry = { + __typename?: 'ContributorRegistry'; + clrFund: ClrFund; + context: Maybe; + contributors: Maybe>; createdAt: Maybe; - currentRound: Maybe; - fundingRounds: Maybe>; id: Scalars['ID']; lastUpdatedAt: Maybe; - maciFactory: Maybe; - maxMessages: Maybe; - maxUsers: Maybe; - maxVoteOptions: Maybe; - messageBatchSize: Maybe; - messageTreeDepth: Maybe; - nativeToken: Maybe; - nativeTokenInfo: Maybe; owner: Maybe; - qvtVerifier: Maybe; - recipientRegistry: Maybe; - recipientRegistryAddress: Maybe; - signUpDuration: Maybe; - stateTreeDepth: Maybe; - tallyBatchSize: Maybe; - voteOptionTreeDepth: Maybe; - votingDuration: Maybe; }; -export type FundingRoundFactoryFundingRoundsArgs = { +export type ContributorRegistryContributorsArgs = { first?: InputMaybe; - orderBy: InputMaybe; + orderBy: InputMaybe; orderDirection: InputMaybe; skip?: InputMaybe; - where: InputMaybe; + where: InputMaybe; }; -export type FundingRoundFactory_Filter = { +export type ContributorRegistry_Filter = { /** Filter for the block changed event. */ _change_block: InputMaybe; - and: InputMaybe>>; - batchUstVerifier: InputMaybe; - batchUstVerifier_contains: InputMaybe; - batchUstVerifier_gt: InputMaybe; - batchUstVerifier_gte: InputMaybe; - batchUstVerifier_in: InputMaybe>; - batchUstVerifier_lt: InputMaybe; - batchUstVerifier_lte: InputMaybe; - batchUstVerifier_not: InputMaybe; - batchUstVerifier_not_contains: InputMaybe; - batchUstVerifier_not_in: InputMaybe>; - contributorRegistry: InputMaybe; - contributorRegistryAddress: InputMaybe; - contributorRegistryAddress_contains: InputMaybe; - contributorRegistryAddress_gt: InputMaybe; - contributorRegistryAddress_gte: InputMaybe; - contributorRegistryAddress_in: InputMaybe>; - contributorRegistryAddress_lt: InputMaybe; - contributorRegistryAddress_lte: InputMaybe; - contributorRegistryAddress_not: InputMaybe; - contributorRegistryAddress_not_contains: InputMaybe; - contributorRegistryAddress_not_in: InputMaybe>; - contributorRegistry_: InputMaybe; - contributorRegistry_contains: InputMaybe; - contributorRegistry_contains_nocase: InputMaybe; - contributorRegistry_ends_with: InputMaybe; - contributorRegistry_ends_with_nocase: InputMaybe; - contributorRegistry_gt: InputMaybe; - contributorRegistry_gte: InputMaybe; - contributorRegistry_in: InputMaybe>; - contributorRegistry_lt: InputMaybe; - contributorRegistry_lte: InputMaybe; - contributorRegistry_not: InputMaybe; - contributorRegistry_not_contains: InputMaybe; - contributorRegistry_not_contains_nocase: InputMaybe; - contributorRegistry_not_ends_with: InputMaybe; - contributorRegistry_not_ends_with_nocase: InputMaybe; - contributorRegistry_not_in: InputMaybe>; - contributorRegistry_not_starts_with: InputMaybe; - contributorRegistry_not_starts_with_nocase: InputMaybe; - contributorRegistry_starts_with: InputMaybe; - contributorRegistry_starts_with_nocase: InputMaybe; - coordinator: InputMaybe; - coordinatorPubKey: InputMaybe; - coordinatorPubKey_contains: InputMaybe; - coordinatorPubKey_contains_nocase: InputMaybe; - coordinatorPubKey_ends_with: InputMaybe; - coordinatorPubKey_ends_with_nocase: InputMaybe; - coordinatorPubKey_gt: InputMaybe; - coordinatorPubKey_gte: InputMaybe; - coordinatorPubKey_in: InputMaybe>; - coordinatorPubKey_lt: InputMaybe; - coordinatorPubKey_lte: InputMaybe; - coordinatorPubKey_not: InputMaybe; - coordinatorPubKey_not_contains: InputMaybe; - coordinatorPubKey_not_contains_nocase: InputMaybe; - coordinatorPubKey_not_ends_with: InputMaybe; - coordinatorPubKey_not_ends_with_nocase: InputMaybe; - coordinatorPubKey_not_in: InputMaybe>; - coordinatorPubKey_not_starts_with: InputMaybe; - coordinatorPubKey_not_starts_with_nocase: InputMaybe; - coordinatorPubKey_starts_with: InputMaybe; - coordinatorPubKey_starts_with_nocase: InputMaybe; - coordinator_contains: InputMaybe; - coordinator_gt: InputMaybe; - coordinator_gte: InputMaybe; - coordinator_in: InputMaybe>; - coordinator_lt: InputMaybe; - coordinator_lte: InputMaybe; - coordinator_not: InputMaybe; - coordinator_not_contains: InputMaybe; - coordinator_not_in: InputMaybe>; + and: InputMaybe>>; + clrFund: InputMaybe; + clrFund_: InputMaybe; + clrFund_contains: InputMaybe; + clrFund_contains_nocase: InputMaybe; + clrFund_ends_with: InputMaybe; + clrFund_ends_with_nocase: InputMaybe; + clrFund_gt: InputMaybe; + clrFund_gte: InputMaybe; + clrFund_in: InputMaybe>; + clrFund_lt: InputMaybe; + clrFund_lte: InputMaybe; + clrFund_not: InputMaybe; + clrFund_not_contains: InputMaybe; + clrFund_not_contains_nocase: InputMaybe; + clrFund_not_ends_with: InputMaybe; + clrFund_not_ends_with_nocase: InputMaybe; + clrFund_not_in: InputMaybe>; + clrFund_not_starts_with: InputMaybe; + clrFund_not_starts_with_nocase: InputMaybe; + clrFund_starts_with: InputMaybe; + clrFund_starts_with_nocase: InputMaybe; + context: InputMaybe; + context_contains: InputMaybe; + context_contains_nocase: InputMaybe; + context_ends_with: InputMaybe; + context_ends_with_nocase: InputMaybe; + context_gt: InputMaybe; + context_gte: InputMaybe; + context_in: InputMaybe>; + context_lt: InputMaybe; + context_lte: InputMaybe; + context_not: InputMaybe; + context_not_contains: InputMaybe; + context_not_contains_nocase: InputMaybe; + context_not_ends_with: InputMaybe; + context_not_ends_with_nocase: InputMaybe; + context_not_in: InputMaybe>; + context_not_starts_with: InputMaybe; + context_not_starts_with_nocase: InputMaybe; + context_starts_with: InputMaybe; + context_starts_with_nocase: InputMaybe; + contributors_: InputMaybe; createdAt: InputMaybe; createdAt_contains: InputMaybe; createdAt_contains_nocase: InputMaybe; @@ -921,28 +733,6 @@ export type FundingRoundFactory_Filter = { createdAt_not_starts_with_nocase: InputMaybe; createdAt_starts_with: InputMaybe; createdAt_starts_with_nocase: InputMaybe; - currentRound: InputMaybe; - currentRound_: InputMaybe; - currentRound_contains: InputMaybe; - currentRound_contains_nocase: InputMaybe; - currentRound_ends_with: InputMaybe; - currentRound_ends_with_nocase: InputMaybe; - currentRound_gt: InputMaybe; - currentRound_gte: InputMaybe; - currentRound_in: InputMaybe>; - currentRound_lt: InputMaybe; - currentRound_lte: InputMaybe; - currentRound_not: InputMaybe; - currentRound_not_contains: InputMaybe; - currentRound_not_contains_nocase: InputMaybe; - currentRound_not_ends_with: InputMaybe; - currentRound_not_ends_with_nocase: InputMaybe; - currentRound_not_in: InputMaybe>; - currentRound_not_starts_with: InputMaybe; - currentRound_not_starts_with_nocase: InputMaybe; - currentRound_starts_with: InputMaybe; - currentRound_starts_with_nocase: InputMaybe; - fundingRounds_: InputMaybe; id: InputMaybe; id_gt: InputMaybe; id_gte: InputMaybe; @@ -971,88 +761,7 @@ export type FundingRoundFactory_Filter = { lastUpdatedAt_not_starts_with_nocase: InputMaybe; lastUpdatedAt_starts_with: InputMaybe; lastUpdatedAt_starts_with_nocase: InputMaybe; - maciFactory: InputMaybe; - maciFactory_contains: InputMaybe; - maciFactory_gt: InputMaybe; - maciFactory_gte: InputMaybe; - maciFactory_in: InputMaybe>; - maciFactory_lt: InputMaybe; - maciFactory_lte: InputMaybe; - maciFactory_not: InputMaybe; - maciFactory_not_contains: InputMaybe; - maciFactory_not_in: InputMaybe>; - maxMessages: InputMaybe; - maxMessages_gt: InputMaybe; - maxMessages_gte: InputMaybe; - maxMessages_in: InputMaybe>; - maxMessages_lt: InputMaybe; - maxMessages_lte: InputMaybe; - maxMessages_not: InputMaybe; - maxMessages_not_in: InputMaybe>; - maxUsers: InputMaybe; - maxUsers_gt: InputMaybe; - maxUsers_gte: InputMaybe; - maxUsers_in: InputMaybe>; - maxUsers_lt: InputMaybe; - maxUsers_lte: InputMaybe; - maxUsers_not: InputMaybe; - maxUsers_not_in: InputMaybe>; - maxVoteOptions: InputMaybe; - maxVoteOptions_gt: InputMaybe; - maxVoteOptions_gte: InputMaybe; - maxVoteOptions_in: InputMaybe>; - maxVoteOptions_lt: InputMaybe; - maxVoteOptions_lte: InputMaybe; - maxVoteOptions_not: InputMaybe; - maxVoteOptions_not_in: InputMaybe>; - messageBatchSize: InputMaybe; - messageBatchSize_gt: InputMaybe; - messageBatchSize_gte: InputMaybe; - messageBatchSize_in: InputMaybe>; - messageBatchSize_lt: InputMaybe; - messageBatchSize_lte: InputMaybe; - messageBatchSize_not: InputMaybe; - messageBatchSize_not_in: InputMaybe>; - messageTreeDepth: InputMaybe; - messageTreeDepth_gt: InputMaybe; - messageTreeDepth_gte: InputMaybe; - messageTreeDepth_in: InputMaybe>; - messageTreeDepth_lt: InputMaybe; - messageTreeDepth_lte: InputMaybe; - messageTreeDepth_not: InputMaybe; - messageTreeDepth_not_in: InputMaybe>; - nativeToken: InputMaybe; - nativeTokenInfo: InputMaybe; - nativeTokenInfo_: InputMaybe; - nativeTokenInfo_contains: InputMaybe; - nativeTokenInfo_contains_nocase: InputMaybe; - nativeTokenInfo_ends_with: InputMaybe; - nativeTokenInfo_ends_with_nocase: InputMaybe; - nativeTokenInfo_gt: InputMaybe; - nativeTokenInfo_gte: InputMaybe; - nativeTokenInfo_in: InputMaybe>; - nativeTokenInfo_lt: InputMaybe; - nativeTokenInfo_lte: InputMaybe; - nativeTokenInfo_not: InputMaybe; - nativeTokenInfo_not_contains: InputMaybe; - nativeTokenInfo_not_contains_nocase: InputMaybe; - nativeTokenInfo_not_ends_with: InputMaybe; - nativeTokenInfo_not_ends_with_nocase: InputMaybe; - nativeTokenInfo_not_in: InputMaybe>; - nativeTokenInfo_not_starts_with: InputMaybe; - nativeTokenInfo_not_starts_with_nocase: InputMaybe; - nativeTokenInfo_starts_with: InputMaybe; - nativeTokenInfo_starts_with_nocase: InputMaybe; - nativeToken_contains: InputMaybe; - nativeToken_gt: InputMaybe; - nativeToken_gte: InputMaybe; - nativeToken_in: InputMaybe>; - nativeToken_lt: InputMaybe; - nativeToken_lte: InputMaybe; - nativeToken_not: InputMaybe; - nativeToken_not_contains: InputMaybe; - nativeToken_not_in: InputMaybe>; - or: InputMaybe>>; + or: InputMaybe>>; owner: InputMaybe; owner_contains: InputMaybe; owner_gt: InputMaybe; @@ -1063,162 +772,498 @@ export type FundingRoundFactory_Filter = { owner_not: InputMaybe; owner_not_contains: InputMaybe; owner_not_in: InputMaybe>; - qvtVerifier: InputMaybe; - qvtVerifier_contains: InputMaybe; - qvtVerifier_gt: InputMaybe; - qvtVerifier_gte: InputMaybe; - qvtVerifier_in: InputMaybe>; - qvtVerifier_lt: InputMaybe; - qvtVerifier_lte: InputMaybe; - qvtVerifier_not: InputMaybe; - qvtVerifier_not_contains: InputMaybe; - qvtVerifier_not_in: InputMaybe>; - recipientRegistry: InputMaybe; - recipientRegistryAddress: InputMaybe; - recipientRegistryAddress_contains: InputMaybe; - recipientRegistryAddress_gt: InputMaybe; - recipientRegistryAddress_gte: InputMaybe; - recipientRegistryAddress_in: InputMaybe>; - recipientRegistryAddress_lt: InputMaybe; - recipientRegistryAddress_lte: InputMaybe; - recipientRegistryAddress_not: InputMaybe; - recipientRegistryAddress_not_contains: InputMaybe; - recipientRegistryAddress_not_in: InputMaybe>; - recipientRegistry_: InputMaybe; - recipientRegistry_contains: InputMaybe; - recipientRegistry_contains_nocase: InputMaybe; - recipientRegistry_ends_with: InputMaybe; - recipientRegistry_ends_with_nocase: InputMaybe; - recipientRegistry_gt: InputMaybe; - recipientRegistry_gte: InputMaybe; - recipientRegistry_in: InputMaybe>; - recipientRegistry_lt: InputMaybe; - recipientRegistry_lte: InputMaybe; - recipientRegistry_not: InputMaybe; - recipientRegistry_not_contains: InputMaybe; - recipientRegistry_not_contains_nocase: InputMaybe; - recipientRegistry_not_ends_with: InputMaybe; - recipientRegistry_not_ends_with_nocase: InputMaybe; - recipientRegistry_not_in: InputMaybe>; - recipientRegistry_not_starts_with: InputMaybe; - recipientRegistry_not_starts_with_nocase: InputMaybe; - recipientRegistry_starts_with: InputMaybe; - recipientRegistry_starts_with_nocase: InputMaybe; - signUpDuration: InputMaybe; - signUpDuration_gt: InputMaybe; - signUpDuration_gte: InputMaybe; - signUpDuration_in: InputMaybe>; - signUpDuration_lt: InputMaybe; - signUpDuration_lte: InputMaybe; - signUpDuration_not: InputMaybe; - signUpDuration_not_in: InputMaybe>; - stateTreeDepth: InputMaybe; - stateTreeDepth_gt: InputMaybe; - stateTreeDepth_gte: InputMaybe; - stateTreeDepth_in: InputMaybe>; - stateTreeDepth_lt: InputMaybe; - stateTreeDepth_lte: InputMaybe; - stateTreeDepth_not: InputMaybe; - stateTreeDepth_not_in: InputMaybe>; - tallyBatchSize: InputMaybe; - tallyBatchSize_gt: InputMaybe; - tallyBatchSize_gte: InputMaybe; - tallyBatchSize_in: InputMaybe>; - tallyBatchSize_lt: InputMaybe; - tallyBatchSize_lte: InputMaybe; - tallyBatchSize_not: InputMaybe; - tallyBatchSize_not_in: InputMaybe>; - voteOptionTreeDepth: InputMaybe; - voteOptionTreeDepth_gt: InputMaybe; - voteOptionTreeDepth_gte: InputMaybe; - voteOptionTreeDepth_in: InputMaybe>; - voteOptionTreeDepth_lt: InputMaybe; - voteOptionTreeDepth_lte: InputMaybe; - voteOptionTreeDepth_not: InputMaybe; - voteOptionTreeDepth_not_in: InputMaybe>; - votingDuration: InputMaybe; - votingDuration_gt: InputMaybe; - votingDuration_gte: InputMaybe; - votingDuration_in: InputMaybe>; - votingDuration_lt: InputMaybe; - votingDuration_lte: InputMaybe; - votingDuration_not: InputMaybe; - votingDuration_not_in: InputMaybe>; }; -export enum FundingRoundFactory_OrderBy { - BatchUstVerifier = 'batchUstVerifier', - ContributorRegistry = 'contributorRegistry', - ContributorRegistryAddress = 'contributorRegistryAddress', - ContributorRegistryContext = 'contributorRegistry__context', - ContributorRegistryCreatedAt = 'contributorRegistry__createdAt', - ContributorRegistryId = 'contributorRegistry__id', - ContributorRegistryLastUpdatedAt = 'contributorRegistry__lastUpdatedAt', - ContributorRegistryOwner = 'contributorRegistry__owner', - Coordinator = 'coordinator', - CoordinatorPubKey = 'coordinatorPubKey', +export enum ContributorRegistry_OrderBy { + ClrFund = 'clrFund', + ClrFundBatchUstVerifier = 'clrFund__batchUstVerifier', + ClrFundContributorRegistryAddress = 'clrFund__contributorRegistryAddress', + ClrFundCoordinator = 'clrFund__coordinator', + ClrFundCoordinatorPubKey = 'clrFund__coordinatorPubKey', + ClrFundCreatedAt = 'clrFund__createdAt', + ClrFundId = 'clrFund__id', + ClrFundLastUpdatedAt = 'clrFund__lastUpdatedAt', + ClrFundMaciFactory = 'clrFund__maciFactory', + ClrFundMaxMessages = 'clrFund__maxMessages', + ClrFundMaxUsers = 'clrFund__maxUsers', + ClrFundMaxVoteOptions = 'clrFund__maxVoteOptions', + ClrFundMessageBatchSize = 'clrFund__messageBatchSize', + ClrFundMessageTreeDepth = 'clrFund__messageTreeDepth', + ClrFundNativeToken = 'clrFund__nativeToken', + ClrFundOwner = 'clrFund__owner', + ClrFundQvtVerifier = 'clrFund__qvtVerifier', + ClrFundRecipientRegistryAddress = 'clrFund__recipientRegistryAddress', + ClrFundSignUpDuration = 'clrFund__signUpDuration', + ClrFundStateTreeDepth = 'clrFund__stateTreeDepth', + ClrFundTallyBatchSize = 'clrFund__tallyBatchSize', + ClrFundVoteOptionTreeDepth = 'clrFund__voteOptionTreeDepth', + ClrFundVotingDuration = 'clrFund__votingDuration', + Context = 'context', + Contributors = 'contributors', + CreatedAt = 'createdAt', + Id = 'id', + LastUpdatedAt = 'lastUpdatedAt', + Owner = 'owner' +} + +export type Contributor_Filter = { + /** Filter for the block changed event. */ + _change_block: InputMaybe; + and: InputMaybe>>; + contributions_: InputMaybe; + contributorAddress: InputMaybe; + contributorAddress_contains: InputMaybe; + contributorAddress_gt: InputMaybe; + contributorAddress_gte: InputMaybe; + contributorAddress_in: InputMaybe>; + contributorAddress_lt: InputMaybe; + contributorAddress_lte: InputMaybe; + contributorAddress_not: InputMaybe; + contributorAddress_not_contains: InputMaybe; + contributorAddress_not_in: InputMaybe>; + contributorRegistry: InputMaybe; + contributorRegistry_: InputMaybe; + contributorRegistry_contains: InputMaybe; + contributorRegistry_contains_nocase: InputMaybe; + contributorRegistry_ends_with: InputMaybe; + contributorRegistry_ends_with_nocase: InputMaybe; + contributorRegistry_gt: InputMaybe; + contributorRegistry_gte: InputMaybe; + contributorRegistry_in: InputMaybe>; + contributorRegistry_lt: InputMaybe; + contributorRegistry_lte: InputMaybe; + contributorRegistry_not: InputMaybe; + contributorRegistry_not_contains: InputMaybe; + contributorRegistry_not_contains_nocase: InputMaybe; + contributorRegistry_not_ends_with: InputMaybe; + contributorRegistry_not_ends_with_nocase: InputMaybe; + contributorRegistry_not_in: InputMaybe>; + contributorRegistry_not_starts_with: InputMaybe; + contributorRegistry_not_starts_with_nocase: InputMaybe; + contributorRegistry_starts_with: InputMaybe; + contributorRegistry_starts_with_nocase: InputMaybe; + createdAt: InputMaybe; + createdAt_contains: InputMaybe; + createdAt_contains_nocase: InputMaybe; + createdAt_ends_with: InputMaybe; + createdAt_ends_with_nocase: InputMaybe; + createdAt_gt: InputMaybe; + createdAt_gte: InputMaybe; + createdAt_in: InputMaybe>; + createdAt_lt: InputMaybe; + createdAt_lte: InputMaybe; + createdAt_not: InputMaybe; + createdAt_not_contains: InputMaybe; + createdAt_not_contains_nocase: InputMaybe; + createdAt_not_ends_with: InputMaybe; + createdAt_not_ends_with_nocase: InputMaybe; + createdAt_not_in: InputMaybe>; + createdAt_not_starts_with: InputMaybe; + createdAt_not_starts_with_nocase: InputMaybe; + createdAt_starts_with: InputMaybe; + createdAt_starts_with_nocase: InputMaybe; + fundingRounds: InputMaybe>; + fundingRounds_: InputMaybe; + fundingRounds_contains: InputMaybe>; + fundingRounds_contains_nocase: InputMaybe>; + fundingRounds_not: InputMaybe>; + fundingRounds_not_contains: InputMaybe>; + fundingRounds_not_contains_nocase: InputMaybe>; + id: InputMaybe; + id_gt: InputMaybe; + id_gte: InputMaybe; + id_in: InputMaybe>; + id_lt: InputMaybe; + id_lte: InputMaybe; + id_not: InputMaybe; + id_not_in: InputMaybe>; + lastUpdatedAt: InputMaybe; + lastUpdatedAt_contains: InputMaybe; + lastUpdatedAt_contains_nocase: InputMaybe; + lastUpdatedAt_ends_with: InputMaybe; + lastUpdatedAt_ends_with_nocase: InputMaybe; + lastUpdatedAt_gt: InputMaybe; + lastUpdatedAt_gte: InputMaybe; + lastUpdatedAt_in: InputMaybe>; + lastUpdatedAt_lt: InputMaybe; + lastUpdatedAt_lte: InputMaybe; + lastUpdatedAt_not: InputMaybe; + lastUpdatedAt_not_contains: InputMaybe; + lastUpdatedAt_not_contains_nocase: InputMaybe; + lastUpdatedAt_not_ends_with: InputMaybe; + lastUpdatedAt_not_ends_with_nocase: InputMaybe; + lastUpdatedAt_not_in: InputMaybe>; + lastUpdatedAt_not_starts_with: InputMaybe; + lastUpdatedAt_not_starts_with_nocase: InputMaybe; + lastUpdatedAt_starts_with: InputMaybe; + lastUpdatedAt_starts_with_nocase: InputMaybe; + or: InputMaybe>>; + verifiedTimeStamp: InputMaybe; + verifiedTimeStamp_contains: InputMaybe; + verifiedTimeStamp_contains_nocase: InputMaybe; + verifiedTimeStamp_ends_with: InputMaybe; + verifiedTimeStamp_ends_with_nocase: InputMaybe; + verifiedTimeStamp_gt: InputMaybe; + verifiedTimeStamp_gte: InputMaybe; + verifiedTimeStamp_in: InputMaybe>; + verifiedTimeStamp_lt: InputMaybe; + verifiedTimeStamp_lte: InputMaybe; + verifiedTimeStamp_not: InputMaybe; + verifiedTimeStamp_not_contains: InputMaybe; + verifiedTimeStamp_not_contains_nocase: InputMaybe; + verifiedTimeStamp_not_ends_with: InputMaybe; + verifiedTimeStamp_not_ends_with_nocase: InputMaybe; + verifiedTimeStamp_not_in: InputMaybe>; + verifiedTimeStamp_not_starts_with: InputMaybe; + verifiedTimeStamp_not_starts_with_nocase: InputMaybe; + verifiedTimeStamp_starts_with: InputMaybe; + verifiedTimeStamp_starts_with_nocase: InputMaybe; + votes_: InputMaybe; +}; + +export enum Contributor_OrderBy { + Contributions = 'contributions', + ContributorAddress = 'contributorAddress', + ContributorRegistry = 'contributorRegistry', + ContributorRegistryContext = 'contributorRegistry__context', + ContributorRegistryCreatedAt = 'contributorRegistry__createdAt', + ContributorRegistryId = 'contributorRegistry__id', + ContributorRegistryLastUpdatedAt = 'contributorRegistry__lastUpdatedAt', + ContributorRegistryOwner = 'contributorRegistry__owner', + CreatedAt = 'createdAt', + FundingRounds = 'fundingRounds', + Id = 'id', + LastUpdatedAt = 'lastUpdatedAt', + VerifiedTimeStamp = 'verifiedTimeStamp', + Votes = 'votes' +} + +export type Coordinator = { + __typename?: 'Coordinator'; + contact: Maybe; + createdAt: Maybe; + id: Scalars['ID']; + lastUpdatedAt: Maybe; +}; + +export type Coordinator_Filter = { + /** Filter for the block changed event. */ + _change_block: InputMaybe; + and: InputMaybe>>; + contact: InputMaybe; + contact_contains: InputMaybe; + contact_contains_nocase: InputMaybe; + contact_ends_with: InputMaybe; + contact_ends_with_nocase: InputMaybe; + contact_gt: InputMaybe; + contact_gte: InputMaybe; + contact_in: InputMaybe>; + contact_lt: InputMaybe; + contact_lte: InputMaybe; + contact_not: InputMaybe; + contact_not_contains: InputMaybe; + contact_not_contains_nocase: InputMaybe; + contact_not_ends_with: InputMaybe; + contact_not_ends_with_nocase: InputMaybe; + contact_not_in: InputMaybe>; + contact_not_starts_with: InputMaybe; + contact_not_starts_with_nocase: InputMaybe; + contact_starts_with: InputMaybe; + contact_starts_with_nocase: InputMaybe; + createdAt: InputMaybe; + createdAt_contains: InputMaybe; + createdAt_contains_nocase: InputMaybe; + createdAt_ends_with: InputMaybe; + createdAt_ends_with_nocase: InputMaybe; + createdAt_gt: InputMaybe; + createdAt_gte: InputMaybe; + createdAt_in: InputMaybe>; + createdAt_lt: InputMaybe; + createdAt_lte: InputMaybe; + createdAt_not: InputMaybe; + createdAt_not_contains: InputMaybe; + createdAt_not_contains_nocase: InputMaybe; + createdAt_not_ends_with: InputMaybe; + createdAt_not_ends_with_nocase: InputMaybe; + createdAt_not_in: InputMaybe>; + createdAt_not_starts_with: InputMaybe; + createdAt_not_starts_with_nocase: InputMaybe; + createdAt_starts_with: InputMaybe; + createdAt_starts_with_nocase: InputMaybe; + id: InputMaybe; + id_gt: InputMaybe; + id_gte: InputMaybe; + id_in: InputMaybe>; + id_lt: InputMaybe; + id_lte: InputMaybe; + id_not: InputMaybe; + id_not_in: InputMaybe>; + lastUpdatedAt: InputMaybe; + lastUpdatedAt_contains: InputMaybe; + lastUpdatedAt_contains_nocase: InputMaybe; + lastUpdatedAt_ends_with: InputMaybe; + lastUpdatedAt_ends_with_nocase: InputMaybe; + lastUpdatedAt_gt: InputMaybe; + lastUpdatedAt_gte: InputMaybe; + lastUpdatedAt_in: InputMaybe>; + lastUpdatedAt_lt: InputMaybe; + lastUpdatedAt_lte: InputMaybe; + lastUpdatedAt_not: InputMaybe; + lastUpdatedAt_not_contains: InputMaybe; + lastUpdatedAt_not_contains_nocase: InputMaybe; + lastUpdatedAt_not_ends_with: InputMaybe; + lastUpdatedAt_not_ends_with_nocase: InputMaybe; + lastUpdatedAt_not_in: InputMaybe>; + lastUpdatedAt_not_starts_with: InputMaybe; + lastUpdatedAt_not_starts_with_nocase: InputMaybe; + lastUpdatedAt_starts_with: InputMaybe; + lastUpdatedAt_starts_with_nocase: InputMaybe; + or: InputMaybe>>; +}; + +export enum Coordinator_OrderBy { + Contact = 'contact', + CreatedAt = 'createdAt', + Id = 'id', + LastUpdatedAt = 'lastUpdatedAt' +} + +export type Donation = { + __typename?: 'Donation'; + amount: Maybe; + createdAt: Maybe; + fundingRound: Maybe; + id: Scalars['ID']; + recipient: Maybe; + voteOptionIndex: Maybe; +}; + +export type Donation_Filter = { + /** Filter for the block changed event. */ + _change_block: InputMaybe; + amount: InputMaybe; + amount_gt: InputMaybe; + amount_gte: InputMaybe; + amount_in: InputMaybe>; + amount_lt: InputMaybe; + amount_lte: InputMaybe; + amount_not: InputMaybe; + amount_not_in: InputMaybe>; + and: InputMaybe>>; + createdAt: InputMaybe; + createdAt_contains: InputMaybe; + createdAt_contains_nocase: InputMaybe; + createdAt_ends_with: InputMaybe; + createdAt_ends_with_nocase: InputMaybe; + createdAt_gt: InputMaybe; + createdAt_gte: InputMaybe; + createdAt_in: InputMaybe>; + createdAt_lt: InputMaybe; + createdAt_lte: InputMaybe; + createdAt_not: InputMaybe; + createdAt_not_contains: InputMaybe; + createdAt_not_contains_nocase: InputMaybe; + createdAt_not_ends_with: InputMaybe; + createdAt_not_ends_with_nocase: InputMaybe; + createdAt_not_in: InputMaybe>; + createdAt_not_starts_with: InputMaybe; + createdAt_not_starts_with_nocase: InputMaybe; + createdAt_starts_with: InputMaybe; + createdAt_starts_with_nocase: InputMaybe; + fundingRound: InputMaybe; + fundingRound_: InputMaybe; + fundingRound_contains: InputMaybe; + fundingRound_contains_nocase: InputMaybe; + fundingRound_ends_with: InputMaybe; + fundingRound_ends_with_nocase: InputMaybe; + fundingRound_gt: InputMaybe; + fundingRound_gte: InputMaybe; + fundingRound_in: InputMaybe>; + fundingRound_lt: InputMaybe; + fundingRound_lte: InputMaybe; + fundingRound_not: InputMaybe; + fundingRound_not_contains: InputMaybe; + fundingRound_not_contains_nocase: InputMaybe; + fundingRound_not_ends_with: InputMaybe; + fundingRound_not_ends_with_nocase: InputMaybe; + fundingRound_not_in: InputMaybe>; + fundingRound_not_starts_with: InputMaybe; + fundingRound_not_starts_with_nocase: InputMaybe; + fundingRound_starts_with: InputMaybe; + fundingRound_starts_with_nocase: InputMaybe; + id: InputMaybe; + id_gt: InputMaybe; + id_gte: InputMaybe; + id_in: InputMaybe>; + id_lt: InputMaybe; + id_lte: InputMaybe; + id_not: InputMaybe; + id_not_in: InputMaybe>; + or: InputMaybe>>; + recipient: InputMaybe; + recipient_contains: InputMaybe; + recipient_gt: InputMaybe; + recipient_gte: InputMaybe; + recipient_in: InputMaybe>; + recipient_lt: InputMaybe; + recipient_lte: InputMaybe; + recipient_not: InputMaybe; + recipient_not_contains: InputMaybe; + recipient_not_in: InputMaybe>; + voteOptionIndex: InputMaybe; + voteOptionIndex_gt: InputMaybe; + voteOptionIndex_gte: InputMaybe; + voteOptionIndex_in: InputMaybe>; + voteOptionIndex_lt: InputMaybe; + voteOptionIndex_lte: InputMaybe; + voteOptionIndex_not: InputMaybe; + voteOptionIndex_not_in: InputMaybe>; +}; + +export enum Donation_OrderBy { + Amount = 'amount', CreatedAt = 'createdAt', - CurrentRound = 'currentRound', - CurrentRoundContributorCount = 'currentRound__contributorCount', - CurrentRoundContributorRegistryAddress = 'currentRound__contributorRegistryAddress', - CurrentRoundCoordinator = 'currentRound__coordinator', - CurrentRoundCreatedAt = 'currentRound__createdAt', - CurrentRoundId = 'currentRound__id', - CurrentRoundIsCancelled = 'currentRound__isCancelled', - CurrentRoundIsFinalized = 'currentRound__isFinalized', - CurrentRoundLastUpdatedAt = 'currentRound__lastUpdatedAt', - CurrentRoundMaci = 'currentRound__maci', - CurrentRoundMatchingPoolSize = 'currentRound__matchingPoolSize', - CurrentRoundNativeToken = 'currentRound__nativeToken', - CurrentRoundRecipientCount = 'currentRound__recipientCount', - CurrentRoundRecipientRegistryAddress = 'currentRound__recipientRegistryAddress', - CurrentRoundSignUpDeadline = 'currentRound__signUpDeadline', - CurrentRoundStartTime = 'currentRound__startTime', - CurrentRoundTallyHash = 'currentRound__tallyHash', - CurrentRoundTotalSpent = 'currentRound__totalSpent', - CurrentRoundTotalVotes = 'currentRound__totalVotes', - CurrentRoundVoiceCreditFactor = 'currentRound__voiceCreditFactor', - CurrentRoundVotingDeadline = 'currentRound__votingDeadline', - FundingRounds = 'fundingRounds', + FundingRound = 'fundingRound', + FundingRoundContributorCount = 'fundingRound__contributorCount', + FundingRoundContributorRegistryAddress = 'fundingRound__contributorRegistryAddress', + FundingRoundCoordinator = 'fundingRound__coordinator', + FundingRoundCoordinatorPubKeyX = 'fundingRound__coordinatorPubKeyX', + FundingRoundCoordinatorPubKeyY = 'fundingRound__coordinatorPubKeyY', + FundingRoundCreatedAt = 'fundingRound__createdAt', + FundingRoundId = 'fundingRound__id', + FundingRoundIsCancelled = 'fundingRound__isCancelled', + FundingRoundIsFinalized = 'fundingRound__isFinalized', + FundingRoundLastUpdatedAt = 'fundingRound__lastUpdatedAt', + FundingRoundMaci = 'fundingRound__maci', + FundingRoundMatchingPoolSize = 'fundingRound__matchingPoolSize', + FundingRoundMessageTreeDepth = 'fundingRound__messageTreeDepth', + FundingRoundNativeToken = 'fundingRound__nativeToken', + FundingRoundPollAddress = 'fundingRound__pollAddress', + FundingRoundRecipientCount = 'fundingRound__recipientCount', + FundingRoundRecipientRegistryAddress = 'fundingRound__recipientRegistryAddress', + FundingRoundSignUpDeadline = 'fundingRound__signUpDeadline', + FundingRoundStartTime = 'fundingRound__startTime', + FundingRoundStateTreeDepth = 'fundingRound__stateTreeDepth', + FundingRoundTallyHash = 'fundingRound__tallyHash', + FundingRoundTotalSpent = 'fundingRound__totalSpent', + FundingRoundTotalVotes = 'fundingRound__totalVotes', + FundingRoundVoiceCreditFactor = 'fundingRound__voiceCreditFactor', + FundingRoundVoteOptionTreeDepth = 'fundingRound__voteOptionTreeDepth', + FundingRoundVotingDeadline = 'fundingRound__votingDeadline', Id = 'id', - LastUpdatedAt = 'lastUpdatedAt', - MaciFactory = 'maciFactory', - MaxMessages = 'maxMessages', - MaxUsers = 'maxUsers', - MaxVoteOptions = 'maxVoteOptions', - MessageBatchSize = 'messageBatchSize', - MessageTreeDepth = 'messageTreeDepth', - NativeToken = 'nativeToken', - NativeTokenInfo = 'nativeTokenInfo', - NativeTokenInfoCreatedAt = 'nativeTokenInfo__createdAt', - NativeTokenInfoDecimals = 'nativeTokenInfo__decimals', - NativeTokenInfoId = 'nativeTokenInfo__id', - NativeTokenInfoLastUpdatedAt = 'nativeTokenInfo__lastUpdatedAt', - NativeTokenInfoSymbol = 'nativeTokenInfo__symbol', - NativeTokenInfoTokenAddress = 'nativeTokenInfo__tokenAddress', - Owner = 'owner', - QvtVerifier = 'qvtVerifier', - RecipientRegistry = 'recipientRegistry', - RecipientRegistryAddress = 'recipientRegistryAddress', - RecipientRegistryBaseDeposit = 'recipientRegistry__baseDeposit', - RecipientRegistryChallengePeriodDuration = 'recipientRegistry__challengePeriodDuration', - RecipientRegistryController = 'recipientRegistry__controller', - RecipientRegistryCreatedAt = 'recipientRegistry__createdAt', - RecipientRegistryId = 'recipientRegistry__id', - RecipientRegistryLastUpdatedAt = 'recipientRegistry__lastUpdatedAt', - RecipientRegistryMaxRecipients = 'recipientRegistry__maxRecipients', - RecipientRegistryOwner = 'recipientRegistry__owner', - SignUpDuration = 'signUpDuration', - StateTreeDepth = 'stateTreeDepth', - TallyBatchSize = 'tallyBatchSize', - VoteOptionTreeDepth = 'voteOptionTreeDepth', - VotingDuration = 'votingDuration' + Recipient = 'recipient', + VoteOptionIndex = 'voteOptionIndex' } +export type FundingRound = { + __typename?: 'FundingRound'; + clrFund: Maybe; + contributions: Maybe>; + contributorCount: Scalars['BigInt']; + contributorRegistry: Maybe; + contributorRegistryAddress: Maybe; + contributors: Maybe>; + coordinator: Maybe; + coordinatorPubKeyX: Maybe; + coordinatorPubKeyY: Maybe; + createdAt: Maybe; + id: Scalars['ID']; + isCancelled: Maybe; + isFinalized: Maybe; + lastUpdatedAt: Maybe; + maci: Maybe; + matchingPoolSize: Maybe; + messageTreeDepth: Maybe; + messages: Maybe>; + nativeToken: Maybe; + nativeTokenInfo: Maybe; + pollAddress: Maybe; + recipientCount: Scalars['BigInt']; + recipientRegistry: Maybe; + recipientRegistryAddress: Maybe; + recipients: Maybe>; + signUpDeadline: Maybe; + startTime: Maybe; + stateTreeDepth: Maybe; + tallyHash: Maybe; + totalSpent: Maybe; + totalVotes: Maybe; + voiceCreditFactor: Maybe; + voteOptionTreeDepth: Maybe; + votes: Maybe>; + votingDeadline: Maybe; +}; + + +export type FundingRoundContributionsArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + + +export type FundingRoundContributorsArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + + +export type FundingRoundMessagesArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + + +export type FundingRoundRecipientsArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + + +export type FundingRoundVotesArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + export type FundingRound_Filter = { /** Filter for the block changed event. */ _change_block: InputMaybe; and: InputMaybe>>; + clrFund: InputMaybe; + clrFund_: InputMaybe; + clrFund_contains: InputMaybe; + clrFund_contains_nocase: InputMaybe; + clrFund_ends_with: InputMaybe; + clrFund_ends_with_nocase: InputMaybe; + clrFund_gt: InputMaybe; + clrFund_gte: InputMaybe; + clrFund_in: InputMaybe>; + clrFund_lt: InputMaybe; + clrFund_lte: InputMaybe; + clrFund_not: InputMaybe; + clrFund_not_contains: InputMaybe; + clrFund_not_contains_nocase: InputMaybe; + clrFund_not_ends_with: InputMaybe; + clrFund_not_ends_with_nocase: InputMaybe; + clrFund_not_in: InputMaybe>; + clrFund_not_starts_with: InputMaybe; + clrFund_not_starts_with_nocase: InputMaybe; + clrFund_starts_with: InputMaybe; + clrFund_starts_with_nocase: InputMaybe; contributions_: InputMaybe; contributorCount: InputMaybe; contributorCount_gt: InputMaybe; @@ -1261,6 +1306,22 @@ export type FundingRound_Filter = { contributorRegistry_starts_with_nocase: InputMaybe; contributors_: InputMaybe; coordinator: InputMaybe; + coordinatorPubKeyX: InputMaybe; + coordinatorPubKeyX_gt: InputMaybe; + coordinatorPubKeyX_gte: InputMaybe; + coordinatorPubKeyX_in: InputMaybe>; + coordinatorPubKeyX_lt: InputMaybe; + coordinatorPubKeyX_lte: InputMaybe; + coordinatorPubKeyX_not: InputMaybe; + coordinatorPubKeyX_not_in: InputMaybe>; + coordinatorPubKeyY: InputMaybe; + coordinatorPubKeyY_gt: InputMaybe; + coordinatorPubKeyY_gte: InputMaybe; + coordinatorPubKeyY_in: InputMaybe>; + coordinatorPubKeyY_lt: InputMaybe; + coordinatorPubKeyY_lte: InputMaybe; + coordinatorPubKeyY_not: InputMaybe; + coordinatorPubKeyY_not_in: InputMaybe>; coordinator_contains: InputMaybe; coordinator_gt: InputMaybe; coordinator_gte: InputMaybe; @@ -1290,27 +1351,6 @@ export type FundingRound_Filter = { createdAt_not_starts_with_nocase: InputMaybe; createdAt_starts_with: InputMaybe; createdAt_starts_with_nocase: InputMaybe; - fundingRoundFactory: InputMaybe; - fundingRoundFactory_: InputMaybe; - fundingRoundFactory_contains: InputMaybe; - fundingRoundFactory_contains_nocase: InputMaybe; - fundingRoundFactory_ends_with: InputMaybe; - fundingRoundFactory_ends_with_nocase: InputMaybe; - fundingRoundFactory_gt: InputMaybe; - fundingRoundFactory_gte: InputMaybe; - fundingRoundFactory_in: InputMaybe>; - fundingRoundFactory_lt: InputMaybe; - fundingRoundFactory_lte: InputMaybe; - fundingRoundFactory_not: InputMaybe; - fundingRoundFactory_not_contains: InputMaybe; - fundingRoundFactory_not_contains_nocase: InputMaybe; - fundingRoundFactory_not_ends_with: InputMaybe; - fundingRoundFactory_not_ends_with_nocase: InputMaybe; - fundingRoundFactory_not_in: InputMaybe>; - fundingRoundFactory_not_starts_with: InputMaybe; - fundingRoundFactory_not_starts_with_nocase: InputMaybe; - fundingRoundFactory_starts_with: InputMaybe; - fundingRoundFactory_starts_with_nocase: InputMaybe; id: InputMaybe; id_gt: InputMaybe; id_gte: InputMaybe; @@ -1365,6 +1405,14 @@ export type FundingRound_Filter = { matchingPoolSize_lte: InputMaybe; matchingPoolSize_not: InputMaybe; matchingPoolSize_not_in: InputMaybe>; + messageTreeDepth: InputMaybe; + messageTreeDepth_gt: InputMaybe; + messageTreeDepth_gte: InputMaybe; + messageTreeDepth_in: InputMaybe>; + messageTreeDepth_lt: InputMaybe; + messageTreeDepth_lte: InputMaybe; + messageTreeDepth_not: InputMaybe; + messageTreeDepth_not_in: InputMaybe>; messages_: InputMaybe; nativeToken: InputMaybe; nativeTokenInfo: InputMaybe; @@ -1398,6 +1446,16 @@ export type FundingRound_Filter = { nativeToken_not_contains: InputMaybe; nativeToken_not_in: InputMaybe>; or: InputMaybe>>; + pollAddress: InputMaybe; + pollAddress_contains: InputMaybe; + pollAddress_gt: InputMaybe; + pollAddress_gte: InputMaybe; + pollAddress_in: InputMaybe>; + pollAddress_lt: InputMaybe; + pollAddress_lte: InputMaybe; + pollAddress_not: InputMaybe; + pollAddress_not_contains: InputMaybe; + pollAddress_not_in: InputMaybe>; recipientCount: InputMaybe; recipientCount_gt: InputMaybe; recipientCount_gte: InputMaybe; @@ -1454,6 +1512,14 @@ export type FundingRound_Filter = { startTime_lte: InputMaybe; startTime_not: InputMaybe; startTime_not_in: InputMaybe>; + stateTreeDepth: InputMaybe; + stateTreeDepth_gt: InputMaybe; + stateTreeDepth_gte: InputMaybe; + stateTreeDepth_in: InputMaybe>; + stateTreeDepth_lt: InputMaybe; + stateTreeDepth_lte: InputMaybe; + stateTreeDepth_not: InputMaybe; + stateTreeDepth_not_in: InputMaybe>; tallyHash: InputMaybe; tallyHash_contains: InputMaybe; tallyHash_contains_nocase: InputMaybe; @@ -1498,6 +1564,14 @@ export type FundingRound_Filter = { voiceCreditFactor_lte: InputMaybe; voiceCreditFactor_not: InputMaybe; voiceCreditFactor_not_in: InputMaybe>; + voteOptionTreeDepth: InputMaybe; + voteOptionTreeDepth_gt: InputMaybe; + voteOptionTreeDepth_gte: InputMaybe; + voteOptionTreeDepth_in: InputMaybe>; + voteOptionTreeDepth_lt: InputMaybe; + voteOptionTreeDepth_lte: InputMaybe; + voteOptionTreeDepth_not: InputMaybe; + voteOptionTreeDepth_not_in: InputMaybe>; votes_: InputMaybe; votingDeadline: InputMaybe; votingDeadline_gt: InputMaybe; @@ -1510,6 +1584,29 @@ export type FundingRound_Filter = { }; export enum FundingRound_OrderBy { + ClrFund = 'clrFund', + ClrFundBatchUstVerifier = 'clrFund__batchUstVerifier', + ClrFundContributorRegistryAddress = 'clrFund__contributorRegistryAddress', + ClrFundCoordinator = 'clrFund__coordinator', + ClrFundCoordinatorPubKey = 'clrFund__coordinatorPubKey', + ClrFundCreatedAt = 'clrFund__createdAt', + ClrFundId = 'clrFund__id', + ClrFundLastUpdatedAt = 'clrFund__lastUpdatedAt', + ClrFundMaciFactory = 'clrFund__maciFactory', + ClrFundMaxMessages = 'clrFund__maxMessages', + ClrFundMaxUsers = 'clrFund__maxUsers', + ClrFundMaxVoteOptions = 'clrFund__maxVoteOptions', + ClrFundMessageBatchSize = 'clrFund__messageBatchSize', + ClrFundMessageTreeDepth = 'clrFund__messageTreeDepth', + ClrFundNativeToken = 'clrFund__nativeToken', + ClrFundOwner = 'clrFund__owner', + ClrFundQvtVerifier = 'clrFund__qvtVerifier', + ClrFundRecipientRegistryAddress = 'clrFund__recipientRegistryAddress', + ClrFundSignUpDuration = 'clrFund__signUpDuration', + ClrFundStateTreeDepth = 'clrFund__stateTreeDepth', + ClrFundTallyBatchSize = 'clrFund__tallyBatchSize', + ClrFundVoteOptionTreeDepth = 'clrFund__voteOptionTreeDepth', + ClrFundVotingDuration = 'clrFund__votingDuration', Contributions = 'contributions', ContributorCount = 'contributorCount', ContributorRegistry = 'contributorRegistry', @@ -1521,36 +1618,16 @@ export enum FundingRound_OrderBy { ContributorRegistryOwner = 'contributorRegistry__owner', Contributors = 'contributors', Coordinator = 'coordinator', + CoordinatorPubKeyX = 'coordinatorPubKeyX', + CoordinatorPubKeyY = 'coordinatorPubKeyY', CreatedAt = 'createdAt', - FundingRoundFactory = 'fundingRoundFactory', - FundingRoundFactoryBatchUstVerifier = 'fundingRoundFactory__batchUstVerifier', - FundingRoundFactoryContributorRegistryAddress = 'fundingRoundFactory__contributorRegistryAddress', - FundingRoundFactoryCoordinator = 'fundingRoundFactory__coordinator', - FundingRoundFactoryCoordinatorPubKey = 'fundingRoundFactory__coordinatorPubKey', - FundingRoundFactoryCreatedAt = 'fundingRoundFactory__createdAt', - FundingRoundFactoryId = 'fundingRoundFactory__id', - FundingRoundFactoryLastUpdatedAt = 'fundingRoundFactory__lastUpdatedAt', - FundingRoundFactoryMaciFactory = 'fundingRoundFactory__maciFactory', - FundingRoundFactoryMaxMessages = 'fundingRoundFactory__maxMessages', - FundingRoundFactoryMaxUsers = 'fundingRoundFactory__maxUsers', - FundingRoundFactoryMaxVoteOptions = 'fundingRoundFactory__maxVoteOptions', - FundingRoundFactoryMessageBatchSize = 'fundingRoundFactory__messageBatchSize', - FundingRoundFactoryMessageTreeDepth = 'fundingRoundFactory__messageTreeDepth', - FundingRoundFactoryNativeToken = 'fundingRoundFactory__nativeToken', - FundingRoundFactoryOwner = 'fundingRoundFactory__owner', - FundingRoundFactoryQvtVerifier = 'fundingRoundFactory__qvtVerifier', - FundingRoundFactoryRecipientRegistryAddress = 'fundingRoundFactory__recipientRegistryAddress', - FundingRoundFactorySignUpDuration = 'fundingRoundFactory__signUpDuration', - FundingRoundFactoryStateTreeDepth = 'fundingRoundFactory__stateTreeDepth', - FundingRoundFactoryTallyBatchSize = 'fundingRoundFactory__tallyBatchSize', - FundingRoundFactoryVoteOptionTreeDepth = 'fundingRoundFactory__voteOptionTreeDepth', - FundingRoundFactoryVotingDuration = 'fundingRoundFactory__votingDuration', Id = 'id', IsCancelled = 'isCancelled', IsFinalized = 'isFinalized', LastUpdatedAt = 'lastUpdatedAt', Maci = 'maci', MatchingPoolSize = 'matchingPoolSize', + MessageTreeDepth = 'messageTreeDepth', Messages = 'messages', NativeToken = 'nativeToken', NativeTokenInfo = 'nativeTokenInfo', @@ -1560,6 +1637,7 @@ export enum FundingRound_OrderBy { NativeTokenInfoLastUpdatedAt = 'nativeTokenInfo__lastUpdatedAt', NativeTokenInfoSymbol = 'nativeTokenInfo__symbol', NativeTokenInfoTokenAddress = 'nativeTokenInfo__tokenAddress', + PollAddress = 'pollAddress', RecipientCount = 'recipientCount', RecipientRegistry = 'recipientRegistry', RecipientRegistryAddress = 'recipientRegistryAddress', @@ -1574,10 +1652,12 @@ export enum FundingRound_OrderBy { Recipients = 'recipients', SignUpDeadline = 'signUpDeadline', StartTime = 'startTime', + StateTreeDepth = 'stateTreeDepth', TallyHash = 'tallyHash', TotalSpent = 'totalSpent', TotalVotes = 'totalVotes', VoiceCreditFactor = 'voiceCreditFactor', + VoteOptionTreeDepth = 'voteOptionTreeDepth', Votes = 'votes', VotingDeadline = 'votingDeadline' } @@ -1588,7 +1668,7 @@ export type Message = { data: Maybe>; fundingRound: Maybe; id: Scalars['ID']; - iv: Scalars['BigInt']; + msgType: Scalars['BigInt']; publicKey: Maybe; submittedBy: Maybe; timestamp: Maybe; @@ -1642,14 +1722,14 @@ export type Message_Filter = { id_lte: InputMaybe; id_not: InputMaybe; id_not_in: InputMaybe>; - iv: InputMaybe; - iv_gt: InputMaybe; - iv_gte: InputMaybe; - iv_in: InputMaybe>; - iv_lt: InputMaybe; - iv_lte: InputMaybe; - iv_not: InputMaybe; - iv_not_in: InputMaybe>; + msgType: InputMaybe; + msgType_gt: InputMaybe; + msgType_gte: InputMaybe; + msgType_in: InputMaybe>; + msgType_lt: InputMaybe; + msgType_lte: InputMaybe; + msgType_not: InputMaybe; + msgType_not_in: InputMaybe>; or: InputMaybe>>; publicKey: InputMaybe; publicKey_: InputMaybe; @@ -1719,6 +1799,8 @@ export enum Message_OrderBy { FundingRoundContributorCount = 'fundingRound__contributorCount', FundingRoundContributorRegistryAddress = 'fundingRound__contributorRegistryAddress', FundingRoundCoordinator = 'fundingRound__coordinator', + FundingRoundCoordinatorPubKeyX = 'fundingRound__coordinatorPubKeyX', + FundingRoundCoordinatorPubKeyY = 'fundingRound__coordinatorPubKeyY', FundingRoundCreatedAt = 'fundingRound__createdAt', FundingRoundId = 'fundingRound__id', FundingRoundIsCancelled = 'fundingRound__isCancelled', @@ -1726,18 +1808,22 @@ export enum Message_OrderBy { FundingRoundLastUpdatedAt = 'fundingRound__lastUpdatedAt', FundingRoundMaci = 'fundingRound__maci', FundingRoundMatchingPoolSize = 'fundingRound__matchingPoolSize', + FundingRoundMessageTreeDepth = 'fundingRound__messageTreeDepth', FundingRoundNativeToken = 'fundingRound__nativeToken', + FundingRoundPollAddress = 'fundingRound__pollAddress', FundingRoundRecipientCount = 'fundingRound__recipientCount', FundingRoundRecipientRegistryAddress = 'fundingRound__recipientRegistryAddress', FundingRoundSignUpDeadline = 'fundingRound__signUpDeadline', FundingRoundStartTime = 'fundingRound__startTime', + FundingRoundStateTreeDepth = 'fundingRound__stateTreeDepth', FundingRoundTallyHash = 'fundingRound__tallyHash', FundingRoundTotalSpent = 'fundingRound__totalSpent', FundingRoundTotalVotes = 'fundingRound__totalVotes', FundingRoundVoiceCreditFactor = 'fundingRound__voiceCreditFactor', + FundingRoundVoteOptionTreeDepth = 'fundingRound__voteOptionTreeDepth', FundingRoundVotingDeadline = 'fundingRound__votingDeadline', Id = 'id', - Iv = 'iv', + MsgType = 'msgType', PublicKey = 'publicKey', PublicKeyId = 'publicKey__id', PublicKeyStateIndex = 'publicKey__stateIndex', @@ -1849,6 +1935,8 @@ export enum PublicKey_OrderBy { FundingRoundContributorCount = 'fundingRound__contributorCount', FundingRoundContributorRegistryAddress = 'fundingRound__contributorRegistryAddress', FundingRoundCoordinator = 'fundingRound__coordinator', + FundingRoundCoordinatorPubKeyX = 'fundingRound__coordinatorPubKeyX', + FundingRoundCoordinatorPubKeyY = 'fundingRound__coordinatorPubKeyY', FundingRoundCreatedAt = 'fundingRound__createdAt', FundingRoundId = 'fundingRound__id', FundingRoundIsCancelled = 'fundingRound__isCancelled', @@ -1856,15 +1944,19 @@ export enum PublicKey_OrderBy { FundingRoundLastUpdatedAt = 'fundingRound__lastUpdatedAt', FundingRoundMaci = 'fundingRound__maci', FundingRoundMatchingPoolSize = 'fundingRound__matchingPoolSize', + FundingRoundMessageTreeDepth = 'fundingRound__messageTreeDepth', FundingRoundNativeToken = 'fundingRound__nativeToken', + FundingRoundPollAddress = 'fundingRound__pollAddress', FundingRoundRecipientCount = 'fundingRound__recipientCount', FundingRoundRecipientRegistryAddress = 'fundingRound__recipientRegistryAddress', FundingRoundSignUpDeadline = 'fundingRound__signUpDeadline', FundingRoundStartTime = 'fundingRound__startTime', + FundingRoundStateTreeDepth = 'fundingRound__stateTreeDepth', FundingRoundTallyHash = 'fundingRound__tallyHash', FundingRoundTotalSpent = 'fundingRound__totalSpent', FundingRoundTotalVotes = 'fundingRound__totalVotes', FundingRoundVoiceCreditFactor = 'fundingRound__voiceCreditFactor', + FundingRoundVoteOptionTreeDepth = 'fundingRound__voteOptionTreeDepth', FundingRoundVotingDeadline = 'fundingRound__votingDeadline', Id = 'id', Messages = 'messages', @@ -1878,6 +1970,8 @@ export type Query = { __typename?: 'Query'; /** Access to subgraph metadata */ _meta: Maybe<_Meta_>; + clrFund: Maybe; + clrFunds: Array; contribution: Maybe; contributions: Array; contributor: Maybe; @@ -1889,8 +1983,6 @@ export type Query = { donation: Maybe; donations: Array; fundingRound: Maybe; - fundingRoundFactories: Array; - fundingRoundFactory: Maybe; fundingRounds: Array; message: Maybe; messages: Array; @@ -1912,6 +2004,24 @@ export type Query_MetaArgs = { }; +export type QueryClrFundArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryClrFundsArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + export type QueryContributionArgs = { block: InputMaybe; id: Scalars['ID']; @@ -2009,24 +2119,6 @@ export type QueryFundingRoundArgs = { }; -export type QueryFundingRoundFactoriesArgs = { - block: InputMaybe; - first?: InputMaybe; - orderBy: InputMaybe; - orderDirection: InputMaybe; - skip?: InputMaybe; - subgraphError?: _SubgraphErrorPolicy_; - where: InputMaybe; -}; - - -export type QueryFundingRoundFactoryArgs = { - block: InputMaybe; - id: Scalars['ID']; - subgraphError?: _SubgraphErrorPolicy_; -}; - - export type QueryFundingRoundsArgs = { block: InputMaybe; first?: InputMaybe; @@ -2179,9 +2271,9 @@ export type RecipientRegistry = { __typename?: 'RecipientRegistry'; baseDeposit: Maybe; challengePeriodDuration: Maybe; + clrFund: Maybe; controller: Maybe; createdAt: Maybe; - fundingRoundFactory: Maybe; id: Scalars['ID']; lastUpdatedAt: Maybe; maxRecipients: Maybe; @@ -2218,6 +2310,27 @@ export type RecipientRegistry_Filter = { challengePeriodDuration_lte: InputMaybe; challengePeriodDuration_not: InputMaybe; challengePeriodDuration_not_in: InputMaybe>; + clrFund: InputMaybe; + clrFund_: InputMaybe; + clrFund_contains: InputMaybe; + clrFund_contains_nocase: InputMaybe; + clrFund_ends_with: InputMaybe; + clrFund_ends_with_nocase: InputMaybe; + clrFund_gt: InputMaybe; + clrFund_gte: InputMaybe; + clrFund_in: InputMaybe>; + clrFund_lt: InputMaybe; + clrFund_lte: InputMaybe; + clrFund_not: InputMaybe; + clrFund_not_contains: InputMaybe; + clrFund_not_contains_nocase: InputMaybe; + clrFund_not_ends_with: InputMaybe; + clrFund_not_ends_with_nocase: InputMaybe; + clrFund_not_in: InputMaybe>; + clrFund_not_starts_with: InputMaybe; + clrFund_not_starts_with_nocase: InputMaybe; + clrFund_starts_with: InputMaybe; + clrFund_starts_with_nocase: InputMaybe; controller: InputMaybe; controller_contains: InputMaybe; controller_gt: InputMaybe; @@ -2248,27 +2361,6 @@ export type RecipientRegistry_Filter = { createdAt_not_starts_with_nocase: InputMaybe; createdAt_starts_with: InputMaybe; createdAt_starts_with_nocase: InputMaybe; - fundingRoundFactory: InputMaybe; - fundingRoundFactory_: InputMaybe; - fundingRoundFactory_contains: InputMaybe; - fundingRoundFactory_contains_nocase: InputMaybe; - fundingRoundFactory_ends_with: InputMaybe; - fundingRoundFactory_ends_with_nocase: InputMaybe; - fundingRoundFactory_gt: InputMaybe; - fundingRoundFactory_gte: InputMaybe; - fundingRoundFactory_in: InputMaybe>; - fundingRoundFactory_lt: InputMaybe; - fundingRoundFactory_lte: InputMaybe; - fundingRoundFactory_not: InputMaybe; - fundingRoundFactory_not_contains: InputMaybe; - fundingRoundFactory_not_contains_nocase: InputMaybe; - fundingRoundFactory_not_ends_with: InputMaybe; - fundingRoundFactory_not_ends_with_nocase: InputMaybe; - fundingRoundFactory_not_in: InputMaybe>; - fundingRoundFactory_not_starts_with: InputMaybe; - fundingRoundFactory_not_starts_with_nocase: InputMaybe; - fundingRoundFactory_starts_with: InputMaybe; - fundingRoundFactory_starts_with_nocase: InputMaybe; id: InputMaybe; id_gt: InputMaybe; id_gte: InputMaybe; @@ -2322,31 +2414,31 @@ export type RecipientRegistry_Filter = { export enum RecipientRegistry_OrderBy { BaseDeposit = 'baseDeposit', ChallengePeriodDuration = 'challengePeriodDuration', + ClrFund = 'clrFund', + ClrFundBatchUstVerifier = 'clrFund__batchUstVerifier', + ClrFundContributorRegistryAddress = 'clrFund__contributorRegistryAddress', + ClrFundCoordinator = 'clrFund__coordinator', + ClrFundCoordinatorPubKey = 'clrFund__coordinatorPubKey', + ClrFundCreatedAt = 'clrFund__createdAt', + ClrFundId = 'clrFund__id', + ClrFundLastUpdatedAt = 'clrFund__lastUpdatedAt', + ClrFundMaciFactory = 'clrFund__maciFactory', + ClrFundMaxMessages = 'clrFund__maxMessages', + ClrFundMaxUsers = 'clrFund__maxUsers', + ClrFundMaxVoteOptions = 'clrFund__maxVoteOptions', + ClrFundMessageBatchSize = 'clrFund__messageBatchSize', + ClrFundMessageTreeDepth = 'clrFund__messageTreeDepth', + ClrFundNativeToken = 'clrFund__nativeToken', + ClrFundOwner = 'clrFund__owner', + ClrFundQvtVerifier = 'clrFund__qvtVerifier', + ClrFundRecipientRegistryAddress = 'clrFund__recipientRegistryAddress', + ClrFundSignUpDuration = 'clrFund__signUpDuration', + ClrFundStateTreeDepth = 'clrFund__stateTreeDepth', + ClrFundTallyBatchSize = 'clrFund__tallyBatchSize', + ClrFundVoteOptionTreeDepth = 'clrFund__voteOptionTreeDepth', + ClrFundVotingDuration = 'clrFund__votingDuration', Controller = 'controller', CreatedAt = 'createdAt', - FundingRoundFactory = 'fundingRoundFactory', - FundingRoundFactoryBatchUstVerifier = 'fundingRoundFactory__batchUstVerifier', - FundingRoundFactoryContributorRegistryAddress = 'fundingRoundFactory__contributorRegistryAddress', - FundingRoundFactoryCoordinator = 'fundingRoundFactory__coordinator', - FundingRoundFactoryCoordinatorPubKey = 'fundingRoundFactory__coordinatorPubKey', - FundingRoundFactoryCreatedAt = 'fundingRoundFactory__createdAt', - FundingRoundFactoryId = 'fundingRoundFactory__id', - FundingRoundFactoryLastUpdatedAt = 'fundingRoundFactory__lastUpdatedAt', - FundingRoundFactoryMaciFactory = 'fundingRoundFactory__maciFactory', - FundingRoundFactoryMaxMessages = 'fundingRoundFactory__maxMessages', - FundingRoundFactoryMaxUsers = 'fundingRoundFactory__maxUsers', - FundingRoundFactoryMaxVoteOptions = 'fundingRoundFactory__maxVoteOptions', - FundingRoundFactoryMessageBatchSize = 'fundingRoundFactory__messageBatchSize', - FundingRoundFactoryMessageTreeDepth = 'fundingRoundFactory__messageTreeDepth', - FundingRoundFactoryNativeToken = 'fundingRoundFactory__nativeToken', - FundingRoundFactoryOwner = 'fundingRoundFactory__owner', - FundingRoundFactoryQvtVerifier = 'fundingRoundFactory__qvtVerifier', - FundingRoundFactoryRecipientRegistryAddress = 'fundingRoundFactory__recipientRegistryAddress', - FundingRoundFactorySignUpDuration = 'fundingRoundFactory__signUpDuration', - FundingRoundFactoryStateTreeDepth = 'fundingRoundFactory__stateTreeDepth', - FundingRoundFactoryTallyBatchSize = 'fundingRoundFactory__tallyBatchSize', - FundingRoundFactoryVoteOptionTreeDepth = 'fundingRoundFactory__voteOptionTreeDepth', - FundingRoundFactoryVotingDuration = 'fundingRoundFactory__votingDuration', Id = 'id', LastUpdatedAt = 'lastUpdatedAt', MaxRecipients = 'maxRecipients', @@ -2611,6 +2703,8 @@ export type Subscription = { __typename?: 'Subscription'; /** Access to subgraph metadata */ _meta: Maybe<_Meta_>; + clrFund: Maybe; + clrFunds: Array; contribution: Maybe; contributions: Array; contributor: Maybe; @@ -2622,8 +2716,6 @@ export type Subscription = { donation: Maybe; donations: Array; fundingRound: Maybe; - fundingRoundFactories: Array; - fundingRoundFactory: Maybe; fundingRounds: Array; message: Maybe; messages: Array; @@ -2645,6 +2737,24 @@ export type Subscription_MetaArgs = { }; +export type SubscriptionClrFundArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionClrFundsArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + export type SubscriptionContributionArgs = { block: InputMaybe; id: Scalars['ID']; @@ -2742,24 +2852,6 @@ export type SubscriptionFundingRoundArgs = { }; -export type SubscriptionFundingRoundFactoriesArgs = { - block: InputMaybe; - first?: InputMaybe; - orderBy: InputMaybe; - orderDirection: InputMaybe; - skip?: InputMaybe; - subgraphError?: _SubgraphErrorPolicy_; - where: InputMaybe; -}; - - -export type SubscriptionFundingRoundFactoryArgs = { - block: InputMaybe; - id: Scalars['ID']; - subgraphError?: _SubgraphErrorPolicy_; -}; - - export type SubscriptionFundingRoundsArgs = { block: InputMaybe; first?: InputMaybe; @@ -3081,6 +3173,8 @@ export enum Vote_OrderBy { FundingRoundContributorCount = 'fundingRound__contributorCount', FundingRoundContributorRegistryAddress = 'fundingRound__contributorRegistryAddress', FundingRoundCoordinator = 'fundingRound__coordinator', + FundingRoundCoordinatorPubKeyX = 'fundingRound__coordinatorPubKeyX', + FundingRoundCoordinatorPubKeyY = 'fundingRound__coordinatorPubKeyY', FundingRoundCreatedAt = 'fundingRound__createdAt', FundingRoundId = 'fundingRound__id', FundingRoundIsCancelled = 'fundingRound__isCancelled', @@ -3088,15 +3182,19 @@ export enum Vote_OrderBy { FundingRoundLastUpdatedAt = 'fundingRound__lastUpdatedAt', FundingRoundMaci = 'fundingRound__maci', FundingRoundMatchingPoolSize = 'fundingRound__matchingPoolSize', + FundingRoundMessageTreeDepth = 'fundingRound__messageTreeDepth', FundingRoundNativeToken = 'fundingRound__nativeToken', + FundingRoundPollAddress = 'fundingRound__pollAddress', FundingRoundRecipientCount = 'fundingRound__recipientCount', FundingRoundRecipientRegistryAddress = 'fundingRound__recipientRegistryAddress', FundingRoundSignUpDeadline = 'fundingRound__signUpDeadline', FundingRoundStartTime = 'fundingRound__startTime', + FundingRoundStateTreeDepth = 'fundingRound__stateTreeDepth', FundingRoundTallyHash = 'fundingRound__tallyHash', FundingRoundTotalSpent = 'fundingRound__totalSpent', FundingRoundTotalVotes = 'fundingRound__totalVotes', FundingRoundVoiceCreditFactor = 'fundingRound__voiceCreditFactor', + FundingRoundVoteOptionTreeDepth = 'fundingRound__voteOptionTreeDepth', FundingRoundVotingDeadline = 'fundingRound__votingDeadline', Id = 'id', Secret = 'secret', @@ -3137,6 +3235,13 @@ export enum _SubgraphErrorPolicy_ { Deny = 'deny' } +export type GetClrFundInfoQueryVariables = Exact<{ + clrFundAddress: Scalars['ID']; +}>; + + +export type GetClrFundInfoQuery = { __typename?: 'Query', clrFund: { __typename?: 'ClrFund', contributorRegistryAddress: any | null, recipientRegistryAddress: any | null, nativeTokenInfo: { __typename?: 'Token', tokenAddress: any | null, symbol: string | null, decimals: any | null } | null } | null }; + export type GetContributionsAmountQueryVariables = Exact<{ fundingRoundAddress: Scalars['ID']; contributorAddress: Scalars['ID']; @@ -3160,7 +3265,7 @@ export type GetContributorMessagesQueryVariables = Exact<{ }>; -export type GetContributorMessagesQuery = { __typename?: 'Query', messages: Array<{ __typename?: 'Message', id: string, data: Array | null, iv: any, timestamp: string | null, blockNumber: any, transactionIndex: any }> }; +export type GetContributorMessagesQuery = { __typename?: 'Query', messages: Array<{ __typename?: 'Message', id: string, data: Array | null, msgType: any, timestamp: string | null, blockNumber: any, transactionIndex: any }> }; export type GetContributorVotesQueryVariables = Exact<{ fundingRoundAddress: Scalars['ID']; @@ -3171,18 +3276,11 @@ export type GetContributorVotesQueryVariables = Exact<{ export type GetContributorVotesQuery = { __typename?: 'Query', fundingRound: { __typename?: 'FundingRound', id: string, contributors: Array<{ __typename?: 'Contributor', votes: Array<{ __typename?: 'Vote', id: string }> | null }> | null } | null }; export type GetCurrentRoundQueryVariables = Exact<{ - fundingRoundFactoryAddress: Scalars['ID']; -}>; - - -export type GetCurrentRoundQuery = { __typename?: 'Query', fundingRoundFactory: { __typename?: 'FundingRoundFactory', currentRound: { __typename?: 'FundingRound', id: string } | null } | null }; - -export type GetFactoryInfoQueryVariables = Exact<{ - factoryAddress: Scalars['ID']; + clrFundAddress: Scalars['ID']; }>; -export type GetFactoryInfoQuery = { __typename?: 'Query', fundingRoundFactory: { __typename?: 'FundingRoundFactory', contributorRegistryAddress: any | null, recipientRegistryAddress: any | null, nativeTokenInfo: { __typename?: 'Token', tokenAddress: any | null, symbol: string | null, decimals: any | null } | null } | null }; +export type GetCurrentRoundQuery = { __typename?: 'Query', clrFund: { __typename?: 'ClrFund', currentRound: { __typename?: 'FundingRound', id: string } | null } | null }; export type GetLatestBlockNumberQueryVariables = Exact<{ [key: string]: never; }>; @@ -3229,11 +3327,11 @@ export type GetRecipientDonationsQueryVariables = Exact<{ export type GetRecipientDonationsQuery = { __typename?: 'Query', donations: Array<{ __typename?: 'Donation', id: string }> }; export type GetRecipientRegistryInfoQueryVariables = Exact<{ - factoryAddress: Scalars['ID']; + clrFundAddress: Scalars['ID']; }>; -export type GetRecipientRegistryInfoQuery = { __typename?: 'Query', fundingRoundFactory: { __typename?: 'FundingRoundFactory', recipientRegistry: { __typename?: 'RecipientRegistry', id: string, owner: any | null, baseDeposit: any | null, challengePeriodDuration: any | null } | null, currentRound: { __typename?: 'FundingRound', id: string, recipientRegistry: { __typename?: 'RecipientRegistry', id: string, owner: any | null, baseDeposit: any | null, challengePeriodDuration: any | null } | null } | null } | null }; +export type GetRecipientRegistryInfoQuery = { __typename?: 'Query', clrFund: { __typename?: 'ClrFund', recipientRegistry: { __typename?: 'RecipientRegistry', id: string, owner: any | null, baseDeposit: any | null, challengePeriodDuration: any | null } | null, currentRound: { __typename?: 'FundingRound', id: string, recipientRegistry: { __typename?: 'RecipientRegistry', id: string, owner: any | null, baseDeposit: any | null, challengePeriodDuration: any | null } | null } | null } | null }; export type GetRecipientsQueryVariables = Exact<{ registryAddress: Scalars['String']; @@ -3247,7 +3345,7 @@ export type GetRoundInfoQueryVariables = Exact<{ }>; -export type GetRoundInfoQuery = { __typename?: 'Query', fundingRound: { __typename?: 'FundingRound', id: string, maci: any | null, recipientRegistryAddress: any | null, contributorRegistryAddress: any | null, voiceCreditFactor: any | null, isFinalized: boolean | null, isCancelled: boolean | null, contributorCount: any, totalSpent: any | null, matchingPoolSize: any | null, nativeTokenInfo: { __typename?: 'Token', tokenAddress: any | null, symbol: string | null, decimals: any | null } | null } | null }; +export type GetRoundInfoQuery = { __typename?: 'Query', fundingRound: { __typename?: 'FundingRound', id: string, maci: any | null, pollAddress: any | null, recipientRegistryAddress: any | null, contributorRegistryAddress: any | null, voiceCreditFactor: any | null, isFinalized: boolean | null, isCancelled: boolean | null, contributorCount: any, totalSpent: any | null, matchingPoolSize: any | null, startTime: any | null, signUpDeadline: any | null, votingDeadline: any | null, coordinatorPubKeyX: any | null, coordinatorPubKeyY: any | null, stateTreeDepth: number | null, messageTreeDepth: number | null, voteOptionTreeDepth: number | null, nativeTokenInfo: { __typename?: 'Token', tokenAddress: any | null, symbol: string | null, decimals: any | null } | null } | null }; export type GetRoundsQueryVariables = Exact<{ [key: string]: never; }>; @@ -3269,6 +3367,19 @@ export type GetTotalContributedQueryVariables = Exact<{ export type GetTotalContributedQuery = { __typename?: 'Query', fundingRound: { __typename?: 'FundingRound', contributorCount: any } | null }; +export const GetClrFundInfoDocument = gql` + query GetClrFundInfo($clrFundAddress: ID!) { + clrFund(id: $clrFundAddress) { + nativeTokenInfo { + tokenAddress + symbol + decimals + } + contributorRegistryAddress + recipientRegistryAddress + } +} + `; export const GetContributionsAmountDocument = gql` query GetContributionsAmount($fundingRoundAddress: ID!, $contributorAddress: ID!) { contributions( @@ -3296,7 +3407,7 @@ export const GetContributorMessagesDocument = gql` ) { id data - iv + msgType timestamp blockNumber transactionIndex @@ -3316,27 +3427,14 @@ export const GetContributorVotesDocument = gql` } `; export const GetCurrentRoundDocument = gql` - query GetCurrentRound($fundingRoundFactoryAddress: ID!) { - fundingRoundFactory(id: $fundingRoundFactoryAddress) { + query GetCurrentRound($clrFundAddress: ID!) { + clrFund(id: $clrFundAddress) { currentRound { id } } } `; -export const GetFactoryInfoDocument = gql` - query GetFactoryInfo($factoryAddress: ID!) { - fundingRoundFactory(id: $factoryAddress) { - nativeTokenInfo { - tokenAddress - symbol - decimals - } - contributorRegistryAddress - recipientRegistryAddress - } -} - `; export const GetLatestBlockNumberDocument = gql` query GetLatestBlockNumber { _meta { @@ -3408,8 +3506,8 @@ export const GetRecipientDonationsDocument = gql` } `; export const GetRecipientRegistryInfoDocument = gql` - query GetRecipientRegistryInfo($factoryAddress: ID!) { - fundingRoundFactory(id: $factoryAddress) { + query GetRecipientRegistryInfo($clrFundAddress: ID!) { + clrFund(id: $clrFundAddress) { recipientRegistry { id owner @@ -3450,6 +3548,7 @@ export const GetRoundInfoDocument = gql` fundingRound(id: $fundingRoundAddress) { id maci + pollAddress nativeTokenInfo { tokenAddress symbol @@ -3463,6 +3562,14 @@ export const GetRoundInfoDocument = gql` contributorCount totalSpent matchingPoolSize + startTime + signUpDeadline + votingDeadline + coordinatorPubKeyX + coordinatorPubKeyY + stateTreeDepth + messageTreeDepth + voteOptionTreeDepth } } `; @@ -3503,6 +3610,9 @@ const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationTy export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) { return { + GetClrFundInfo(variables: GetClrFundInfoQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise { + return withWrapper((wrappedRequestHeaders) => client.request(GetClrFundInfoDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'GetClrFundInfo', 'query'); + }, GetContributionsAmount(variables: GetContributionsAmountQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise { return withWrapper((wrappedRequestHeaders) => client.request(GetContributionsAmountDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'GetContributionsAmount', 'query'); }, @@ -3518,9 +3628,6 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = GetCurrentRound(variables: GetCurrentRoundQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise { return withWrapper((wrappedRequestHeaders) => client.request(GetCurrentRoundDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'GetCurrentRound', 'query'); }, - GetFactoryInfo(variables: GetFactoryInfoQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise { - return withWrapper((wrappedRequestHeaders) => client.request(GetFactoryInfoDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'GetFactoryInfo', 'query'); - }, GetLatestBlockNumber(variables?: GetLatestBlockNumberQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise { return withWrapper((wrappedRequestHeaders) => client.request(GetLatestBlockNumberDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'GetLatestBlockNumber', 'query'); }, diff --git a/vue-app/src/graphql/queries/GetFactoryInfo.graphql b/vue-app/src/graphql/queries/GetClrFundInfo.graphql similarity index 61% rename from vue-app/src/graphql/queries/GetFactoryInfo.graphql rename to vue-app/src/graphql/queries/GetClrFundInfo.graphql index 47459a56a..d59d3049a 100644 --- a/vue-app/src/graphql/queries/GetFactoryInfo.graphql +++ b/vue-app/src/graphql/queries/GetClrFundInfo.graphql @@ -1,5 +1,5 @@ -query GetFactoryInfo($factoryAddress: ID!) { - fundingRoundFactory(id: $factoryAddress) { +query GetClrFundInfo($clrFundAddress: ID!) { + clrFund(id: $clrFundAddress) { nativeTokenInfo { tokenAddress symbol diff --git a/vue-app/src/graphql/queries/GetContributorMessages.graphql b/vue-app/src/graphql/queries/GetContributorMessages.graphql index c50d866db..d163b923b 100644 --- a/vue-app/src/graphql/queries/GetContributorMessages.graphql +++ b/vue-app/src/graphql/queries/GetContributorMessages.graphql @@ -14,7 +14,7 @@ query GetContributorMessages( { id data - iv + msgType timestamp blockNumber transactionIndex diff --git a/vue-app/src/graphql/queries/GetCurrentRound.graphql b/vue-app/src/graphql/queries/GetCurrentRound.graphql index 2d25e39bd..1a5820164 100644 --- a/vue-app/src/graphql/queries/GetCurrentRound.graphql +++ b/vue-app/src/graphql/queries/GetCurrentRound.graphql @@ -1,5 +1,5 @@ -query GetCurrentRound($fundingRoundFactoryAddress: ID!) { - fundingRoundFactory(id: $fundingRoundFactoryAddress) { +query GetCurrentRound($clrFundAddress: ID!) { + clrFund(id: $clrFundAddress) { currentRound { id } diff --git a/vue-app/src/graphql/queries/GetRecipientRegistryInfo.graphql b/vue-app/src/graphql/queries/GetRecipientRegistryInfo.graphql index 6d236fed9..bb2b34713 100644 --- a/vue-app/src/graphql/queries/GetRecipientRegistryInfo.graphql +++ b/vue-app/src/graphql/queries/GetRecipientRegistryInfo.graphql @@ -1,5 +1,5 @@ -query GetRecipientRegistryInfo($factoryAddress: ID!) { - fundingRoundFactory(id: $factoryAddress) { +query GetRecipientRegistryInfo($clrFundAddress: ID!) { + clrFund(id: $clrFundAddress) { recipientRegistry { id owner diff --git a/vue-app/src/graphql/queries/GetRoundInfo.graphql b/vue-app/src/graphql/queries/GetRoundInfo.graphql index cb8ec910d..8dbf7db9d 100644 --- a/vue-app/src/graphql/queries/GetRoundInfo.graphql +++ b/vue-app/src/graphql/queries/GetRoundInfo.graphql @@ -2,6 +2,7 @@ query GetRoundInfo($fundingRoundAddress: ID!) { fundingRound(id: $fundingRoundAddress) { id maci + pollAddress nativeTokenInfo { tokenAddress symbol @@ -15,5 +16,13 @@ query GetRoundInfo($fundingRoundAddress: ID!) { contributorCount totalSpent matchingPoolSize + startTime + signUpDeadline + votingDeadline + coordinatorPubKeyX + coordinatorPubKeyY + stateTreeDepth + messageTreeDepth + voteOptionTreeDepth } } diff --git a/vue-app/src/router/index.ts b/vue-app/src/router/index.ts index 6a68c45b9..e6e415a07 100644 --- a/vue-app/src/router/index.ts +++ b/vue-app/src/router/index.ts @@ -30,7 +30,7 @@ const TransactionSuccess = () => import('@/views/TransactionSuccess.vue') const Leaderboard = () => import('@/views/Leaderboard.vue') const LeaderboardProject = () => import('@/views/LeaderboardProject.vue') -// TODO: create a new route that takes funding factory address as a param +// TODO: create a new route that takes funding ClrFund address as a param const routes: Array = [ { path: '/', diff --git a/vue-app/src/stores/app.ts b/vue-app/src/stores/app.ts index eb5513ad1..4ed0c7752 100644 --- a/vue-app/src/stores/app.ts +++ b/vue-app/src/stores/app.ts @@ -13,7 +13,7 @@ import { getCommittedCart } from '@/api/cart' import { operator, chain, ThemeMode, recipientRegistryType, recipientJoinDeadlineConfig } from '@/api/core' import { type RoundInfo, RoundStatus, getRoundInfo } from '@/api/round' import { getTally, type Tally } from '@/api/tally' -import { type Factory, getFactoryInfo } from '@/api/factory' +import { type ClrFund, getClrFundInfo } from '@/api/clrFund' import { getMACIFactoryInfo, type MACIFactory } from '@/api/maci-factory' import { isSameAddress } from '@/utils/accounts' import { storage } from '@/api/storage' @@ -39,7 +39,7 @@ export type AppState = { showCartPanel: boolean tally: Tally | null theme: string | null - factory: Factory | null + clrFund: ClrFund | null maciFactory: MACIFactory | null showSimpleLeaderboard: boolean } @@ -59,7 +59,7 @@ export const useAppStore = defineStore('app', { showCartPanel: false, tally: null, theme: null, - factory: null, + clrFund: null, maciFactory: null, showSimpleLeaderboard: true, }), @@ -153,23 +153,23 @@ export const useAppStore = defineStore('app', { return operator }, userRegistryAddress: (state): string | undefined => { - const { currentRound, factory } = state + const { currentRound, clrFund } = state if (currentRound) { return currentRound.userRegistryAddress } - if (factory) { - return factory.userRegistryAddress + if (clrFund) { + return clrFund.userRegistryAddress } }, matchingPool: (state): BigNumber => { - const { currentRound, factory } = state + const { currentRound, clrFund } = state let matchingPool = BigNumber.from(0) - if (factory) { - matchingPool = factory.matchingPool + if (clrFund) { + matchingPool = clrFund.matchingPool } if (currentRound) { @@ -179,12 +179,12 @@ export const useAppStore = defineStore('app', { return matchingPool }, nativeTokenSymbol: (state): string => { - const { currentRound, factory } = state + const { currentRound, clrFund } = state let nativeTokenSymbol = '' - if (factory) { - nativeTokenSymbol = factory.nativeTokenSymbol + if (clrFund) { + nativeTokenSymbol = clrFund.nativeTokenSymbol } if (currentRound) { @@ -194,12 +194,12 @@ export const useAppStore = defineStore('app', { return nativeTokenSymbol }, nativeTokenDecimals: (state): number | undefined => { - const { currentRound, factory } = state + const { currentRound, clrFund } = state let nativeTokenDecimals - if (factory) { - nativeTokenDecimals = factory.nativeTokenDecimals + if (clrFund) { + nativeTokenDecimals = clrFund.nativeTokenDecimals } if (currentRound) { @@ -209,12 +209,12 @@ export const useAppStore = defineStore('app', { return nativeTokenDecimals }, nativeTokenAddress: (state): string => { - const { currentRound, factory } = state + const { currentRound, clrFund } = state let nativeTokenAddress = '' - if (factory) { - nativeTokenAddress = factory.nativeTokenAddress + if (clrFund) { + nativeTokenAddress = clrFund.nativeTokenAddress } if (currentRound) { @@ -460,9 +460,9 @@ export const useAppStore = defineStore('app', { stateIndex, } }, - async loadFactoryInfo() { - const factory = await getFactoryInfo() - this.factory = factory + async loadClrFundInfo() { + const clrFund = await getClrFundInfo() + this.clrFund = clrFund }, async loadMACIFactoryInfo() { const factory = await getMACIFactoryInfo() diff --git a/vue-app/src/stores/recipient.ts b/vue-app/src/stores/recipient.ts index 271258412..0a8c85638 100644 --- a/vue-app/src/stores/recipient.ts +++ b/vue-app/src/stores/recipient.ts @@ -41,7 +41,7 @@ export const useRecipientStore = defineStore('recipient', { }, async loadRecipientRegistryInfo() { const appStore = useAppStore() - //TODO: update call to getRecipientRegistryAddress to take factory address as a parameter + //TODO: update call to getRecipientRegistryAddress to take ClrFund address as a parameter const recipientRegistryAddress = this.recipientRegistryAddress || (await getRecipientRegistryAddress(appStore.currentRoundAddress)) this.recipientRegistryAddress = recipientRegistryAddress diff --git a/vue-app/src/stores/user.ts b/vue-app/src/stores/user.ts index 655a18647..0a6d121b8 100644 --- a/vue-app/src/stores/user.ts +++ b/vue-app/src/stores/user.ts @@ -66,9 +66,9 @@ export const useUserStore = defineStore('user', { let isRegistered: boolean | undefined = undefined const walletAddress = this.currentUser.walletAddress - if (appStore.factory) { - nativeTokenAddress = appStore.factory.nativeTokenAddress - userRegistryAddress = appStore.factory.userRegistryAddress + if (appStore.clrFund) { + nativeTokenAddress = appStore.clrFund.nativeTokenAddress + userRegistryAddress = appStore.clrFund.userRegistryAddress } if (appStore.currentRound) { diff --git a/vue-app/src/views/Project.vue b/vue-app/src/views/Project.vue index a681aa2cb..08ce13444 100644 --- a/vue-app/src/views/Project.vue +++ b/vue-app/src/views/Project.vue @@ -55,7 +55,7 @@ onMounted(async () => { return } - //TODO: update to take factory address as a parameter, default to env. variable + //TODO: update to take ClrFund address as a parameter, default to env. variable const currentRoundAddress = appStore.currentRoundAddress || (await getCurrentRound()) roundAddress.value = (route.params.address as string) || currentRoundAddress || '' diff --git a/vue-app/src/views/ProjectList.vue b/vue-app/src/views/ProjectList.vue index 92d09477a..d6345fb3b 100644 --- a/vue-app/src/views/ProjectList.vue +++ b/vue-app/src/views/ProjectList.vue @@ -144,7 +144,7 @@ async function loadProjectRoundInfo(roundAddress: string): Promise