Skip to content

Wire Soroban contract stubs into vote submission and result tally #19

Description

@grantfox-oss

The roadmap marks Soroban smart contracts as complete
but the note reads "stub — correct stellar-sdk v12 APIs,
ready to wire." The contracts/ directory exists in core
with the correct Stellar SDK v12 API surface but no
contract calls are made from any route handler. The
public verifiability guarantee — that anyone can
independently verify a result on the Stellar ledger —
cannot be fulfilled until these stubs are wired in.

Scope:

  • POST /api/votes — after a successful vote write,
    call record_vote on the Soroban contract and store
    the returned transaction ID against the vote record
  • POST /api/results/:ballotId/tally — after tally
    computation, call finalise_result and store the
    transaction ID against the result record
  • Surface the Stellar transaction ID on
    GET /api/results/:ballotId so the frontend can
    display it on the public verification page
  • Both calls must fail gracefully — a Stellar network
    error must not roll back the vote or tally, mark
    the record as pending_anchor and queue a retry

Acceptance Criteria:

  • record_vote called after every successful vote write
  • finalise_result called after every successful tally
  • Stellar transaction ID returned in results response
  • Stellar failure marks record pending_anchor without
    rolling back the vote or tally
  • SOROBAN_CONTRACT_ID read from environment —
    app logs a warning on startup if it is missing

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignenhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions