feat(zk-ticket): implement all entry points - #624
Merged
Conversation
Contributor
|
@Magrexy please fix the failing CI |
Implemented all four entry points in ZKTicketContract: - issue_ticket: derives deterministic ticket_id from monotonic nonce, stores ZKTicket with proof_hash, emits ticket_issued event - verify_ticket: compares presented proof against stored proof_hash, returns false if ticket already used or proof mismatch - use_ticket: requires owner auth, sets is_used = true, emits ticket_used event, rejects if already used - get_ticket: returns full ZKTicket state from storage Added #[contracttype] on ZKTicket struct, DataKey enum for storage keys, and TicketNotFound error variant. Added zk_ticket_contract to workspace members. Closes Gatheraa#504
Ran cargo fmt --all to resolve pre-existing formatting violations in escrow_contract/src/lib.rs that were causing the Contract Linting CI job to fail on all open PRs.
Remove cross_contract_contract and dutch_auction_contract from workspace members. These were added unnecessarily and caused cargo fmt --all to fail in CI due to formatting differences in their pre-existing stubs. Closes Gatheraa#504
Magrexy
force-pushed
the
fix/issue-504-zk-ticket
branch
from
July 23, 2026 13:14
64cdff3 to
c8a3241
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implemented all four entry points in
ZKTicketContractthat were previously stubs returningNotImplemented.Changes
issue_ticket: derives deterministicticket_idfrom monotonic nonce, storesZKTicketwithproof_hash, emitsticket_issuedeventverify_ticket: compares presented proof against storedproof_hash, returnsfalseif ticket already used or proof mismatchuse_ticket: requires owner auth, setsis_used = true, emitsticket_usedevent, rejects if already usedget_ticket: returns fullZKTicketstate from storage#[contracttype]onZKTicketstruct,DataKeyenum for storage keysTicketNotFounderror variantzk_ticket_contractto workspace membersCloses #504