IPoll
Poll interface
numSignUpsAndMessages
function numSignUpsAndMessages() external view returns (uint256 numSignups, uint256 numMsgs)
The number of messages which have been processed and the number of signups
Return Values
Name | Type | Description |
---|---|---|
numSignups | uint256 | The number of signups |
numMsgs | uint256 | The number of messages sent by voters |
getBatchHashes
function getBatchHashes() external view returns (uint256[])
Get all message batch hashes
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256[] | betchHashes array containing all batch hashes |
padLastBatch
function padLastBatch() external
Pad last unclosed batch
publishMessage
function publishMessage(struct DomainObjs.Message _message, struct DomainObjs.PubKey _encPubKey) external
Allows anyone to publish a message (an encrypted command and signature). This function also enqueues the message.
Parameters
Name | Type | Description |
---|---|---|
_message | struct DomainObjs.Message | The message to publish |
_encPubKey | struct DomainObjs.PubKey | An epheremal public key which can be combined with the coordinator's private key to generate an ECDH shared key with which to encrypt the message. |
mergeMaciState
function mergeMaciState() external
The second step of merging the MACI state. This allows the ProcessMessages circuit to access the latest state tree and ballots via currentSbCommitment.
getDeployTimeAndDuration
function getDeployTimeAndDuration() external view returns (uint256 _deployTime, uint256 _duration)
Returns the Poll's deploy time and duration
Return Values
Name | Type | Description |
---|---|---|
_deployTime | uint256 | The deployment timestamp |
_duration | uint256 | The duration of the poll |
stateMerged
function stateMerged() external view returns (bool)
Get the result of whether the MACI contract's stateAq has been merged by this contract
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | Whether the MACI contract's stateAq has been merged by this contract |
treeDepths
function treeDepths() external view returns (uint8 intStateTreeDepth, uint8 voteOptionTreeDepth)
Get the depths of the merkle trees
Return Values
Name | Type | Description |
---|---|---|
intStateTreeDepth | uint8 | The depth of the state tree |
voteOptionTreeDepth | uint8 | The subdepth of the vote option tree |
maxVoteOptions
function maxVoteOptions() external view returns (uint256)
Get the max vote options for the poll
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | maxVoteOptions The maximum number of vote options |
messageBatchSize
function messageBatchSize() external view returns (uint8)
Get message batch size for the poll
Return Values
Name | Type | Description |
---|---|---|
[0] | uint8 | The message batch size |
coordinatorPubKeyHash
function coordinatorPubKeyHash() external view returns (uint256 _coordinatorPubKeyHash)
Get the hash of coordinator's public key
Return Values
Name | Type | Description |
---|---|---|
_coordinatorPubKeyHash | uint256 | the hash of coordinator's public key |
currentSbCommitment
function currentSbCommitment() external view returns (uint256)
Get the commitment to the state leaves and the ballots. This is hash3(stateRoot, ballotRoot, salt). Its initial value should be hash(maciStateRootSnapshot, emptyBallotRoot, 0) Each successful invocation of processMessages() should use a different salt to update this value, so that an external observer cannot tell in the case that none of the messages are valid.
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The commitment to the state leaves and the ballots |
actualStateTreeDepth
function actualStateTreeDepth() external view returns (uint8)
Get the dynamic depth of the state tree at the time of poll finalization (based on the number of leaves inserted)
extContracts
function extContracts() external view returns (contract IMACI maci)
Get the external contracts
Return Values
Name | Type | Description |
---|---|---|
maci | contract IMACI | The IMACI contract |