Overview
Council elections allow token holders to vote for candidates. The top candidates (by vote amount) become council members. Voting requires locking tokens in the Council contract.Election Flow
Election Starts
An election is initiated (requires EIP-712 signature from the platform). The election has a fixed duration.
Voting Period
Token holders approve their tokens to the Council contract, then call
voteElection() to vote for candidates. Tokens are locked until the election ends.Election Ends
After
endTime, anyone can call claimElectionTokens(). The first caller triggers finalization — top candidates become council members.Reading Election State
Election State Fields
| Field | Type | Description |
|---|---|---|
active | bool | Whether an election is currently running |
endTime | uint256 | Election end timestamp (unix seconds) |
lastElectionEnd | uint256 | When the last election ended |
finalized | bool | Whether the current/last election results are finalized |
councilSize | uint256 | Number of council seats |
epoch | uint256 | Election epoch counter |
Voting in an Election
Checking Candidates
Claiming Tokens After Election
After the election ends (block.timestamp > endTime):
Reading Council Members
Events
| Event | Description |
|---|---|
ElectionStarted(token, endTime, councilSize) | Election begins |
ElectionVoted(token, voter, totalLocked, candidates, amounts) | A vote is cast |
ElectionFinalized(token, councilMembers) | Election results finalized |
ElectionTokensClaimed(token, voter, amount) | Voter claims locked tokens |