You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the buy_ticket function so members can purchase a ticket for an event using the payment token. Work inside contracts/sandbox/event_ticketing/.
Acceptance Criteria
buy_ticket(env, buyer, ticket_id, event_id) is implemented
buyer.require_auth() is called
Returns Error::EventNotFound if event doesn't exist
Returns Error::EventNotActive if event is not in Active status
Returns Error::EventSoldOut if no capacity remains
Transfers ticket_price from buyer to contract
Creates and stores a Ticket record; indexes it under event and owner
Overview
Implement the
buy_ticketfunction so members can purchase a ticket for an event using the payment token. Work insidecontracts/sandbox/event_ticketing/.Acceptance Criteria
buy_ticket(env, buyer, ticket_id, event_id)is implementedbuyer.require_auth()is calledError::EventNotFoundif event doesn't existError::EventNotActiveif event is not inActivestatusError::EventSoldOutif no capacity remainsticket_pricefrom buyer to contractTicketrecord; indexes it under event and ownercargo build