From 30a38a3c856fe044bc63a8cd2d072766f703beb5 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Mon, 20 May 2024 22:10:24 -0400 Subject: [PATCH] fix incorrect maxContributors, maxMessages and maxVoteOptions --- common/src/utils.ts | 16 +++- contracts/tests/round.ts | 80 ++++++++++++++++--- contracts/utils/maci.ts | 4 +- contracts/utils/testutils.ts | 26 ++++-- subgraph/generated/ClrFund/MACIFactory.ts | 40 ++-------- subgraph/generated/schema.ts | 34 ++++++++ subgraph/schema.graphql | 3 + subgraph/schema.template.graphql | 3 + subgraph/src/ClrFundMapping.ts | 6 ++ vue-app/src/api/round.ts | 22 +++-- vue-app/src/graphql/API.ts | 37 ++++++++- .../src/graphql/queries/GetRoundInfo.graphql | 2 + 12 files changed, 209 insertions(+), 64 deletions(-) diff --git a/common/src/utils.ts b/common/src/utils.ts index d0bd5cdcb..aee9aba9c 100644 --- a/common/src/utils.ts +++ b/common/src/utils.ts @@ -12,7 +12,9 @@ import { Keypair } from './keypair' import { Tally } from './tally' import { bnSqrt } from './math' -const LEAVES_PER_NODE = 5 +// This has to match the MACI TREE_ARITY at: +// github.com/privacy-scaling-explorations/maci/blob/0c18913d4c84bfa9fbfd66dc017e338df9fdda96/contracts/contracts/MACI.sol#L31 +export const MACI_TREE_ARITY = 5 export function createMessage( userStateIndex: number, @@ -65,7 +67,7 @@ export function getRecipientClaimData( const spentTree = new IncrementalQuinTree( recipientTreeDepth, BigInt(0), - LEAVES_PER_NODE, + MACI_TREE_ARITY, hash5 ) for (const leaf of tally.perVOSpentVoiceCredits.tally) { @@ -94,6 +96,15 @@ export function getRecipientClaimData( ] } +/** + * Returns the maximum MACI users allowed by the state tree + * @param stateTreeDepth MACI state tree depth + * @returns the maximum number of contributors allowed by MACI circuit + */ +export function getMaxContributors(stateTreeDepth: number): number { + return MACI_TREE_ARITY ** stateTreeDepth - 1 +} + export { genTallyResultCommitment, Message, @@ -103,5 +114,4 @@ export { hash2, hash3, hashLeftRight, - LEAVES_PER_NODE, } diff --git a/contracts/tests/round.ts b/contracts/tests/round.ts index 887e9224a..52f0bf12a 100644 --- a/contracts/tests/round.ts +++ b/contracts/tests/round.ts @@ -10,9 +10,11 @@ import { randomBytes, hexlify, toNumber, + Wallet, + TransactionResponse, } from 'ethers' import { genRandomSalt } from 'maci-crypto' -import { Keypair } from '@clrfund/common' +import { getMaxContributors, Keypair, MACI_TREE_ARITY } from '@clrfund/common' import { time } from '@nomicfoundation/hardhat-network-helpers' import { @@ -29,11 +31,14 @@ import { getRecipientClaimData, mergeMaciSubtrees, } from '../utils/maci' -import { deployTestFundingRound } from '../utils/testutils' +import { + deployTestFundingRound, + DeployTestFundingRoundOutput, +} from '../utils/testutils' // ethStaker test vectors for Quadratic Funding with alpha import smallTallyTestData from './data/testTallySmall.json' -import { FundingRound } from '../typechain-types' +import { AnyOldERC20Token, FundingRound } from '../typechain-types' import { EContracts } from '../utils/types' const newResultCommitment = hexlify(randomBytes(32)) @@ -66,6 +71,33 @@ function calcAllocationAmount(tally: string, voiceCredit: string): bigint { return allocation / ALPHA_PRECISION } +/** + * Simulate contribution by a random user + * @param contracts list of contracts returned from the deployTestFundingRound function + * @param deployer the account that owns the contracts + * @returns contribute transaction response + */ +async function contributeByRandomUser( + contracts: DeployTestFundingRoundOutput, + deployer: HardhatEthersSigner +): Promise { + const amount = ethers.parseEther('0.1') + const keypair = new Keypair() + const user = Wallet.createRandom(ethers.provider) + await contracts.token.transfer(user.address, amount) + await deployer.sendTransaction({ to: user.address, value: amount }) + const tokenAsUser = contracts.token.connect(user) as AnyOldERC20Token + await tokenAsUser.approve(contracts.fundingRound.target, amount) + const fundingRoundAsUser = contracts.fundingRound.connect( + user + ) as FundingRound + const tx = await fundingRoundAsUser.contribute( + keypair.pubKey.asContractParam(), + amount + ) + return tx +} + describe('Funding Round', () => { const coordinatorPubKey = new Keypair().pubKey const roundDuration = 86400 * 7 @@ -101,13 +133,13 @@ describe('Funding Round', () => { beforeEach(async () => { const tokenInitialSupply = UNIT * BigInt(1000000) - const deployed = await deployTestFundingRound( - tokenInitialSupply + budget, - coordinator.address, - coordinatorPubKey, + const deployed = await deployTestFundingRound({ + tokenSupply: tokenInitialSupply + budget, + coordinatorAddress: coordinator.address, + coordinatorPubKey: coordinatorPubKey, roundDuration, - deployer - ) + deployer, + }) token = deployed.token fundingRound = deployed.fundingRound userRegistry = deployed.mockUserRegistry @@ -115,7 +147,7 @@ describe('Funding Round', () => { tally = deployed.mockTally const mockVerifier = deployed.mockVerifier - // make the verifier to alwasy returns true + // make the verifier to always returns true await mockVerifier.mock.verify.returns(true) await userRegistry.mock.isVerifiedUser.returns(true) await tally.mock.tallyBatchNum.returns(1) @@ -205,8 +237,34 @@ describe('Funding Round', () => { ).to.equal(expectedVoiceCredits) }) + it('calculates max contributors correctly', async () => { + const stateTreeDepth = toNumber(await maci.stateTreeDepth()) + const maxUsers = MACI_TREE_ARITY ** stateTreeDepth - 1 + expect(getMaxContributors(stateTreeDepth)).to.eq(maxUsers) + }) + it('limits the number of contributors', async () => { - // TODO: add test later + // use a smaller stateTreeDepth to run the test faster + const stateTreeDepth = 1 + const contracts = await deployTestFundingRound({ + stateTreeDepth, + tokenSupply: UNIT * BigInt(1000000), + coordinatorAddress: coordinator.address, + coordinatorPubKey, + roundDuration, + deployer, + }) + await contracts.mockUserRegistry.mock.isVerifiedUser.returns(true) + + const maxUsers = getMaxContributors(stateTreeDepth) + for (let i = 0; i < maxUsers; i++) { + await contributeByRandomUser(contracts, deployer) + } + + // this should throw TooManySignups + await expect( + contributeByRandomUser(contracts, deployer) + ).to.be.revertedWithCustomError(maci, 'TooManySignups') }) it('rejects contributions if funding round has been finalized', async () => { diff --git a/contracts/utils/maci.ts b/contracts/utils/maci.ts index caa8467ba..340134752 100644 --- a/contracts/utils/maci.ts +++ b/contracts/utils/maci.ts @@ -7,7 +7,7 @@ import { hash5, hash3, hashLeftRight, - LEAVES_PER_NODE, + MACI_TREE_ARITY, genTallyResultCommitment, Keypair, Tally as TallyData, @@ -50,7 +50,7 @@ export function getTallyResultProof( const resultTree = new IncrementalQuinTree( recipientTreeDepth, BigInt(0), - LEAVES_PER_NODE, + MACI_TREE_ARITY, hash5 ) for (const leaf of tally.results.tally) { diff --git a/contracts/utils/testutils.ts b/contracts/utils/testutils.ts index 8a306cf41..6d80b7a71 100644 --- a/contracts/utils/testutils.ts +++ b/contracts/utils/testutils.ts @@ -169,13 +169,21 @@ export type DeployTestFundingRoundOutput = { * @param deployer singer for the contract deployment * @returns all the deployed objects in DeployTestFundingRoundOutput */ -export async function deployTestFundingRound( - tokenSupply: bigint, - coordinatorAddress: string, - coordinatorPubKey: PubKey, - roundDuration: number, +export async function deployTestFundingRound({ + stateTreeDepth, + tokenSupply, + coordinatorAddress, + coordinatorPubKey, + roundDuration, + deployer, +}: { + stateTreeDepth?: number + tokenSupply: bigint + coordinatorAddress: string + coordinatorPubKey: PubKey + roundDuration: number deployer: Signer -): Promise { +}): Promise { const token = await ethers.deployContract( EContracts.AnyOldERC20Token, [tokenSupply], @@ -208,6 +216,12 @@ export async function deployTestFundingRound( }) const maciParameters = MaciParameters.mock() + + // use the stateTreeDepth from input + if (stateTreeDepth != undefined) { + maciParameters.stateTreeDepth = stateTreeDepth + } + const maciFactory = await deployMaciFactory({ libraries, ethers, diff --git a/subgraph/generated/ClrFund/MACIFactory.ts b/subgraph/generated/ClrFund/MACIFactory.ts index c9f330074..7c1fbe71b 100644 --- a/subgraph/generated/ClrFund/MACIFactory.ts +++ b/subgraph/generated/ClrFund/MACIFactory.ts @@ -76,10 +76,6 @@ export class MACIFactory__deployMaciResult_pollContractsStruct extends ethereum. get tally(): Address { return this[2].toAddress(); } - - get subsidy(): Address { - return this[3].toAddress(); - } } export class MACIFactory__deployMaciResult { @@ -124,18 +120,11 @@ export class MACIFactory__factoriesResult { value0: Address; value1: Address; value2: Address; - value3: Address; - constructor( - value0: Address, - value1: Address, - value2: Address, - value3: Address, - ) { + constructor(value0: Address, value1: Address, value2: Address) { this.value0 = value0; this.value1 = value1; this.value2 = value2; - this.value3 = value3; } toMap(): TypedMap { @@ -143,7 +132,6 @@ export class MACIFactory__factoriesResult { 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; } @@ -155,12 +143,8 @@ export class MACIFactory__factoriesResult { return this.value1; } - getSubsidyFactory(): Address { - return this.value2; - } - getMessageProcessorFactory(): Address { - return this.value3; + return this.value2; } } @@ -269,7 +253,7 @@ export class MACIFactory extends ethereum.SmartContract { ): MACIFactory__deployMaciResult { let result = super.call( "deployMaci", - "deployMaci(address,address,address,uint256,address,(uint256,uint256),address):(address,(address,address,address,address))", + "deployMaci(address,address,address,uint256,address,(uint256,uint256),address):(address,(address,address,address))", [ ethereum.Value.fromAddress(signUpGatekeeper), ethereum.Value.fromAddress(initialVoiceCreditProxy), @@ -300,7 +284,7 @@ export class MACIFactory extends ethereum.SmartContract { ): ethereum.CallResult { let result = super.tryCall( "deployMaci", - "deployMaci(address,address,address,uint256,address,(uint256,uint256),address):(address,(address,address,address,address))", + "deployMaci(address,address,address,uint256,address,(uint256,uint256),address):(address,(address,address,address))", [ ethereum.Value.fromAddress(signUpGatekeeper), ethereum.Value.fromAddress(initialVoiceCreditProxy), @@ -328,7 +312,7 @@ export class MACIFactory extends ethereum.SmartContract { factories(): MACIFactory__factoriesResult { let result = super.call( "factories", - "factories():(address,address,address,address)", + "factories():(address,address,address)", [], ); @@ -336,14 +320,13 @@ export class MACIFactory extends ethereum.SmartContract { result[0].toAddress(), result[1].toAddress(), result[2].toAddress(), - result[3].toAddress(), ); } try_factories(): ethereum.CallResult { let result = super.tryCall( "factories", - "factories():(address,address,address,address)", + "factories():(address,address,address)", [], ); if (result.reverted) { @@ -355,7 +338,6 @@ export class MACIFactory extends ethereum.SmartContract { value[0].toAddress(), value[1].toAddress(), value[2].toAddress(), - value[3].toAddress(), ), ); } @@ -534,12 +516,8 @@ export class ConstructorCall_factoriesStruct extends ethereum.Tuple { return this[1].toAddress(); } - get subsidyFactory(): Address { - return this[2].toAddress(); - } - get messageProcessorFactory(): Address { - return this[3].toAddress(); + return this[2].toAddress(); } } @@ -631,10 +609,6 @@ export class DeployMaciCall_pollContractsStruct extends ethereum.Tuple { get tally(): Address { return this[2].toAddress(); } - - get subsidy(): Address { - return this[3].toAddress(); - } } export class RenounceOwnershipCall extends ethereum.Call { diff --git a/subgraph/generated/schema.ts b/subgraph/generated/schema.ts index 97e62f0d3..b3f92c01b 100644 --- a/subgraph/generated/schema.ts +++ b/subgraph/generated/schema.ts @@ -1020,6 +1020,40 @@ export class FundingRound extends Entity { this.set("voteOptionTreeDepth", Value.fromI32(value)); } + get maxMessages(): BigInt | null { + let value = this.get("maxMessages"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set maxMessages(value: BigInt | null) { + if (!value) { + this.unset("maxMessages"); + } else { + this.set("maxMessages", Value.fromBigInt(value)); + } + } + + get maxVoteOptions(): BigInt | null { + let value = this.get("maxVoteOptions"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set maxVoteOptions(value: BigInt | null) { + if (!value) { + this.unset("maxVoteOptions"); + } else { + this.set("maxVoteOptions", Value.fromBigInt(value)); + } + } + get coordinatorPubKeyX(): BigInt | null { let value = this.get("coordinatorPubKeyX"); if (!value || value.kind == ValueKind.NULL) { diff --git a/subgraph/schema.graphql b/subgraph/schema.graphql index 147b3225f..3d9b3610a 100644 --- a/subgraph/schema.graphql +++ b/subgraph/schema.graphql @@ -73,6 +73,9 @@ type FundingRound @entity { messageTreeDepth: Int voteOptionTreeDepth: Int + maxMessages: BigInt + maxVoteOptions: BigInt + coordinatorPubKeyX: BigInt coordinatorPubKeyY: BigInt coordinator: Bytes diff --git a/subgraph/schema.template.graphql b/subgraph/schema.template.graphql index af4e1689d..44b3d2127 100644 --- a/subgraph/schema.template.graphql +++ b/subgraph/schema.template.graphql @@ -85,6 +85,9 @@ type FundingRound @entity { messageTreeDepth: Int voteOptionTreeDepth: Int + maxMessages: BigInt + maxVoteOptions: BigInt + coordinatorPubKeyX: BigInt coordinatorPubKeyY: BigInt coordinator: Bytes diff --git a/subgraph/src/ClrFundMapping.ts b/subgraph/src/ClrFundMapping.ts index f26e32586..85cbe3170 100644 --- a/subgraph/src/ClrFundMapping.ts +++ b/subgraph/src/ClrFundMapping.ts @@ -289,6 +289,12 @@ export function handleRoundStarted(event: RoundStarted): void { fundingRound.voteOptionTreeDepth = treeDepths.value.value3 } + let maxValues = pollContract.try_maxValues() + if (!maxValues.reverted) { + fundingRound.maxMessages = maxValues.value.value0 + fundingRound.maxVoteOptions = maxValues.value.value1 + } + let coordinatorPubKey = pollContract.try_coordinatorPubKey() if (!coordinatorPubKey.reverted) { fundingRound.coordinatorPubKeyX = coordinatorPubKey.value.value0 diff --git a/vue-app/src/api/round.ts b/vue-app/src/api/round.ts index bc724117c..219dbecad 100644 --- a/vue-app/src/api/round.ts +++ b/vue-app/src/api/round.ts @@ -1,6 +1,6 @@ -import { Contract, toNumber, getAddress, hexlify, randomBytes } from 'ethers' +import { Contract, getAddress, hexlify, randomBytes, getNumber } from 'ethers' import { DateTime } from 'luxon' -import { PubKey, type Tally } from '@clrfund/common' +import { PubKey, type Tally, getMaxContributors } from '@clrfund/common' import { FundingRound, Poll } from './abi' import { provider, clrFundContract, isActiveApp } from './core' @@ -174,8 +174,9 @@ export async function getRoundInfo( isFinalized, isCancelled, stateTreeDepth, - messageTreeDepth, voteOptionTreeDepth, + maxMessages: maxMessagesBigInt, + maxVoteOptions: maxVoteOptionsBigInt, startTime: startTimeInSeconds, signUpDeadline: signUpDeadlineInSeconds, votingDeadline: votingDeadlineInSeconds, @@ -193,8 +194,8 @@ export async function getRoundInfo( const nativeTokenSymbol = data.fundingRound.nativeTokenInfo?.symbol || '' const nativeTokenDecimals = Number(data.fundingRound.nativeTokenInfo?.decimals || '') - const maxContributors = stateTreeDepth ? 2 ** stateTreeDepth - 1 : 0 - const maxMessages = messageTreeDepth ? 2 ** messageTreeDepth - 1 : 0 + const maxContributors = getMaxContributors(stateTreeDepth || 0) + const maxMessages = getNumber(maxMessagesBigInt) || 0 const now = DateTime.local() const startTime = DateTime.fromSeconds(Number(startTimeInSeconds || 0)) const signUpDeadline = DateTime.fromSeconds(Number(signUpDeadlineInSeconds || 0)) @@ -217,9 +218,10 @@ export async function getRoundInfo( contributions = contributionsInfo.amount matchingPool = await clrFundContract.getMatchingFunds(nativeTokenAddress) } else { - if (now < signUpDeadline && contributors < maxContributors) { + if (now < votingDeadline && contributors < maxContributors) { status = RoundStatus.Contributing } else if (now < votingDeadline) { + // Too many contributors, do not allow new contributors, allow reallocation only status = RoundStatus.Reallocating } else { status = RoundStatus.Tallying @@ -231,6 +233,10 @@ export async function getRoundInfo( const totalFunds = matchingPool + contributions + // recipient 0 is reserved, so maxRecipients is 1 fewer than the maxVoteOptions + const maxVoteOptions = getNumber(maxVoteOptionsBigInt) + const maxRecipients = maxVoteOptions > 0 ? maxVoteOptions - 1 : 0 + return { fundingRoundAddress, recipientRegistryAddress: getAddress(recipientRegistryAddress), @@ -239,7 +245,7 @@ export async function getRoundInfo( pollId: BigInt(pollId || 0), recipientTreeDepth: voteOptionTreeDepth || 1, maxContributors, - maxRecipients: voteOptionTreeDepth ? 5 ** voteOptionTreeDepth - 1 : 0, + maxRecipients, maxMessages, coordinatorPubKey, nativeTokenAddress: getAddress(nativeTokenAddress), @@ -254,6 +260,6 @@ export async function getRoundInfo( matchingPool, contributions, contributors, - messages: toNumber(messages), + messages: getNumber(messages), } } diff --git a/vue-app/src/graphql/API.ts b/vue-app/src/graphql/API.ts index fc61e9d4f..72b5be6c3 100644 --- a/vue-app/src/graphql/API.ts +++ b/vue-app/src/graphql/API.ts @@ -17,6 +17,7 @@ export type Scalars = { BigInt: any; Bytes: any; Int8: any; + Timestamp: any; }; export enum Aggregation_Interval { @@ -334,6 +335,8 @@ export enum ClrFund_OrderBy { CurrentRoundMaci = 'currentRound__maci', CurrentRoundMaciTxHash = 'currentRound__maciTxHash', CurrentRoundMatchingPoolSize = 'currentRound__matchingPoolSize', + CurrentRoundMaxMessages = 'currentRound__maxMessages', + CurrentRoundMaxVoteOptions = 'currentRound__maxVoteOptions', CurrentRoundMessageTreeDepth = 'currentRound__messageTreeDepth', CurrentRoundNativeToken = 'currentRound__nativeToken', CurrentRoundPollAddress = 'currentRound__pollAddress', @@ -503,6 +506,8 @@ export enum Contribution_OrderBy { FundingRoundMaci = 'fundingRound__maci', FundingRoundMaciTxHash = 'fundingRound__maciTxHash', FundingRoundMatchingPoolSize = 'fundingRound__matchingPoolSize', + FundingRoundMaxMessages = 'fundingRound__maxMessages', + FundingRoundMaxVoteOptions = 'fundingRound__maxVoteOptions', FundingRoundMessageTreeDepth = 'fundingRound__messageTreeDepth', FundingRoundNativeToken = 'fundingRound__nativeToken', FundingRoundPollAddress = 'fundingRound__pollAddress', @@ -1031,6 +1036,8 @@ export enum Donation_OrderBy { FundingRoundMaci = 'fundingRound__maci', FundingRoundMaciTxHash = 'fundingRound__maciTxHash', FundingRoundMatchingPoolSize = 'fundingRound__matchingPoolSize', + FundingRoundMaxMessages = 'fundingRound__maxMessages', + FundingRoundMaxVoteOptions = 'fundingRound__maxVoteOptions', FundingRoundMessageTreeDepth = 'fundingRound__messageTreeDepth', FundingRoundNativeToken = 'fundingRound__nativeToken', FundingRoundPollAddress = 'fundingRound__pollAddress', @@ -1070,6 +1077,8 @@ export type FundingRound = { maci: Maybe; maciTxHash: Maybe; matchingPoolSize: Maybe; + maxMessages: Maybe; + maxVoteOptions: Maybe; messageTreeDepth: Maybe; messages: Maybe>; nativeToken: Maybe; @@ -1303,6 +1312,22 @@ export type FundingRound_Filter = { matchingPoolSize_lte: InputMaybe; matchingPoolSize_not: InputMaybe; matchingPoolSize_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>; + maxVoteOptions: InputMaybe; + maxVoteOptions_gt: InputMaybe; + maxVoteOptions_gte: InputMaybe; + maxVoteOptions_in: InputMaybe>; + maxVoteOptions_lt: InputMaybe; + maxVoteOptions_lte: InputMaybe; + maxVoteOptions_not: InputMaybe; + maxVoteOptions_not_in: InputMaybe>; messageTreeDepth: InputMaybe; messageTreeDepth_gt: InputMaybe; messageTreeDepth_gte: InputMaybe; @@ -1524,6 +1549,8 @@ export enum FundingRound_OrderBy { Maci = 'maci', MaciTxHash = 'maciTxHash', MatchingPoolSize = 'matchingPoolSize', + MaxMessages = 'maxMessages', + MaxVoteOptions = 'maxVoteOptions', MessageTreeDepth = 'messageTreeDepth', Messages = 'messages', NativeToken = 'nativeToken', @@ -1728,6 +1755,8 @@ export enum Message_OrderBy { FundingRoundMaci = 'fundingRound__maci', FundingRoundMaciTxHash = 'fundingRound__maciTxHash', FundingRoundMatchingPoolSize = 'fundingRound__matchingPoolSize', + FundingRoundMaxMessages = 'fundingRound__maxMessages', + FundingRoundMaxVoteOptions = 'fundingRound__maxVoteOptions', FundingRoundMessageTreeDepth = 'fundingRound__messageTreeDepth', FundingRoundNativeToken = 'fundingRound__nativeToken', FundingRoundPollAddress = 'fundingRound__pollAddress', @@ -1832,6 +1861,8 @@ export enum Poll_OrderBy { FundingRoundMaci = 'fundingRound__maci', FundingRoundMaciTxHash = 'fundingRound__maciTxHash', FundingRoundMatchingPoolSize = 'fundingRound__matchingPoolSize', + FundingRoundMaxMessages = 'fundingRound__maxMessages', + FundingRoundMaxVoteOptions = 'fundingRound__maxVoteOptions', FundingRoundMessageTreeDepth = 'fundingRound__messageTreeDepth', FundingRoundNativeToken = 'fundingRound__nativeToken', FundingRoundPollAddress = 'fundingRound__pollAddress', @@ -1955,6 +1986,8 @@ export enum PublicKey_OrderBy { FundingRoundMaci = 'fundingRound__maci', FundingRoundMaciTxHash = 'fundingRound__maciTxHash', FundingRoundMatchingPoolSize = 'fundingRound__matchingPoolSize', + FundingRoundMaxMessages = 'fundingRound__maxMessages', + FundingRoundMaxVoteOptions = 'fundingRound__maxVoteOptions', FundingRoundMessageTreeDepth = 'fundingRound__messageTreeDepth', FundingRoundNativeToken = 'fundingRound__nativeToken', FundingRoundPollAddress = 'fundingRound__pollAddress', @@ -3223,7 +3256,7 @@ export type GetRoundInfoQueryVariables = Exact<{ }>; -export type GetRoundInfoQuery = { __typename?: 'Query', fundingRound: { __typename?: 'FundingRound', id: string, maci: any | null, pollId: 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 GetRoundInfoQuery = { __typename?: 'Query', fundingRound: { __typename?: 'FundingRound', id: string, maci: any | null, pollId: 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, maxMessages: any | null, maxVoteOptions: 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<{ clrFundAddress: Scalars['String']; @@ -3436,6 +3469,8 @@ export const GetRoundInfoDocument = gql` votingDeadline coordinatorPubKeyX coordinatorPubKeyY + maxMessages + maxVoteOptions stateTreeDepth messageTreeDepth voteOptionTreeDepth diff --git a/vue-app/src/graphql/queries/GetRoundInfo.graphql b/vue-app/src/graphql/queries/GetRoundInfo.graphql index d5995c8ff..73f2cb9fb 100644 --- a/vue-app/src/graphql/queries/GetRoundInfo.graphql +++ b/vue-app/src/graphql/queries/GetRoundInfo.graphql @@ -22,6 +22,8 @@ query GetRoundInfo($fundingRoundAddress: ID!) { votingDeadline coordinatorPubKeyX coordinatorPubKeyY + maxMessages + maxVoteOptions stateTreeDepth messageTreeDepth voteOptionTreeDepth