Skip to content

eip-712-ballots - #1733

Merged
efstajas merged 2 commits into
mainfrom
eip-712-ballots
Nov 12, 2025
Merged

efstajas merged 2 commits into
mainfrom
eip-712-ballots

Conversation

@efstajas

Copy link
Copy Markdown
Contributor

This pull request introduces a wallet-based signature flow for RPGF ballot submission, ensuring that ballots are cryptographically signed by the user's connected wallet before being submitted. The changes update both the user interface and backend logic to require and handle wallet signatures, and provide more explicit feedback to users about wallet confirmation steps.

Key changes include:

Wallet Signature Integration

  • Added a new signBallot utility (sign-ballot.ts) that generates a deterministic hash of the ballot, creates EIP-712 typed data, and prompts the user's wallet to sign the ballot before submission. The resulting signature and chainId are now included in all ballot submission payloads. [1] [2] [3] [4] [5]
  • Updated the SubmitBallotDto type to include signature and chainId fields, and refactored ballot submission functions (castBallot, castBallotAsCsv, castBallotAsXlsx) to require and transmit these fields. [1] [2]

User Interface Updates

  • Replaced the "submit" button icon and confirmation messages in the ballot upload and confirmation steps to use a wallet icon and more clearly instruct users to confirm the action in their wallet. [1] [2] [3] [4] [5] [6]
  • Added an AnnotationBox to the confirmation step, informing users that a wallet signature request will be triggered and reminding them to review their ballot before confirming.

Backend API and Ballot Parsing Refactor

  • Refactored spreadsheet ballot parsing and submission logic to first parse the spreadsheet into a ballot, then sign and submit it with the wallet signature, ensuring all ballot submission paths are covered by the new signature requirement.

These changes collectively enforce ballot authenticity via wallet signatures, improve user communication about wallet interactions, and streamline the ballot submission process.

@efstajas
efstajas requested a review from Copilot November 12, 2025 15:12
@railway-app

railway-app Bot commented Nov 12, 2025

Copy link
Copy Markdown

🚅 Deployed to the app-pr-1733 environment in Drips App

Service Status Web Updated (UTC)
App ◻️ Removed (View Logs) Web Nov 12, 2025 at 3:36 pm

@railway-app
railway-app Bot temporarily deployed to App (Drips App / app-pr-1733) November 12, 2025 15:13 Destroyed
@railway-app
railway-app Bot temporarily deployed to Drips Optimism App (Drips App / staging) November 12, 2025 15:15 Inactive
@railway-app
railway-app Bot temporarily deployed to Drips Sepolia App (Drips App / staging) November 12, 2025 15:15 Inactive
@railway-app
railway-app Bot temporarily deployed to Drips Mainnet App (Drips App / staging) November 12, 2025 15:15 Inactive
@railway-app
railway-app Bot temporarily deployed to Drips Metis App (Drips App / staging) November 12, 2025 15:15 Inactive
@railway-app
railway-app Bot temporarily deployed to Drips Filecoin App (Drips App / staging) November 12, 2025 15:15 Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces EIP-712 wallet signature verification for RPGF ballot submissions to ensure ballot authenticity. The implementation adds cryptographic signing to the ballot submission flow and updates the UI to clearly communicate wallet confirmation steps to users.

  • Adds a new signBallot utility that creates EIP-712 typed data from ballots and prompts users to sign with their wallet
  • Refactors ballot submission flows (JSON and spreadsheet-based) to require signatures and chainId
  • Updates UI components to use wallet icons and messaging that clearly indicates wallet confirmation is required

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/lib/utils/rpgf/types/ballot.ts Adds signature and chainId fields to SubmitBallotDto type
src/lib/utils/rpgf/sign-ballot.ts New utility for creating deterministic ballot hashes and generating EIP-712 signatures
src/lib/utils/rpgf/rpgf.ts Integrates signature signing into all ballot submission paths (JSON, CSV, XLSX) and refactors spreadsheet submission logic
src/lib/flows/submit-rpgf-ballot/steps/confirm.svelte Updates confirmation step with wallet icon, wallet-focused messaging, and annotation box explaining signature request
src/lib/flows/rpgf-spreadsheet-vote-flow/upload-ballot.svelte Updates spreadsheet upload UI with wallet icon and wallet confirmation messaging

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib/utils/rpgf/sign-ballot.ts
Comment thread src/lib/utils/rpgf/sign-ballot.ts
Comment thread src/lib/utils/rpgf/rpgf.ts
Comment thread src/lib/utils/rpgf/sign-ballot.ts
Comment thread src/lib/utils/rpgf/sign-ballot.ts
@railway-app
railway-app Bot temporarily deployed to App (Drips App / app-pr-1733) November 12, 2025 15:21 Destroyed
@railway-app
railway-app Bot temporarily deployed to Drips Metis App (Drips App / staging) November 12, 2025 15:21 Inactive
@railway-app
railway-app Bot temporarily deployed to Drips Optimism App (Drips App / staging) November 12, 2025 15:21 Inactive
@railway-app
railway-app Bot temporarily deployed to Drips Mainnet App (Drips App / staging) November 12, 2025 15:21 Inactive
@railway-app
railway-app Bot temporarily deployed to Drips Sepolia App (Drips App / staging) November 12, 2025 15:21 Inactive
@railway-app
railway-app Bot temporarily deployed to Drips Filecoin App (Drips App / staging) November 12, 2025 15:21 Inactive
@efstajas
efstajas marked this pull request as ready for review November 12, 2025 15:33
@efstajas
efstajas merged commit f2b9a29 into main Nov 12, 2025
11 of 15 checks passed
@efstajas
efstajas deleted the eip-712-ballots branch November 12, 2025 15:35
mhgbrown pushed a commit that referenced this pull request Nov 13, 2025
* eip-712-ballots

* allow re-submitting existing ballot without changes by holding down shift
mhgbrown pushed a commit that referenced this pull request Nov 25, 2025
* eip-712-ballots

* allow re-submitting existing ballot without changes by holding down shift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants