Skip to content
Lattice

Poll

Git Source

A poll's storage.

APPEND-ONLY: new fields may only be added at the end.

struct Poll {
    uint256 groupId; // the Semaphore group whose members may vote
    NullifierRegistryLib.Registry nullifiers; // per-poll spent set (scope = pollId)
    mapping(uint256 choice => uint256 votes) tally; // votes per option
    uint256 totalVotes; // total ballots counted
    address creator; // the group admin who created the poll
    uint32 numChoices; // valid options: 0..numChoices-1
    uint64 startTime; // voting opens (0 = immediately)
    uint64 endTime; // voting closes (0 = never)
    bool exists;
}

Properties

NameTypeDescription
groupIduint256
nullifiersNullifierRegistryLib.Registry
tallymapping(uint256 choice => uint256 votes)
totalVotesuint256
creatoraddress
numChoicesuint32
startTimeuint64
endTimeuint64
existsbool