Skip to main content
Version: v2.0_alpha

PollFactory

A factory contract which deploys Poll contracts. It allows the MACI contract size to stay within the limit set by EIP-170.

InvalidMaxVoteOptions

error InvalidMaxVoteOptions()

constructor

constructor() public payable

The PollFactory constructor

deploy

function deploy(uint256 _duration, uint256 _maxVoteOptions, struct Params.TreeDepths _treeDepths, uint8 _messageBatchSize, struct DomainObjs.PubKey _coordinatorPubKey, address _maci) public virtual returns (address pollAddr)

Deploy a new Poll contract

Parameters

NameTypeDescription
_durationuint256The duration of the poll
_maxVoteOptionsuint256The max vote options for the poll
_treeDepthsstruct Params.TreeDepthsThe depths of the merkle trees
_messageBatchSizeuint8The size of message batch
_coordinatorPubKeystruct DomainObjs.PubKeyThe coordinator's public key
_maciaddressThe MACI contract interface reference

Return Values

NameTypeDescription
pollAddraddressThe deployed Poll contract