Technical Reference

UserVote

Source updated:
Last updated:
Source Revision 0x2d30c8e7…565e9b
Property Value
Source Revision 0x2d30c8e7f280d25e7ef2343e9681f4818ff107456ab57944bebd78c054565e9b
Source URL https://raw.githubusercontent.com/busytoby/atropa_pulsechain/2d995a79506bb1a4122d4fa585ab2cf1594cc253/solidity/dysnomia/include/uservote.sol
Source commit 2d995a79506bb1a4122d4fa585ab2cf1594cc253
Source Status Source snapshot; source hashes do not establish deployed bytecode equivalence.
Compiler solc 0.8.21; optimizer enabled with 200 runs
Compiler Configuration {"evmVersion":"compiler-default","optimizer":{"enabled":true,"runs":200},"version":"0.8.21+commit.d9974bed.Linux.g++"}
Compilation Closure Hash 0x425de2e935e48b402977d3bb270a60c533d729a75e1048f3da84f10582183b29
Compilation Closure Files 1
Hash Generated 2026-04-20T02:38:30Z

UserVote tracks a user’s voting activity in the acronym game, including their vote choice, submission count, and current round.

  • Kind: Type Definitions Module
  • License: Sharia
  • Solidity: ^0.8.21
  • Source: include/uservote.sol
Contract addressNot applicable to type definitions

Plain English Summary: UserVote is your voting record for the word game. It tracks which submission you voted for, how many phrases you submitted this round, and which round you participated in. Votes reset each round.

Real-World Analogy: Think of it like a ballot at a talent show. It records which act you voted for (Vote), how many times you performed (Submissions), and which episode it was (Round). Next episode, you get a fresh ballot.

How It Affects Your Gameplay:

  • One vote per round - Your Vote field stores your single vote choice
  • Submission tracking - The game tracks how many phrases you submitted
  • Round expiry - When a new round starts, your old vote doesn’t count anymore
struct UserVote {
uint16 Vote; // ID of voted submission
uint8 Submissions; // Number of submissions this round
uint64 Round; // Current round number
}
Field Type Purpose
Vote uint16 The ACRONYM.Id that the user voted for
Submissions uint8 How many phrases user submitted (0-255)
Round uint64 Which round this vote applies to
  1. Users submit phrases (tracked in Submissions)
  2. Users vote for their favorite submission
  3. Vote is stored with round context
  4. Round changes invalidate old votes
mapping(uint64 soul => UserVote) userVotes;
// User submits a phrase
userVotes[soul].Submissions++;
// User votes
userVotes[soul].Vote = submissionId;
userVotes[soul].Round = currentRound;
// Check if vote is current
function isValidVote(uint64 soul) view returns (bool) {
return userVotes[soul].Round == currentRound;
}
// New round resets context
function newRound() {
currentRound++;
// Old votes become invalid (wrong round)
}
uint8 constant MAX_SUBMISSIONS = 3;
function submit(string memory phrase) {
UserVote storage uv = userVotes[getSoul()];
require(uv.Submissions < MAX_SUBMISSIONS, "Too many submissions");
uv.Submissions++;
// Store phrase...
}

None - standalone struct definition.

Game contracts that implement voting mechanics for the acronym game.

// Round 1 starts
uint64 currentRound = 1;
// Alice submits twice and votes
userVotes[aliceSoul] = UserVote({
Vote: 5, // Voted for submission #5
Submissions: 2, // Submitted 2 phrases
Round: 1
});
// Bob submits once, hasn't voted
userVotes[bobSoul] = UserVote({
Vote: 0, // No vote yet
Submissions: 1,
Round: 1
});
// Round 2 starts - old votes invalid
currentRound = 2;
// Alice's vote for submission #5 no longer counts
// (userVotes[aliceSoul].Round != currentRound)
  • uint16 Vote: Supports up to 65,535 submissions per round
  • uint8 Submissions: Limits to 255 submissions per user per round
  • uint64 Round: Supports ~18 quintillion rounds

struct UserVote {
uint16 Vote;
uint8 Submissions;
uint64 Round;
}