Skip to content

Conversation

@kantorcodes
Copy link
Member

@kantorcodes kantorcodes commented Oct 20, 2025

Summary

HCS-8 + HCS-9 implementation

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 191 to 200
const existingVotes = this.state.results.voterWeight.get(voter);
if (existingVotes && !this.evaluator.allowVoteChanges()) {
this.recordError(message.op, 'Vote changes are not permitted', timestamp);
return;
}
if (existingVotes && this.evaluator.allowVoteChanges()) {
this.removeExistingVotes(voter);
}

this.state.results = applyVotes(this.state.results, votes);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Record votes under payer identity instead of entry accounts

During applyVote the permission and weight checks are keyed on message.d.accountId (the transaction payer), but the call to applyVotes stores weights under each vote.accountId. Because the per‑voter ledger lookup at line 191 also uses message.d.accountId, a payer can send multiple messages where the votes array contains different accountId values; each call passes validation (weight is limited per message) yet the stored votes are tracked under the forged account IDs, so existingVotes is never found for the payer. This allows one user to repeatedly vote and attribute the weight to arbitrary accounts, bypassing both duplicate‑vote prevention and identity tracking. The entries’ account IDs should either be ignored/overridden with the payer or validated to match before updating results.

Useful? React with 👍 / 👎.

@kantorcodes kantorcodes changed the title Ensure HCS-8 demo shuts down client cleanly Feat: HCS-8 + HCS-9 Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants