Contract 781e2616387a68e4f90f96011f72574862fdbf96edcc8f8661970b921b47ccfe

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.89.0

Instances

  • CDIQ6JCW6UGLKBNINAJKTDRICA5ZRP5MNS6HGB7I3NRTYRTDRDHO7Y6I

Interface

One-time setup. Records the admin and the settlement token (XLM SAC).

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    token: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Organizer creates an event. Returns the new event id.

Auth: requires the organizer's signature.

fn create_event(
    env: soroban_sdk::Env,
    organizer: soroban_sdk::Address,
    price: i128,
    capacity: u32,
    start_time: u64,
) -> Result

Buyer buys a ticket for event_id. The price is escrowed into the contract and an on-chain ticket is recorded. Returns the new ticket id.

Auth: requires the buyer's signature (the same authorization covers the inner SAC transfer(buyer -> contract)).

fn buy(
    env: soroban_sdk::Env,
    event_id: u64,
    buyer: soroban_sdk::Address,
) -> Result

Organizer checks a holder in. Marks the ticket Used on-chain and settles the escrowed price to the organizer.

Auth: requires the event organizer's signature (organizer-only).

fn check_in(env: soroban_sdk::Env, ticket_id: u64) -> Result<(), soroban_sdk::Error>

Buyer refunds a ticket before the event starts. Returns the escrowed price to the owner and flips the ticket to Refunded.

Auth: requires the ticket owner's signature.

fn refund(env: soroban_sdk::Env, ticket_id: u64) -> Result

Organizer cancels an event, stopping further sales. Existing tickets can still be refunded before the start time.

fn cancel_event(env: soroban_sdk::Env, event_id: u64) -> Result<(), soroban_sdk::Error>
fn get_event(env: soroban_sdk::Env, event_id: u64) -> Result
fn get_ticket(
    env: soroban_sdk::Env,
    ticket_id: u64,
) -> Result
fn total_events(env: soroban_sdk::Env) -> u64
fn total_tickets(env: soroban_sdk::Env) -> u64
fn get_admin(env: soroban_sdk::Env) -> Result
fn get_token(env: soroban_sdk::Env) -> Result

Imports

WebAssembly Text (WAT) ▶