Skip to main content
Version: v2.x

Minimal Anti Collusion Infrastructure (MACI) / genMaciStateFromContract

Function: genMaciStateFromContract()

genMaciStateFromContract(provider, address, coordinatorKeypair, pollId, fromBlock?, blocksPerRequest?, endBlock?, sleepAmount?): Promise<MaciState>

Defined in: packages/contracts/build/ts/genMaciState.d.ts:16

Generate a MaciState object from the events of a MACI and Poll smart contracts

Parameters

provider

Provider

the ethereum provider

address

string

the address of the MACI contract

coordinatorKeypair

Keypair

the keypair of the coordinator

pollId

bigint

the id of the poll for which we are fetching events

fromBlock?

number

the block number from which to start fetching events

blocksPerRequest?

number

the number of blocks to fetch in each request

endBlock?

number

the block number at which to stop fetching events

sleepAmount?

number

the amount of time to sleep between each request

Returns

Promise<MaciState>

an instance of MaciState