ticketly is an Anchor-based Solana program for event lifecycle management, ticketing, gate check-in, whitelist controls, POAP issuance, and secondary-market listings.
Core entrypoint:
- Program:
ticketly - Program ID:
GawjtcQFx5cnK24VrDiUhGdg4DZbVGLzsSsd4vbxznfs
ticketly/programs/ticketly/src/lib.rs— instruction entrypointsticketly/programs/ticketly/src/instructions/*— business logic handlersticketly/programs/ticketly/src/contexts/*— account constraints (Anchor#[derive(Accounts)])ticketly/programs/ticketly/src/state/*— PDA account schemasticketly/programs/ticketly/src/utils/*— validation + NFT metadata helpersticketly/programs/ticketly/src/security.rs— reusable authorization/time-window guardsticketly/tests/ticketly.ts— end-to-end integration suite
Primary deterministic accounts:
- Platform config:
["platform"] - Organizer profile:
["organizer", authority] - Event:
["event", authority, event_id_le] - Ticket:
["ticket", event, ticket_number_le] - Ticket mint:
["ticket_mint", ticket] - Listing:
["listing", ticket] - POAP record:
["poap", ticket] - POAP mint:
["poap_mint", ticket] - Whitelist entry:
["whitelist", event, wallet]
PlatformConfig:admin,protocol_fee_bps,fee_receiver,creation_paused
OrganizerProfile:- identity metadata + organizer aggregate counters
EventAccount:- metadata, schedule, tier config, mint/check-in/revenue counters, resale policy, operator list, whitelist/POAP config
TicketAccount:- ownership, tier reference, mint, check-in/listing/transfer state
ListingAccount:- seller, escrow ATA, listing price/time
PoapRecordandWhitelistEntry:- attendance collectible and gated-sale allocation records
init_platform,update_platforminit_organizer,update_organizer
create_event,update_event,cancel_eventwithdraw_revenue
add_operator,remove_operatoradd_whitelist_entry,remove_whitelist_entrycheck_in_ticket
mint_tickettransfer_ticketmint_poap
list_ticketbuy_ticketcancel_listing
- Platform admin initializes protocol settings.
- Organizer initializes profile and creates event (tiers, schedule, resale policy).
- Buyers mint tickets (primary payment goes to event PDA).
- Gate operator/organizer checks in valid ticket holder.
- Organizer withdraws accumulated primary revenue.
- Ticket owner can list/cancel/sell on marketplace.
- On purchase, royalty is paid to
event.royalty_receiver, seller receives remaining amount, NFT custody moves from listing escrow ATA to buyer ATA.
- Authority checks:
- Event authority controls mutable event/admin actions.
- Gate operator must be authority or in event operator set.
- Time checks:
- Event creation enforces
event_start > nowandevent_end > event_start. - Check-in window opens
CHECK_IN_GRACE_Sbefore start.
- Event creation enforces
- Listing & transfer safety:
- Checked-in tickets cannot be listed/transferred as unrestricted assets.
- Ownership and token-account mint/owner constraints are enforced in account contexts.
- Monetary bounds:
- Royalty cap (
MAX_ROYALTY_BPS) and protocol fee cap (MAX_PROTOCOL_FEE). - Safe arithmetic helpers used for lamport calculations.
- Royalty cap (
The program emits typed events for observability and indexing:
- Event lifecycle (
EventCreated,EventUpdated,EventCancelled) - Ticket lifecycle (
TicketMinted,TicketTransferred,TicketCheckedIn) - Marketplace (
TicketListed,TicketSold,ListingCancelled) - Access control (
OperatorAdded,OperatorRemoved, whitelist events) - Revenue/POAP (
RevenueWithdrawn,PoapMinted)
Current integration suite (ticketly/tests/ticketly.ts) validates platform, organizer, event lifecycle, mint/transfer/check-in, whitelist, revenue withdrawal, marketplace, and cancellation behavior.
Latest run outcome: 26 passing.
- In localnet environments without Metaplex metadata executable, metadata CPI paths are handled defensively so core ticket workflows continue.
- For stable local runs,
anchor test --skip-local-validatorcan be used when an external validator is already running.