buildVoteSubmissionScript
@totemsdk/kissvm / buildVoteSubmissionScript
Function: buildVoteSubmissionScript()
buildVoteSubmissionScript(
config):string
Build a vote-submission script that enforces:
- Voting window is open (block between votingStartsAt and votingEndsAt)
- Voter is in the membership snapshot (weight > 0)
- No double vote (nonce spent via INC)
- Vote weight matches attested membership weight
- Choice is valid (yes/no/abstain, mutually exclusive)
Port layout (STATE / PREVSTATE): 0 — voter pk (hex, committed on first vote submit) 1 — nonce (incremented each vote to prevent replay) 2 — attested membership weight 3 — choice (0=yes, 1=no, 2=abstain) 4 — vote weight submitted 5 — membership snapshot hash anchor
Parameters
config
Returns
string