Technical Reference
UserVote
Contract addressNot applicable to type definitions
Hash-verified
0x2d30c8e7…565e9bSource details
| Property | Value |
|---|---|
| Keccak256 Hash | 0x2d30c8e7f280d25e7ef2343e9681f4818ff107456ab57944bebd78c054565e9b |
| Source URL | https://raw.githubusercontent.com/busytoby/atropa_pulsechain/58607494f7741b80525953e4a85bc99e66fd20fc/solidity/dysnomia/include/uservote.sol |
| Source Revision | 58607494f7741b80525953e4a85bc99e66fd20fc |
| Source Status | Canonical source snapshot; deployed bytecode equivalence is only established where a deployment record says so. |
| 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-09-14T19:34:19Z |
Overview
Section titled “Overview”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
What This Means For Players
Section titled “What This Means For Players”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
Definition
Section titled “Definition”struct UserVote { uint16 Vote; // ID of voted submission uint8 Submissions; // Number of submissions this round uint64 Round; // Current round number}Field Descriptions
Section titled “Field Descriptions”| 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 |
Voting Mechanic
Section titled “Voting Mechanic”- Users submit phrases (tracked in Submissions)
- Users vote for their favorite submission
- Vote is stored with round context
- Round changes invalidate old votes
Usage Patterns
Section titled “Usage Patterns”Tracking Votes
Section titled “Tracking Votes”mapping(uint64 soul => UserVote) userVotes;
// User submits a phraseuserVotes[soul].Submissions++;
// User votesuserVotes[soul].Vote = submissionId;userVotes[soul].Round = currentRound;Round Management
Section titled “Round Management”// Check if vote is currentfunction isValidVote(uint64 soul) view returns (bool) { return userVotes[soul].Round == currentRound;}
// New round resets contextfunction newRound() { currentRound++; // Old votes become invalid (wrong round)}Submission Limits
Section titled “Submission Limits”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...}Dependencies
Section titled “Dependencies”None - standalone struct definition.
Used By
Section titled “Used By”Game contracts that implement voting mechanics for the acronym game.
Example Flow
Section titled “Example Flow”// Round 1 startsuint64 currentRound = 1;
// Alice submits twice and votesuserVotes[aliceSoul] = UserVote({ Vote: 5, // Voted for submission #5 Submissions: 2, // Submitted 2 phrases Round: 1});
// Bob submits once, hasn't voteduserVotes[bobSoul] = UserVote({ Vote: 0, // No vote yet Submissions: 1, Round: 1});
// Round 2 starts - old votes invalidcurrentRound = 2;// Alice's vote for submission #5 no longer counts// (userVotes[aliceSoul].Round != currentRound)Storage Considerations
Section titled “Storage Considerations”- 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
Structs
Section titled “Structs”UserVote
Section titled “UserVote”struct UserVote { uint16 Vote; uint8 Submissions; uint64 Round;}