IMACI
MACI interface
PollContracts
A struct holding the addresses of poll, mp and tally
struct PollContracts {
address poll;
address messageProcessor;
address tally;
}
DeployPollArgs
A struct holding the params for poll deployment
struct DeployPollArgs {
uint256 startDate;
uint256 endDate;
struct Params.TreeDepths treeDepths;
uint8 messageBatchSize;
struct DomainObjs.PubKey coordinatorPubKey;
address verifier;
address vkRegistry;
enum DomainObjs.Mode mode;
address policy;
address initialVoiceCreditProxy;
address[] relayers;
uint256 voteOptions;
}
stateTreeDepth
function stateTreeDepth() external view returns (uint8)
Get the depth of the state tree
Return Values
Name | Type | Description |
---|---|---|
[0] | uint8 | The depth of the state tree |
getStateTreeRoot
function getStateTreeRoot() external view returns (uint256)
Return the main root of the StateAq contract
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The Merkle root |
getStateIndex
function getStateIndex(uint256 _pubKeyHash) external view returns (uint256)
Get the index of a public key in the state tree
Parameters
Name | Type | Description |
---|---|---|
_pubKeyHash | uint256 | The hash of the public key |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | index The index of the public key in the state tree |
deployPoll
function deployPoll(struct IMACI.DeployPollArgs _pollArgs) external returns (struct IMACI.PollContracts)
Deploy a new Poll contract.
Parameters
Name | Type | Description |
---|---|---|
_pollArgs | struct IMACI.DeployPollArgs | The deploy poll args |
signUp
function signUp(struct DomainObjs.PubKey _pubKey, bytes _signUpPolicyData) external
Allows any eligible user sign up. The sign-up policy should prevent double sign-ups or ineligible users from doing so. This function will only succeed if the sign-up deadline has not passed.
Parameters
Name | Type | Description |
---|---|---|
_pubKey | struct DomainObjs.PubKey | The user's desired public key. |
_signUpPolicyData | bytes | Data to pass to the sign-up policy register() function. For instance, the POAPPolicy or TokenPolicy requires this value to be the ABI-encoded token ID. |
getStateRootOnIndexedSignUp
function getStateRootOnIndexedSignUp(uint256 _index) external view returns (uint256)
Return the state root when the '_index' user signed up
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | The serial number when the user signed up |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The Merkle root |
numSignUps
function numSignUps() external view returns (uint256)
Get the number of signups
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | numsignUps The number of signups |
nextPollId
function nextPollId() external view returns (uint256)
Get the next poll ID
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The next poll ID |