Skip to content

Epic: Crypto real-time split — organizer paid on-chain via mintTicket #96

Description

@manoahLinks

Tracking epic for settling crypto (USDC) ticket revenue on-chain, routed by isRefundable. Supersedes the accumulate-then-withdraw assumptions in #37 and the internal-transfer leg of #68.

Architecture (verified against the deployed Base Sepolia MarketplaceFacet)

Crypto checkout settles via the Diamond's mintTicket(ticketId, USDC, buyer), which splits on-chain by isRefundable:

  • Non-refundable → organizer's cut (ticketFee) transferred instantly to the on-chain ticketAdmin (the organizer) in the mint tx; HostIT's 3% accrues to hostItBalance.
  • Refundable → organizer's cut escrowed; claimRefund valid endTime..endTime+3d; withdrawTicketBalance releases it after the window (WithdrawPeriodNotReached gate is conditional on isRefundable).

The buyer never transacts on-chain — a HostIT settlement wallet holds the deposited USDC and signs mintTicket; only that wallet + user wallets need gas (Circle Gas Station).

Phase 1 — foundation ✅ (branch feat/crypto-onchain-split)

  • executeContract accepts a signer walletId (default treasury)
  • createTicket signed by the organizer → organizer is the on-chain ticketAdmin (payout target + mainAdmin + scanner-role holder)
  • Publish configures on-chain fee as USDC (NGN→USDC 6-dp), replacing the ETH placeholder
  • Fix stale FeeType map to the deployed Base enum (USDC=5, NATIVE=2, …)
  • On-chain checkIn signed by the scanner's wallet (role holder), not treasury

Phase 2 — scanner delegation

  • Organizer endpoint: grant/revoke ticketAdminRole to other HostIT users (organizer-signed addTicketAdmins / removeTicketAdmins)
  • Check-in worker resolves delegated scanner wallets; handle admin-scanned check-ins (admins have no wallet today)

Phase 3 — crypto settlement + refunds

Ops prerequisite

  • Circle Gas Station paymaster policy for the user wallet set (CIRCLE_WALLET_SET_ID) on Base-Sepolia + Base, funded — organizer-signed createTicket/checkIn fail without it.

Refs #37, #68

Metadata

Metadata

Assignees

No one assigned

    Labels

    cryptoCryptocurrency and stablecoin operations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions